aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MatrixStorage.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-08 10:39:36 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-01-08 10:39:36 +0000
commit47d354924b10e3e928a4231ba5df091cea630f49 (patch)
tree8a85efa67b5d299d4d9e2ab48dfc2101eb46ea55 /Eigen/src/Core/MatrixStorage.h
parentb036eca902c85b647bbae52f3f3a41fd93bd59a7 (diff)
revert most of previous commit. It really is better to forbid default
constructor for dynamic-size matrices. Now why do I feel like a beheaded chicken running around?
Diffstat (limited to 'Eigen/src/Core/MatrixStorage.h')
-rw-r--r--Eigen/src/Core/MatrixStorage.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h
index db4feb195..ebeaf4922 100644
--- a/Eigen/src/Core/MatrixStorage.h
+++ b/Eigen/src/Core/MatrixStorage.h
@@ -80,7 +80,7 @@ class MatrixStorage<Scalar, Dynamic, ColsAtCompileTime>
{ return ColsAtCompileTime; }
public:
- MatrixStorage(int dim = 1) : m_rows(dim)
+ MatrixStorage(int dim) : m_rows(dim)
{
m_data = new Scalar[m_rows * ColsAtCompileTime];
}
@@ -92,6 +92,9 @@ class MatrixStorage<Scalar, Dynamic, ColsAtCompileTime>
~MatrixStorage()
{ delete[] m_data; }
+
+ private:
+ MatrixStorage();
};
template<typename Scalar, int RowsAtCompileTime>
@@ -120,7 +123,7 @@ class MatrixStorage<Scalar, RowsAtCompileTime, Dynamic>
{ return m_cols; }
public:
- MatrixStorage(int dim = 1) : m_cols(dim)
+ MatrixStorage(int dim) : m_cols(dim)
{
m_data = new Scalar[m_cols * RowsAtCompileTime];
}
@@ -132,6 +135,9 @@ class MatrixStorage<Scalar, RowsAtCompileTime, Dynamic>
~MatrixStorage()
{ delete[] m_data; }
+
+ private:
+ MatrixStorage();
};
template<typename Scalar>
@@ -161,13 +167,17 @@ class MatrixStorage<Scalar, Dynamic, Dynamic>
public:
- MatrixStorage(int rows = 1, int cols = 1) : m_rows(rows), m_cols(cols)
+ MatrixStorage(int rows, int cols) : m_rows(rows), m_cols(cols)
{
m_data = new Scalar[m_rows * m_cols];
}
~MatrixStorage()
{ delete[] m_data; }
+
+ private:
+ MatrixStorage();
+ MatrixStorage(int dim);
};
#endif // EIGEN_MATRIXSTORAGE_H