* update CMakeLists, only build instantiations if TEST_LIB is defined

* allow default Matrix constructor in dynamic size, defaulting to (1,
1), this is convenient in mandelbrot example.
This commit is contained in:
Benoit Jacob
2008-06-27 10:53:30 +00:00
parent 6de4871c8c
commit 844f69e4a9
3 changed files with 23 additions and 17 deletions

View File

@@ -2,3 +2,6 @@ ADD_SUBDIRECTORY(Core)
ADD_SUBDIRECTORY(LU)
ADD_SUBDIRECTORY(QR)
ADD_SUBDIRECTORY(Cholesky)
ADD_SUBDIRECTORY(Array)
ADD_SUBDIRECTORY(Geometry)
ADD_SUBDIRECTORY(Sparse)

View File

@@ -235,13 +235,12 @@ class Matrix : public MatrixBase<Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCol
EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, *=)
EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=)
/** Default constructor, does nothing. Only for fixed-size matrices.
* For dynamic-size matrices and vectors, this constructor is forbidden (guarded by
* an assertion) because it would leave the matrix without an allocated data buffer.
/** Default constructor, for fixed-size matrices, does nothing.
* For dynamic-size matrices, initializes with initial size 1x1, which is inefficient, hence
* when performance matters one should avoid using this constructor on dynamic-size matrices.
*/
inline explicit Matrix()
inline explicit Matrix() : m_storage(1, 1, 1)
{
ei_assert(RowsAtCompileTime != Dynamic && ColsAtCompileTime != Dynamic);
ei_assert(RowsAtCompileTime > 0 && ColsAtCompileTime > 0);
}