mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
* 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:
parent
6de4871c8c
commit
844f69e4a9
@ -1,5 +1,6 @@
|
|||||||
SET(Eigen_HEADERS Core CoreDeclarations LU Cholesky QR)
|
SET(Eigen_HEADERS Core CoreDeclarations LU Cholesky QR Geometry Sparse Array)
|
||||||
|
|
||||||
|
IF(TEST_LIB)
|
||||||
SET(Eigen_SRCS
|
SET(Eigen_SRCS
|
||||||
src/Core/CoreInstantiations.cpp
|
src/Core/CoreInstantiations.cpp
|
||||||
src/Cholesky/CholeskyInstantiations.cpp
|
src/Cholesky/CholeskyInstantiations.cpp
|
||||||
@ -7,6 +8,7 @@ SET(Eigen_SRCS
|
|||||||
)
|
)
|
||||||
|
|
||||||
ADD_LIBRARY(Eigen2 SHARED ${Eigen_SRCS})
|
ADD_LIBRARY(Eigen2 SHARED ${Eigen_SRCS})
|
||||||
|
ENDIF(TEST_LIB)
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g1 -O2")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g1 -O2")
|
||||||
@ -14,7 +16,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
SET(INCLUDE_INSTALL_DIR
|
SET(INCLUDE_INSTALL_DIR
|
||||||
"${CMAKE_INSTALL_PREFIX}/include/eigen2"
|
"${CMAKE_INSTALL_PREFIX}/include"
|
||||||
CACHE PATH
|
CACHE PATH
|
||||||
"The directory where we install the header files"
|
"The directory where we install the header files"
|
||||||
FORCE)
|
FORCE)
|
||||||
@ -24,9 +26,11 @@ INSTALL(FILES
|
|||||||
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen
|
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(TEST_LIB)
|
||||||
INSTALL(TARGETS Eigen2
|
INSTALL(TARGETS Eigen2
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib)
|
ARCHIVE DESTINATION lib)
|
||||||
|
ENDIF(TEST_LIB)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(src)
|
ADD_SUBDIRECTORY(src)
|
@ -2,3 +2,6 @@ ADD_SUBDIRECTORY(Core)
|
|||||||
ADD_SUBDIRECTORY(LU)
|
ADD_SUBDIRECTORY(LU)
|
||||||
ADD_SUBDIRECTORY(QR)
|
ADD_SUBDIRECTORY(QR)
|
||||||
ADD_SUBDIRECTORY(Cholesky)
|
ADD_SUBDIRECTORY(Cholesky)
|
||||||
|
ADD_SUBDIRECTORY(Array)
|
||||||
|
ADD_SUBDIRECTORY(Geometry)
|
||||||
|
ADD_SUBDIRECTORY(Sparse)
|
||||||
|
@ -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, *=)
|
||||||
EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=)
|
EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Matrix, /=)
|
||||||
|
|
||||||
/** Default constructor, does nothing. Only for fixed-size matrices.
|
/** Default constructor, for fixed-size matrices, does nothing.
|
||||||
* For dynamic-size matrices and vectors, this constructor is forbidden (guarded by
|
* For dynamic-size matrices, initializes with initial size 1x1, which is inefficient, hence
|
||||||
* an assertion) because it would leave the matrix without an allocated data buffer.
|
* 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);
|
ei_assert(RowsAtCompileTime > 0 && ColsAtCompileTime > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user