* 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

@ -1,12 +1,14 @@
SET(Eigen_HEADERS Core CoreDeclarations LU Cholesky QR)
SET(Eigen_HEADERS Core CoreDeclarations LU Cholesky QR Geometry Sparse Array)
SET(Eigen_SRCS
src/Core/CoreInstantiations.cpp
src/Cholesky/CholeskyInstantiations.cpp
src/QR/QrInstantiations.cpp
)
IF(TEST_LIB)
SET(Eigen_SRCS
src/Core/CoreInstantiations.cpp
src/Cholesky/CholeskyInstantiations.cpp
src/QR/QrInstantiations.cpp
)
ADD_LIBRARY(Eigen2 SHARED ${Eigen_SRCS})
ADD_LIBRARY(Eigen2 SHARED ${Eigen_SRCS})
ENDIF(TEST_LIB)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g1 -O2")
@ -14,7 +16,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(INCLUDE_INSTALL_DIR
"${CMAKE_INSTALL_PREFIX}/include/eigen2"
"${CMAKE_INSTALL_PREFIX}/include"
CACHE PATH
"The directory where we install the header files"
FORCE)
@ -24,9 +26,11 @@ INSTALL(FILES
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen
)
INSTALL(TARGETS Eigen2
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
IF(TEST_LIB)
INSTALL(TARGETS Eigen2
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
ENDIF(TEST_LIB)
ADD_SUBDIRECTORY(src)

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);
}