diff --git a/unsupported/Eigen/CholmodSupport b/Eigen/CholmodSupport similarity index 63% rename from unsupported/Eigen/CholmodSupport rename to Eigen/CholmodSupport index 8a4a130c3..09d6b9da4 100644 --- a/unsupported/Eigen/CholmodSupport +++ b/Eigen/CholmodSupport @@ -1,7 +1,7 @@ #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H #define EIGEN_CHOLMODSUPPORT_MODULE_H -#include "SparseExtra" +#include "SparseCore" #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" @@ -11,8 +11,8 @@ extern "C" { namespace Eigen { -/** \ingroup Unsupported_modules - * \defgroup CholmodSupport_Module Cholmod Support module +/** \ingroup Sparse_modules + * \defgroup CholmodSupport_Module CholmodSupport module * * * \code @@ -20,9 +20,10 @@ namespace Eigen { * \endcode */ -struct Cholmod {}; -#include "src/SparseExtra/CholmodSupportLegacy.h" -#include "src/SparseExtra/CholmodSupport.h" +#include "src/misc/Solve.h" +#include "src/misc/SparseSolve.h" + +#include "src/CholmodSupport/CholmodSupport.h" } // namespace Eigen diff --git a/Eigen/Sparse b/Eigen/Sparse index a6177fbf5..b419ec7b0 100644 --- a/Eigen/Sparse +++ b/Eigen/Sparse @@ -1,69 +1,27 @@ #ifndef EIGEN_SPARSE_MODULE_H #define EIGEN_SPARSE_MODULE_H -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include -#include -#include -#include -#include - -#ifdef EIGEN2_SUPPORT -#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -#endif - -#ifndef EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET -#error The sparse module API is not stable yet. To use it anyway, please define the EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET preprocessor token. -#endif - namespace Eigen { -/** \defgroup Sparse_Module Sparse module +/** \defgroup Sparse_modules Sparse modules * - * - * - * See the \ref TutorialSparse "Sparse tutorial" + * Meta-module including all related modules: + * - SparseCore + * - OrderingMethods + * - SparseCholesky + * - IterativeLinearSolvers * * \code * #include * \endcode */ -/** The type used to identify a general sparse storage. */ -struct Sparse {}; - -#include "src/Sparse/SparseUtil.h" -#include "src/Sparse/SparseMatrixBase.h" -#include "src/Sparse/CompressedStorage.h" -#include "src/Sparse/AmbiVector.h" -#include "src/Sparse/SparseMatrix.h" -#include "src/Sparse/MappedSparseMatrix.h" -#include "src/Sparse/SparseVector.h" -#include "src/Sparse/CoreIterators.h" -#include "src/Sparse/SparseBlock.h" -#include "src/Sparse/SparseTranspose.h" -#include "src/Sparse/SparseCwiseUnaryOp.h" -#include "src/Sparse/SparseCwiseBinaryOp.h" -#include "src/Sparse/SparseDot.h" -#include "src/Sparse/SparseAssign.h" -#include "src/Sparse/SparseRedux.h" -#include "src/Sparse/SparseFuzzy.h" -#include "src/Sparse/ConservativeSparseSparseProduct.h" -#include "src/Sparse/SparseSparseProductWithPruning.h" -#include "src/Sparse/SparseProduct.h" -#include "src/Sparse/SparseDenseProduct.h" -#include "src/Sparse/SparseDiagonalProduct.h" -#include "src/Sparse/SparseTriangularView.h" -#include "src/Sparse/SparseSelfAdjointView.h" -#include "src/Sparse/TriangularSolver.h" -#include "src/Sparse/SparseView.h" - } // namespace Eigen -#include "src/Core/util/ReenableStupidWarnings.h" +#include "SparseCore" +#include "OrderingMethods" +#include "SparseCholesky" +#include "IterativeLinearSolvers" #endif // EIGEN_SPARSE_MODULE_H diff --git a/Eigen/SparseCore b/Eigen/SparseCore new file mode 100644 index 000000000..c4535ea3e --- /dev/null +++ b/Eigen/SparseCore @@ -0,0 +1,64 @@ +#ifndef EIGEN_SPARSECORE_MODULE_H +#define EIGEN_SPARSECORE_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include +#include +#include +#include +#include + +namespace Eigen { + +/** \defgroup Sparse_Module SparseCore module + * + * This module provides a sparse matrix representation, and basic associatd matrix manipulations + * and operations. + * + * See the \ref TutorialSparse "Sparse tutorial" + * + * \code + * #include + * \endcode + * + * This module depends on: Core. + */ + +/** The type used to identify a general sparse storage. */ +struct Sparse {}; + +#include "src/SparseCore/SparseUtil.h" +#include "src/SparseCore/SparseMatrixBase.h" +#include "src/SparseCore/CompressedStorage.h" +#include "src/SparseCore/AmbiVector.h" +#include "src/SparseCore/SparseMatrix.h" +#include "src/SparseCore/MappedSparseMatrix.h" +#include "src/SparseCore/SparseVector.h" +#include "src/SparseCore/CoreIterators.h" +#include "src/SparseCore/SparseBlock.h" +#include "src/SparseCore/SparseTranspose.h" +#include "src/SparseCore/SparseCwiseUnaryOp.h" +#include "src/SparseCore/SparseCwiseBinaryOp.h" +#include "src/SparseCore/SparseDot.h" +#include "src/SparseCore/SparseAssign.h" +#include "src/SparseCore/SparseRedux.h" +#include "src/SparseCore/SparseFuzzy.h" +#include "src/SparseCore/ConservativeSparseSparseProduct.h" +#include "src/SparseCore/SparseSparseProductWithPruning.h" +#include "src/SparseCore/SparseProduct.h" +#include "src/SparseCore/SparseDenseProduct.h" +#include "src/SparseCore/SparseDiagonalProduct.h" +#include "src/SparseCore/SparseTriangularView.h" +#include "src/SparseCore/SparseSelfAdjointView.h" +#include "src/SparseCore/TriangularSolver.h" +#include "src/SparseCore/SparseView.h" + +} // namespace Eigen + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SPARSECORE_MODULE_H + diff --git a/unsupported/Eigen/SuperLUSupport b/Eigen/SuperLUSupport similarity index 82% rename from unsupported/Eigen/SuperLUSupport rename to Eigen/SuperLUSupport index 532cec8ce..291ecebf0 100644 --- a/unsupported/Eigen/SuperLUSupport +++ b/Eigen/SuperLUSupport @@ -1,7 +1,7 @@ #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H #define EIGEN_SUPERLUSUPPORT_MODULE_H -#include "SparseExtra" +#include "SparseCore" #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" @@ -30,8 +30,8 @@ namespace Eigen { struct SluMatrix; } namespace Eigen { -/** \ingroup Unsupported_modules - * \defgroup SuperLUSupport_Module Super LU support +/** \ingroup Sparse_modules + * \defgroup SuperLUSupport_Module SuperLUSupport module * * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. * @@ -40,10 +40,11 @@ namespace Eigen { * \endcode */ -#include "src/SparseExtra/SuperLUSupport.h" +#include "src/misc/Solve.h" +#include "src/misc/SparseSolve.h" + +#include "src/SuperLUSupport/SuperLUSupport.h" -struct SuperLULegacy {}; -#include "src/SparseExtra/SuperLUSupportLegacy.h" } // namespace Eigen diff --git a/unsupported/Eigen/UmfPackSupport b/Eigen/UmfPackSupport similarity index 63% rename from unsupported/Eigen/UmfPackSupport rename to Eigen/UmfPackSupport index 401f260e2..a3850adb0 100644 --- a/unsupported/Eigen/UmfPackSupport +++ b/Eigen/UmfPackSupport @@ -1,7 +1,7 @@ #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H #define EIGEN_UMFPACKSUPPORT_MODULE_H -#include "SparseExtra" +#include "SparseCore" #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" @@ -11,8 +11,8 @@ extern "C" { namespace Eigen { -/** \ingroup Unsupported_modules - * \defgroup UmfPackSupport_Module UmfPack support module +/** \ingroup Sparse_modules + * \defgroup UmfPackSupport_Module UmfPackSupport module * * * @@ -22,10 +22,10 @@ namespace Eigen { * \endcode */ -struct UmfPack {}; +#include "src/misc/Solve.h" +#include "src/misc/SparseSolve.h" -#include "src/SparseExtra/UmfPackSupport.h" -#include "src/SparseExtra/UmfPackSupportLegacy.h" +#include "src/UmfPackSupport/UmfPackSupport.h" } // namespace Eigen diff --git a/Eigen/src/CholmodSupport/CMakeLists.txt b/Eigen/src/CholmodSupport/CMakeLists.txt new file mode 100644 index 000000000..814dfa613 --- /dev/null +++ b/Eigen/src/CholmodSupport/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_CholmodSupport_SRCS "*.h") + +INSTALL(FILES + ${Eigen_CholmodSupport_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/CholmodSupport COMPONENT Devel + ) diff --git a/unsupported/Eigen/src/SparseExtra/CholmodSupport.h b/Eigen/src/CholmodSupport/CholmodSupport.h similarity index 100% rename from unsupported/Eigen/src/SparseExtra/CholmodSupport.h rename to Eigen/src/CholmodSupport/CholmodSupport.h diff --git a/unsupported/Eigen/src/IterativeSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h similarity index 100% rename from unsupported/Eigen/src/IterativeSolvers/BasicPreconditioners.h rename to Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h diff --git a/unsupported/Eigen/src/IterativeSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h similarity index 100% rename from unsupported/Eigen/src/IterativeSolvers/BiCGSTAB.h rename to Eigen/src/IterativeLinearSolvers/BiCGSTAB.h diff --git a/Eigen/src/IterativeLinearSolvers/CMakeLists.txt b/Eigen/src/IterativeLinearSolvers/CMakeLists.txt new file mode 100644 index 000000000..59ccc0072 --- /dev/null +++ b/Eigen/src/IterativeLinearSolvers/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h") + +INSTALL(FILES + ${Eigen_IterativeLinearSolvers_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/IterativeLinearSolvers COMPONENT Devel + ) diff --git a/unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h similarity index 100% rename from unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h rename to Eigen/src/IterativeLinearSolvers/ConjugateGradient.h diff --git a/unsupported/Eigen/src/IterativeSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h similarity index 100% rename from unsupported/Eigen/src/IterativeSolvers/IterativeSolverBase.h rename to Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h diff --git a/unsupported/Eigen/src/SparseExtra/Amd.h b/Eigen/src/OrderingMethods/Amd.h similarity index 100% rename from unsupported/Eigen/src/SparseExtra/Amd.h rename to Eigen/src/OrderingMethods/Amd.h diff --git a/Eigen/src/OrderingMethods/CMakeLists.txt b/Eigen/src/OrderingMethods/CMakeLists.txt new file mode 100644 index 000000000..9f4bb2758 --- /dev/null +++ b/Eigen/src/OrderingMethods/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_OrderingMethods_SRCS "*.h") + +INSTALL(FILES + ${Eigen_OrderingMethods_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/OrderingMethods COMPONENT Devel + ) diff --git a/Eigen/src/Sparse/CMakeLists.txt b/Eigen/src/Sparse/CMakeLists.txt deleted file mode 100644 index aa1468812..000000000 --- a/Eigen/src/Sparse/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -FILE(GLOB Eigen_Sparse_SRCS "*.h") - -INSTALL(FILES - ${Eigen_Sparse_SRCS} - DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Sparse COMPONENT Devel - ) diff --git a/Eigen/src/SparseCholesky/CMakeLists.txt b/Eigen/src/SparseCholesky/CMakeLists.txt new file mode 100644 index 000000000..375a59d7a --- /dev/null +++ b/Eigen/src/SparseCholesky/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_SparseCholesky_SRCS "*.h") + +INSTALL(FILES + ${Eigen_SparseCholesky_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel + ) diff --git a/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h b/Eigen/src/SparseCholesky/SimplicialCholesky.h similarity index 99% rename from unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h rename to Eigen/src/SparseCholesky/SimplicialCholesky.h index 2147af258..b9bed5d01 100644 --- a/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h +++ b/Eigen/src/SparseCholesky/SimplicialCholesky.h @@ -478,7 +478,7 @@ public: }; /** \class SimplicialCholesky - * \deprecated + * \deprecated use SimplicialLDLt or class SimplicialLLt * \sa class SimplicialLDLt, class SimplicialLLt */ template @@ -498,6 +498,7 @@ public: typedef internal::traits > LLtTraits; public: SimplicialCholesky() : Base(), m_LDLt(true) {} + SimplicialCholesky(const MatrixType& matrix) : Base(), m_LDLt(true) { diff --git a/Eigen/src/Sparse/AmbiVector.h b/Eigen/src/SparseCore/AmbiVector.h similarity index 100% rename from Eigen/src/Sparse/AmbiVector.h rename to Eigen/src/SparseCore/AmbiVector.h diff --git a/Eigen/src/SparseCore/CMakeLists.txt b/Eigen/src/SparseCore/CMakeLists.txt new file mode 100644 index 000000000..d860452a6 --- /dev/null +++ b/Eigen/src/SparseCore/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_SparseCore_SRCS "*.h") + +INSTALL(FILES + ${Eigen_SparseCore_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCore COMPONENT Devel + ) diff --git a/Eigen/src/Sparse/CompressedStorage.h b/Eigen/src/SparseCore/CompressedStorage.h similarity index 100% rename from Eigen/src/Sparse/CompressedStorage.h rename to Eigen/src/SparseCore/CompressedStorage.h diff --git a/Eigen/src/Sparse/ConservativeSparseSparseProduct.h b/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h similarity index 100% rename from Eigen/src/Sparse/ConservativeSparseSparseProduct.h rename to Eigen/src/SparseCore/ConservativeSparseSparseProduct.h diff --git a/Eigen/src/Sparse/CoreIterators.h b/Eigen/src/SparseCore/CoreIterators.h similarity index 100% rename from Eigen/src/Sparse/CoreIterators.h rename to Eigen/src/SparseCore/CoreIterators.h diff --git a/Eigen/src/Sparse/MappedSparseMatrix.h b/Eigen/src/SparseCore/MappedSparseMatrix.h similarity index 100% rename from Eigen/src/Sparse/MappedSparseMatrix.h rename to Eigen/src/SparseCore/MappedSparseMatrix.h diff --git a/Eigen/src/Sparse/SparseAssign.h b/Eigen/src/SparseCore/SparseAssign.h similarity index 100% rename from Eigen/src/Sparse/SparseAssign.h rename to Eigen/src/SparseCore/SparseAssign.h diff --git a/Eigen/src/Sparse/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h similarity index 100% rename from Eigen/src/Sparse/SparseBlock.h rename to Eigen/src/SparseCore/SparseBlock.h diff --git a/Eigen/src/Sparse/SparseCwiseBinaryOp.h b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h similarity index 100% rename from Eigen/src/Sparse/SparseCwiseBinaryOp.h rename to Eigen/src/SparseCore/SparseCwiseBinaryOp.h diff --git a/Eigen/src/Sparse/SparseCwiseUnaryOp.h b/Eigen/src/SparseCore/SparseCwiseUnaryOp.h similarity index 100% rename from Eigen/src/Sparse/SparseCwiseUnaryOp.h rename to Eigen/src/SparseCore/SparseCwiseUnaryOp.h diff --git a/Eigen/src/Sparse/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h similarity index 100% rename from Eigen/src/Sparse/SparseDenseProduct.h rename to Eigen/src/SparseCore/SparseDenseProduct.h diff --git a/Eigen/src/Sparse/SparseDiagonalProduct.h b/Eigen/src/SparseCore/SparseDiagonalProduct.h similarity index 100% rename from Eigen/src/Sparse/SparseDiagonalProduct.h rename to Eigen/src/SparseCore/SparseDiagonalProduct.h diff --git a/Eigen/src/Sparse/SparseDot.h b/Eigen/src/SparseCore/SparseDot.h similarity index 100% rename from Eigen/src/Sparse/SparseDot.h rename to Eigen/src/SparseCore/SparseDot.h diff --git a/Eigen/src/Sparse/SparseFuzzy.h b/Eigen/src/SparseCore/SparseFuzzy.h similarity index 100% rename from Eigen/src/Sparse/SparseFuzzy.h rename to Eigen/src/SparseCore/SparseFuzzy.h diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h similarity index 100% rename from Eigen/src/Sparse/SparseMatrix.h rename to Eigen/src/SparseCore/SparseMatrix.h diff --git a/Eigen/src/Sparse/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h similarity index 100% rename from Eigen/src/Sparse/SparseMatrixBase.h rename to Eigen/src/SparseCore/SparseMatrixBase.h diff --git a/Eigen/src/Sparse/SparseProduct.h b/Eigen/src/SparseCore/SparseProduct.h similarity index 100% rename from Eigen/src/Sparse/SparseProduct.h rename to Eigen/src/SparseCore/SparseProduct.h diff --git a/Eigen/src/Sparse/SparseRedux.h b/Eigen/src/SparseCore/SparseRedux.h similarity index 100% rename from Eigen/src/Sparse/SparseRedux.h rename to Eigen/src/SparseCore/SparseRedux.h diff --git a/Eigen/src/Sparse/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h similarity index 100% rename from Eigen/src/Sparse/SparseSelfAdjointView.h rename to Eigen/src/SparseCore/SparseSelfAdjointView.h diff --git a/Eigen/src/Sparse/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h similarity index 100% rename from Eigen/src/Sparse/SparseSparseProductWithPruning.h rename to Eigen/src/SparseCore/SparseSparseProductWithPruning.h diff --git a/Eigen/src/Sparse/SparseTranspose.h b/Eigen/src/SparseCore/SparseTranspose.h similarity index 100% rename from Eigen/src/Sparse/SparseTranspose.h rename to Eigen/src/SparseCore/SparseTranspose.h diff --git a/Eigen/src/Sparse/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h similarity index 100% rename from Eigen/src/Sparse/SparseTriangularView.h rename to Eigen/src/SparseCore/SparseTriangularView.h diff --git a/Eigen/src/Sparse/SparseUtil.h b/Eigen/src/SparseCore/SparseUtil.h similarity index 100% rename from Eigen/src/Sparse/SparseUtil.h rename to Eigen/src/SparseCore/SparseUtil.h diff --git a/Eigen/src/Sparse/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h similarity index 100% rename from Eigen/src/Sparse/SparseVector.h rename to Eigen/src/SparseCore/SparseVector.h diff --git a/Eigen/src/Sparse/SparseView.h b/Eigen/src/SparseCore/SparseView.h similarity index 100% rename from Eigen/src/Sparse/SparseView.h rename to Eigen/src/SparseCore/SparseView.h diff --git a/Eigen/src/Sparse/TriangularSolver.h b/Eigen/src/SparseCore/TriangularSolver.h similarity index 100% rename from Eigen/src/Sparse/TriangularSolver.h rename to Eigen/src/SparseCore/TriangularSolver.h diff --git a/Eigen/src/SuperLUSupport/CMakeLists.txt b/Eigen/src/SuperLUSupport/CMakeLists.txt new file mode 100644 index 000000000..b28ebe583 --- /dev/null +++ b/Eigen/src/SuperLUSupport/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_SuperLUSupport_SRCS "*.h") + +INSTALL(FILES + ${Eigen_SuperLUSupport_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SuperLUSupport COMPONENT Devel + ) diff --git a/unsupported/Eigen/src/SparseExtra/SuperLUSupport.h b/Eigen/src/SuperLUSupport/SuperLUSupport.h similarity index 100% rename from unsupported/Eigen/src/SparseExtra/SuperLUSupport.h rename to Eigen/src/SuperLUSupport/SuperLUSupport.h diff --git a/Eigen/src/UmfPackSupport/CMakeLists.txt b/Eigen/src/UmfPackSupport/CMakeLists.txt new file mode 100644 index 000000000..a57de0020 --- /dev/null +++ b/Eigen/src/UmfPackSupport/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB Eigen_UmfPackSupport_SRCS "*.h") + +INSTALL(FILES + ${Eigen_UmfPackSupport_SRCS} + DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/UmfPackSupport COMPONENT Devel + ) diff --git a/unsupported/Eigen/src/SparseExtra/UmfPackSupport.h b/Eigen/src/UmfPackSupport/UmfPackSupport.h similarity index 100% rename from unsupported/Eigen/src/SparseExtra/UmfPackSupport.h rename to Eigen/src/UmfPackSupport/UmfPackSupport.h diff --git a/unsupported/Eigen/src/SparseExtra/Solve.h b/Eigen/src/misc/SparseSolve.h similarity index 100% rename from unsupported/Eigen/src/SparseExtra/Solve.h rename to Eigen/src/misc/SparseSolve.h diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9b4c90f0c..7086f5251 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,46 @@ foreach(i RANGE 1 999) ) endforeach() +# configure blas/lapack (use Eigen's ones) +set(BLAS_FOUND TRUE) +set(LAPACK_FOUND TRUE) +set(BLAS_LIBRARIES eigen_blas) +set(LAPACK_LIBRARIES eigen_lapack) + +set(SPARSE_LIBS " ") + +find_package(Cholmod) +if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) + add_definitions("-DEIGEN_CHOLMOD_SUPPORT") + include_directories(${CHOLMOD_INCLUDES}) + set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) + ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ") +else() + ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") +endif() + +find_package(Umfpack) +if(UMFPACK_FOUND AND BLAS_FOUND) + add_definitions("-DEIGEN_UMFPACK_SUPPORT") + include_directories(${UMFPACK_INCLUDES}) + set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) + set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) + ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ") +else() + ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") +endif() + +find_package(SuperLU) +if(SUPERLU_FOUND AND BLAS_FOUND) + add_definitions("-DEIGEN_SUPERLU_SUPPORT") + include_directories(${SUPERLU_INCLUDES}) + set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) + set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) + ei_add_property(EIGEN_TESTED_BACKENDS "SuperLU, ") +else() + ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ") +endif() + find_package(GSL) if(GSL_FOUND AND GSL_VERSION_MINOR LESS 9) set(GSL_FOUND "") @@ -123,7 +163,7 @@ endif(QT4_FOUND) ei_add_test(sparse_vector) ei_add_test(sparse_basic) ei_add_test(sparse_product) -ei_add_test(sparse_solvers "" "${SPARSE_LIBS}") +ei_add_test(sparse_solvers) ei_add_test(umeyama) ei_add_test(householder) ei_add_test(swap) @@ -140,6 +180,20 @@ ei_add_test(sizeoverflow) ei_add_test(prec_inverse_4x4) +ei_add_test(simplicial_cholesky) +ei_add_test(conjugate_gradient) +ei_add_test(bicgstab) + +if(UMFPACK_FOUND) + ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}") +endif() + +if(SUPERLU_FOUND) + ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}") +endif() + + + string(TOLOWER "${CMAKE_CXX_COMPILER}" cmake_cxx_compiler_tolower) if(cmake_cxx_compiler_tolower MATCHES "qcc") set(CXX_IS_QCC "ON") diff --git a/unsupported/test/bicgstab.cpp b/test/bicgstab.cpp similarity index 82% rename from unsupported/test/bicgstab.cpp rename to test/bicgstab.cpp index 4acb54ade..222cd6cbd 100644 --- a/unsupported/test/bicgstab.cpp +++ b/test/bicgstab.cpp @@ -23,17 +23,19 @@ // Eigen. If not, see . #include "sparse_solver.h" -#include +#include template void test_bicgstab_T() { BiCGSTAB, DiagonalPreconditioner > bicgstab_colmajor_diag; BiCGSTAB, IdentityPreconditioner > bicgstab_colmajor_I; - BiCGSTAB, IncompleteLU > bicgstab_colmajor_ilu; + //BiCGSTAB, IncompleteLU > bicgstab_colmajor_ilu; + //BiCGSTAB, SSORPreconditioner > bicgstab_colmajor_ssor; CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_diag) ); CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_I) ); - CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ilu) ); + //CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ilu) ); + //CALL_SUBTEST( check_sparse_square_solving(bicgstab_colmajor_ssor) ); } void test_bicgstab() diff --git a/unsupported/test/conjugate_gradient.cpp b/test/conjugate_gradient.cpp similarity index 98% rename from unsupported/test/conjugate_gradient.cpp rename to test/conjugate_gradient.cpp index 91a205a77..e76327bac 100644 --- a/unsupported/test/conjugate_gradient.cpp +++ b/test/conjugate_gradient.cpp @@ -23,7 +23,7 @@ // Eigen. If not, see . #include "sparse_solver.h" -#include +#include template void test_conjugate_gradient_T() { diff --git a/unsupported/test/simplicial_cholesky.cpp b/test/simplicial_cholesky.cpp similarity index 100% rename from unsupported/test/simplicial_cholesky.cpp rename to test/simplicial_cholesky.cpp diff --git a/unsupported/test/sparse_solver.h b/test/sparse_solver.h similarity index 96% rename from unsupported/test/sparse_solver.h rename to test/sparse_solver.h index d803ef539..51bb33a92 100644 --- a/unsupported/test/sparse_solver.h +++ b/test/sparse_solver.h @@ -23,7 +23,7 @@ // Eigen. If not, see . #include "sparse.h" -#include +#include template void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, const Rhs& b, const DenseMat& dA, const DenseRhs& db) @@ -39,7 +39,7 @@ void check_sparse_solving(Solver& solver, const typename Solver::MatrixType& A, solver.compute(A); if (solver.info() != Success) { - std::cerr << "sparse SPD: factorization failed (check_sparse_solving)\n"; + std::cerr << "sparse solver testing: factorization failed (check_sparse_solving)\n"; exit(0); return; } @@ -64,7 +64,7 @@ void check_sparse_determinant(Solver& solver, const typename Solver::MatrixType& solver.compute(A); if (solver.info() != Success) { - std::cerr << "sparse SPD: factorization failed (check_sparse_determinant)\n"; + std::cerr << "sparse solver testing: factorization failed (check_sparse_determinant)\n"; return; } diff --git a/unsupported/test/superlu_support.cpp b/test/superlu_support.cpp similarity index 100% rename from unsupported/test/superlu_support.cpp rename to test/superlu_support.cpp diff --git a/unsupported/test/umfpack_support.cpp b/test/umfpack_support.cpp similarity index 100% rename from unsupported/test/umfpack_support.cpp rename to test/umfpack_support.cpp diff --git a/unsupported/Eigen/CMakeLists.txt b/unsupported/Eigen/CMakeLists.txt index 1618525d5..679c96736 100644 --- a/unsupported/Eigen/CMakeLists.txt +++ b/unsupported/Eigen/CMakeLists.txt @@ -1,5 +1,5 @@ set(Eigen_HEADERS AdolcForward BVH IterativeSolvers MatrixFunctions MoreVectorization AutoDiff AlignedVector3 Polynomials - CholmodSupport FFT NonLinearOptimization SparseExtra SuperLUSupport UmfPackSupport IterativeSolvers + FFT NonLinearOptimization SparseExtra IterativeSolvers NumericalDiff Skyline MPRealSupport OpenGLSupport KroneckerProduct ) diff --git a/unsupported/Eigen/IterativeSolvers b/unsupported/Eigen/IterativeSolvers index 22f9ad100..6d7b02ad3 100644 --- a/unsupported/Eigen/IterativeSolvers +++ b/unsupported/Eigen/IterativeSolvers @@ -42,15 +42,12 @@ namespace Eigen { //@{ #include "../../Eigen/src/misc/Solve.h" -#include "src/SparseExtra/Solve.h" +#include "../../Eigen/src/misc/SparseSolve.h" -#include "src/IterativeSolvers/IterativeSolverBase.h" #include "src/IterativeSolvers/IterationController.h" #include "src/IterativeSolvers/ConstrainedConjGrad.h" -#include "src/IterativeSolvers/BasicPreconditioners.h" -#include "src/IterativeSolvers/ConjugateGradient.h" -#include "src/IterativeSolvers/BiCGSTAB.h" #include "src/IterativeSolvers/IncompleteLU.h" +#include "src/IterativeSolvers/SSORPreconditioner.h" //@} diff --git a/unsupported/Eigen/SparseExtra b/unsupported/Eigen/SparseExtra index 04f855a16..c207bc1dc 100644 --- a/unsupported/Eigen/SparseExtra +++ b/unsupported/Eigen/SparseExtra @@ -54,6 +54,7 @@ enum { }; #include "../../Eigen/src/misc/Solve.h" +#include "../../Eigen/src/misc/SparseSolve.h" #include "src/SparseExtra/DynamicSparseMatrix.h" #include "src/SparseExtra/BlockOfDynamicSparseMatrix.h" @@ -61,10 +62,6 @@ enum { #include "src/SparseExtra/MarketIO.h" -#include "src/SparseExtra/Solve.h" -#include "src/SparseExtra/Amd.h" -#include "src/SparseExtra/SimplicialCholesky.h" - #include "src/SparseExtra/SparseLLT.h" #include "src/SparseExtra/SparseLDLTLegacy.h" #include "src/SparseExtra/SparseLU.h" diff --git a/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h deleted file mode 100644 index 33af6a176..000000000 --- a/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h +++ /dev/null @@ -1,520 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 Gael Guennebaud -// -// Eigen is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// Alternatively, you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and a copy of the GNU General Public License along with -// Eigen. If not, see . - -#ifndef EIGEN_CHOLMODSUPPORT_LEGACY_H -#define EIGEN_CHOLMODSUPPORT_LEGACY_H - -namespace internal { - -template -void cholmod_configure_matrix_legacy(CholmodType& mat) -{ - if (internal::is_same::value) - { - mat.xtype = CHOLMOD_REAL; - mat.dtype = CHOLMOD_SINGLE; - } - else if (internal::is_same::value) - { - mat.xtype = CHOLMOD_REAL; - mat.dtype = CHOLMOD_DOUBLE; - } - else if (internal::is_same >::value) - { - mat.xtype = CHOLMOD_COMPLEX; - mat.dtype = CHOLMOD_SINGLE; - } - else if (internal::is_same >::value) - { - mat.xtype = CHOLMOD_COMPLEX; - mat.dtype = CHOLMOD_DOUBLE; - } - else - { - eigen_assert(false && "Scalar type not supported by CHOLMOD"); - } -} - -template -cholmod_sparse cholmod_map_eigen_to_sparse(_MatrixType& mat) -{ - typedef typename _MatrixType::Scalar Scalar; - cholmod_sparse res; - res.nzmax = mat.nonZeros(); - res.nrow = mat.rows();; - res.ncol = mat.cols(); - res.p = mat._outerIndexPtr(); - res.i = mat._innerIndexPtr(); - res.x = mat._valuePtr(); - res.xtype = CHOLMOD_REAL; - res.itype = CHOLMOD_INT; - res.sorted = 1; - res.packed = 1; - res.dtype = 0; - res.stype = -1; - - internal::cholmod_configure_matrix_legacy(res); - - - if (_MatrixType::Flags & SelfAdjoint) - { - if (_MatrixType::Flags & Upper) - res.stype = 1; - else if (_MatrixType::Flags & Lower) - res.stype = -1; - else - res.stype = 0; - } - else - res.stype = -1; // by default we consider the lower part - - return res; -} - -template -cholmod_dense cholmod_map_eigen_to_dense(MatrixBase& mat) -{ - EIGEN_STATIC_ASSERT((internal::traits::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); - typedef typename Derived::Scalar Scalar; - - cholmod_dense res; - res.nrow = mat.rows(); - res.ncol = mat.cols(); - res.nzmax = res.nrow * res.ncol; - res.d = Derived::IsVectorAtCompileTime ? mat.derived().size() : mat.derived().outerStride(); - res.x = mat.derived().data(); - res.z = 0; - - internal::cholmod_configure_matrix_legacy(res); - - return res; -} - -template -MappedSparseMatrix map_cholmod_sparse_to_eigen(cholmod_sparse& cm) -{ - return MappedSparseMatrix - (cm.nrow, cm.ncol, reinterpret_cast(cm.p)[cm.ncol], - reinterpret_cast(cm.p), reinterpret_cast(cm.i),reinterpret_cast(cm.x) ); -} - -} // namespace internal - -/** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient */ -template -class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType> -{ - protected: - typedef SparseLLT<_MatrixType> Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::RealScalar RealScalar; - typedef typename Base::CholMatrixType CholMatrixType; - using Base::MatrixLIsDirty; - using Base::SupernodalFactorIsDirty; - using Base::m_flags; - using Base::m_matrix; - using Base::m_status; - - public: - typedef _MatrixType MatrixType; - typedef typename MatrixType::Index Index; - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLLT(int flags = 0) - : Base(flags), m_cholmodFactor(0) - { - cholmod_start(&m_cholmod); - } - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLLT(const MatrixType& matrix, int flags = 0) - : Base(flags), m_cholmodFactor(0) - { - cholmod_start(&m_cholmod); - compute(matrix); - } - - ~SparseLLT() - { - if (m_cholmodFactor) - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - cholmod_finish(&m_cholmod); - } - - inline const CholMatrixType& matrixL() const; - - template - bool solveInPlace(MatrixBase &b) const; - - template - inline const internal::solve_retval, Rhs> - solve(const MatrixBase& b) const - { - eigen_assert(true && "SparseLLT is not initialized."); - return internal::solve_retval, Rhs>(*this, b.derived()); - } - - void compute(const MatrixType& matrix); - - inline Index cols() const { return m_matrix.cols(); } - inline Index rows() const { return m_matrix.rows(); } - - inline const cholmod_factor* cholmodFactor() const - { return m_cholmodFactor; } - - inline cholmod_common* cholmodCommon() const - { return &m_cholmod; } - - bool succeeded() const; - - protected: - mutable cholmod_common m_cholmod; - cholmod_factor* m_cholmodFactor; -}; - - -namespace internal { - -template - struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef SparseLLT<_MatrixType, Cholmod> SpLLTDecType; - EIGEN_MAKE_SOLVE_HELPERS(SpLLTDecType,Rhs) - - template void evalTo(Dest& dst) const - { - //Index size = dec().cholmodFactor()->n; - eigen_assert((Index)dec().cholmodFactor()->n==rhs().rows()); - - cholmod_factor* cholmodFactor = const_cast(dec().cholmodFactor()); - cholmod_common* cholmodCommon = const_cast(dec().cholmodCommon()); - // this uses Eigen's triangular sparse solver - // if (m_status & MatrixLIsDirty) - // matrixL(); - // Base::solveInPlace(b); - // as long as our own triangular sparse solver is not fully optimal, - // let's use CHOLMOD's one: - cholmod_dense cdb = internal::cholmod_map_eigen_to_dense(rhs().const_cast_derived()); - cholmod_dense* x = cholmod_solve(CHOLMOD_A, cholmodFactor, &cdb, cholmodCommon); - - dst = Matrix::Map(reinterpret_cast(x->x), rhs().rows()); - - cholmod_free_dense(&x, cholmodCommon); - - } - -}; - -} // namespace internal - - - -template -void SparseLLT<_MatrixType,Cholmod>::compute(const _MatrixType& a) -{ - if (m_cholmodFactor) - { - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - m_cholmodFactor = 0; - } - - cholmod_sparse A = internal::cholmod_map_eigen_to_sparse(const_cast<_MatrixType&>(a)); -// m_cholmod.supernodal = CHOLMOD_AUTO; - // TODO -// if (m_flags&IncompleteFactorization) -// { -// m_cholmod.nmethods = 1; -// m_cholmod.method[0].ordering = CHOLMOD_NATURAL; -// m_cholmod.postorder = 0; -// } -// else -// { -// m_cholmod.nmethods = 1; -// m_cholmod.method[0].ordering = CHOLMOD_NATURAL; -// m_cholmod.postorder = 0; -// } -// m_cholmod.final_ll = 1; - m_cholmodFactor = cholmod_analyze(&A, &m_cholmod); - cholmod_factorize(&A, m_cholmodFactor, &m_cholmod); - - this->m_status = (this->m_status & ~Base::SupernodalFactorIsDirty) | Base::MatrixLIsDirty; -} - - -// TODO -template -bool SparseLLT<_MatrixType,Cholmod>::succeeded() const -{ return true; } - - - -template -inline const typename SparseLLT<_MatrixType,Cholmod>::CholMatrixType& -SparseLLT<_MatrixType,Cholmod>::matrixL() const -{ - if (this->m_status & Base::MatrixLIsDirty) - { - eigen_assert(!(this->m_status & Base::SupernodalFactorIsDirty)); - - cholmod_sparse* cmRes = cholmod_factor_to_sparse(m_cholmodFactor, &m_cholmod); - const_cast(this->m_matrix) = - internal::map_cholmod_sparse_to_eigen(*cmRes); - free(cmRes); - - this->m_status = (this->m_status & ~Base::MatrixLIsDirty); - } - return this->m_matrix; -} - - - - -template -template -bool SparseLLT<_MatrixType,Cholmod>::solveInPlace(MatrixBase &b) const -{ - //Index size = m_cholmodFactor->n; - eigen_assert((Index)m_cholmodFactor->n==b.rows()); - - // this uses Eigen's triangular sparse solver - // if (m_status & MatrixLIsDirty) - // matrixL(); - // Base::solveInPlace(b); - // as long as our own triangular sparse solver is not fully optimal, - // let's use CHOLMOD's one: - cholmod_dense cdb = internal::cholmod_map_eigen_to_dense(b); - - cholmod_dense* x = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &cdb, &m_cholmod); - eigen_assert(x && "Eigen: cholmod_solve failed."); - - b = Matrix::Map(reinterpret_cast(x->x),b.rows()); - cholmod_free_dense(&x, &m_cholmod); - return true; -} - - - - - - - - - - - -template -class SparseLDLT<_MatrixType,Cholmod> : public SparseLDLT<_MatrixType> -{ - protected: - typedef SparseLDLT<_MatrixType> Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::RealScalar RealScalar; - using Base::MatrixLIsDirty; - using Base::SupernodalFactorIsDirty; - using Base::m_flags; - using Base::m_matrix; - using Base::m_status; - - public: - typedef _MatrixType MatrixType; - typedef typename MatrixType::Index Index; - - SparseLDLT(int flags = 0) - : Base(flags), m_cholmodFactor(0) - { - cholmod_start(&m_cholmod); - } - - SparseLDLT(const _MatrixType& matrix, int flags = 0) - : Base(flags), m_cholmodFactor(0) - { - cholmod_start(&m_cholmod); - compute(matrix); - } - - ~SparseLDLT() - { - if (m_cholmodFactor) - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - cholmod_finish(&m_cholmod); - } - - inline const typename Base::CholMatrixType& matrixL(void) const; - - template - void solveInPlace(MatrixBase &b) const; - - template - inline const internal::solve_retval, Rhs> - solve(const MatrixBase& b) const - { - eigen_assert(true && "SparseLDLT is not initialized."); - return internal::solve_retval, Rhs>(*this, b.derived()); - } - - void compute(const _MatrixType& matrix); - - inline Index cols() const { return m_matrix.cols(); } - inline Index rows() const { return m_matrix.rows(); } - - inline const cholmod_factor* cholmodFactor() const - { return m_cholmodFactor; } - - inline cholmod_common* cholmodCommon() const - { return &m_cholmod; } - - bool succeeded() const; - - protected: - mutable cholmod_common m_cholmod; - cholmod_factor* m_cholmodFactor; -}; - - - -namespace internal { - -template - struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef SparseLDLT<_MatrixType, Cholmod> SpLDLTDecType; - EIGEN_MAKE_SOLVE_HELPERS(SpLDLTDecType,Rhs) - - template void evalTo(Dest& dst) const - { - //Index size = dec().cholmodFactor()->n; - eigen_assert((Index)dec().cholmodFactor()->n==rhs().rows()); - - cholmod_factor* cholmodFactor = const_cast(dec().cholmodFactor()); - cholmod_common* cholmodCommon = const_cast(dec().cholmodCommon()); - // this uses Eigen's triangular sparse solver - // if (m_status & MatrixLIsDirty) - // matrixL(); - // Base::solveInPlace(b); - // as long as our own triangular sparse solver is not fully optimal, - // let's use CHOLMOD's one: - cholmod_dense cdb = internal::cholmod_map_eigen_to_dense(rhs().const_cast_derived()); - cholmod_dense* x = cholmod_solve(CHOLMOD_LDLt, cholmodFactor, &cdb, cholmodCommon); - - dst = Matrix::Map(reinterpret_cast(x->x), rhs().rows()); - cholmod_free_dense(&x, cholmodCommon); - - } - -}; - - -} // namespace internal - -template -void SparseLDLT<_MatrixType,Cholmod>::compute(const _MatrixType& a) -{ - if (m_cholmodFactor) - { - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - m_cholmodFactor = 0; - } - - cholmod_sparse A = internal::cholmod_map_eigen_to_sparse(const_cast<_MatrixType&>(a)); - - //m_cholmod.supernodal = CHOLMOD_AUTO; - m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; - //m_cholmod.supernodal = CHOLMOD_SUPERNODAL; - // TODO - if (this->m_flags & IncompleteFactorization) - { - m_cholmod.nmethods = 1; - //m_cholmod.method[0].ordering = CHOLMOD_NATURAL; - m_cholmod.method[0].ordering = CHOLMOD_COLAMD; - m_cholmod.postorder = 1; - } - else - { - m_cholmod.nmethods = 1; - m_cholmod.method[0].ordering = CHOLMOD_NATURAL; - m_cholmod.postorder = 0; - } - m_cholmod.final_ll = 0; - m_cholmodFactor = cholmod_analyze(&A, &m_cholmod); - cholmod_factorize(&A, m_cholmodFactor, &m_cholmod); - - this->m_status = (this->m_status & ~Base::SupernodalFactorIsDirty) | Base::MatrixLIsDirty; -} - - -// TODO -template -bool SparseLDLT<_MatrixType,Cholmod>::succeeded() const -{ return true; } - - -template -inline const typename SparseLDLT<_MatrixType>::CholMatrixType& -SparseLDLT<_MatrixType,Cholmod>::matrixL() const -{ - if (this->m_status & Base::MatrixLIsDirty) - { - eigen_assert(!(this->m_status & Base::SupernodalFactorIsDirty)); - - cholmod_sparse* cmRes = cholmod_factor_to_sparse(m_cholmodFactor, &m_cholmod); - const_cast(this->m_matrix) = MappedSparseMatrix(*cmRes); - free(cmRes); - - this->m_status = (this->m_status & ~Base::MatrixLIsDirty); - } - return this->m_matrix; -} - - - - - - -template -template -void SparseLDLT<_MatrixType,Cholmod>::solveInPlace(MatrixBase &b) const -{ - //Index size = m_cholmodFactor->n; - eigen_assert((Index)m_cholmodFactor->n == b.rows()); - - // this uses Eigen's triangular sparse solver - // if (m_status & MatrixLIsDirty) - // matrixL(); - // Base::solveInPlace(b); - // as long as our own triangular sparse solver is not fully optimal, - // let's use CHOLMOD's one: - cholmod_dense cdb = internal::cholmod_map_eigen_to_dense(b); - cholmod_dense* x = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &cdb, &m_cholmod); - b = Matrix::Map(reinterpret_cast(x->x),b.rows()); - cholmod_free_dense(&x, &m_cholmod); -} - - - - - - -#endif // EIGEN_CHOLMODSUPPORT_LEGACY_H diff --git a/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h deleted file mode 100644 index e85d8d36e..000000000 --- a/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h +++ /dev/null @@ -1,407 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 Gael Guennebaud -// -// Eigen is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// Alternatively, you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and a copy of the GNU General Public License along with -// Eigen. If not, see . - -#ifndef EIGEN_SUPERLUSUPPORT_LEGACY_H -#define EIGEN_SUPERLUSUPPORT_LEGACY_H - -/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */ -template -class SparseLU : public SparseLU -{ - protected: - typedef SparseLU Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::RealScalar RealScalar; - typedef Matrix Vector; - typedef Matrix IntRowVectorType; - typedef Matrix IntColVectorType; - typedef SparseMatrix LMatrixType; - typedef SparseMatrix UMatrixType; - using Base::m_flags; - using Base::m_status; - - public: - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLU(int flags = NaturalOrdering) - : Base(flags) - { - } - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) - : Base(flags) - { - compute(matrix); - } - - ~SparseLU() - { - Destroy_SuperNode_Matrix(&m_sluL); - Destroy_CompCol_Matrix(&m_sluU); - } - - inline const LMatrixType& matrixL() const - { - if (m_extractedDataAreDirty) extractData(); - return m_l; - } - - inline const UMatrixType& matrixU() const - { - if (m_extractedDataAreDirty) extractData(); - return m_u; - } - - inline const IntColVectorType& permutationP() const - { - if (m_extractedDataAreDirty) extractData(); - return m_p; - } - - inline const IntRowVectorType& permutationQ() const - { - if (m_extractedDataAreDirty) extractData(); - return m_q; - } - - Scalar determinant() const; - - template - bool solve(const MatrixBase &b, MatrixBase* x, const int transposed = SvNoTrans) const; - - void compute(const MatrixType& matrix); - - protected: - - void extractData() const; - - protected: - // cached data to reduce reallocation, etc. - mutable LMatrixType m_l; - mutable UMatrixType m_u; - mutable IntColVectorType m_p; - mutable IntRowVectorType m_q; - - mutable SparseMatrix m_matrix; - mutable SluMatrix m_sluA; - mutable SuperMatrix m_sluL, m_sluU; - mutable SluMatrix m_sluB, m_sluX; - mutable SuperLUStat_t m_sluStat; - mutable superlu_options_t m_sluOptions; - mutable std::vector m_sluEtree; - mutable std::vector m_sluRscale, m_sluCscale; - mutable std::vector m_sluFerr, m_sluBerr; - mutable char m_sluEqued; - mutable bool m_extractedDataAreDirty; -}; - -template -void SparseLU::compute(const MatrixType& a) -{ - const int size = a.rows(); - m_matrix = a; - - set_default_options(&m_sluOptions); - m_sluOptions.ColPerm = NATURAL; - m_sluOptions.PrintStat = NO; - m_sluOptions.ConditionNumber = NO; - m_sluOptions.Trans = NOTRANS; - // m_sluOptions.Equil = NO; - - switch (Base::orderingMethod()) - { - case NaturalOrdering : m_sluOptions.ColPerm = NATURAL; break; - case MinimumDegree_AT_PLUS_A : m_sluOptions.ColPerm = MMD_AT_PLUS_A; break; - case MinimumDegree_ATA : m_sluOptions.ColPerm = MMD_ATA; break; - case ColApproxMinimumDegree : m_sluOptions.ColPerm = COLAMD; break; - default: - //std::cerr << "Eigen: ordering method \"" << Base::orderingMethod() << "\" not supported by the SuperLU backend\n"; - m_sluOptions.ColPerm = NATURAL; - }; - - m_sluA = internal::asSluMatrix(m_matrix); - memset(&m_sluL,0,sizeof m_sluL); - memset(&m_sluU,0,sizeof m_sluU); - m_sluEqued = 'N'; - int info = 0; - - m_p.resize(size); - m_q.resize(size); - m_sluRscale.resize(size); - m_sluCscale.resize(size); - m_sluEtree.resize(size); - - RealScalar recip_pivot_gross, rcond; - RealScalar ferr, berr; - - // set empty B and X - m_sluB.setStorageType(SLU_DN); - m_sluB.setScalarType(); - m_sluB.Mtype = SLU_GE; - m_sluB.storage.values = 0; - m_sluB.nrow = m_sluB.ncol = 0; - m_sluB.storage.lda = size; - m_sluX = m_sluB; - - StatInit(&m_sluStat); - if (m_flags&IncompleteFactorization) - { - #ifdef EIGEN_SUPERLU_HAS_ILU - ilu_set_default_options(&m_sluOptions); - - // no attempt to preserve column sum - m_sluOptions.ILU_MILU = SILU; - - // only basic ILU(k) support -- no direct control over memory consumption - // better to use ILU_DropRule = DROP_BASIC | DROP_AREA - // and set ILU_FillFactor to max memory growth - m_sluOptions.ILU_DropRule = DROP_BASIC; - m_sluOptions.ILU_DropTol = Base::m_precision; - - SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], - &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0], - &m_sluL, &m_sluU, - NULL, 0, - &m_sluB, &m_sluX, - &recip_pivot_gross, &rcond, - &m_sluStat, &info, Scalar()); - #else - //std::cerr << "Incomplete factorization is only available in SuperLU v4\n"; - Base::m_succeeded = false; - return; - #endif - } - else - { - SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], - &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0], - &m_sluL, &m_sluU, - NULL, 0, - &m_sluB, &m_sluX, - &recip_pivot_gross, &rcond, - &ferr, &berr, - &m_sluStat, &info, Scalar()); - } - StatFree(&m_sluStat); - - m_extractedDataAreDirty = true; - - // FIXME how to better check for errors ??? - Base::m_succeeded = (info == 0); -} - -template -template -bool SparseLU::solve(const MatrixBase &b, - MatrixBase *x, const int transposed) const -{ - const int size = m_matrix.rows(); - const int rhsCols = b.cols(); - eigen_assert(size==b.rows()); - - switch (transposed) { - case SvNoTrans : m_sluOptions.Trans = NOTRANS; break; - case SvTranspose : m_sluOptions.Trans = TRANS; break; - case SvAdjoint : m_sluOptions.Trans = CONJ; break; - default: - //std::cerr << "Eigen: transposition option \"" << transposed << "\" not supported by the SuperLU backend\n"; - m_sluOptions.Trans = NOTRANS; - } - - m_sluOptions.Fact = FACTORED; - m_sluOptions.IterRefine = NOREFINE; - - m_sluFerr.resize(rhsCols); - m_sluBerr.resize(rhsCols); - m_sluB = SluMatrix::Map(b.const_cast_derived()); - m_sluX = SluMatrix::Map(x->derived()); - - typename BDerived::PlainObject b_cpy; - if(m_sluEqued!='N') - { - b_cpy = b; - m_sluB = SluMatrix::Map(b_cpy.const_cast_derived()); - } - - StatInit(&m_sluStat); - int info = 0; - RealScalar recip_pivot_gross, rcond; - - if (m_flags&IncompleteFactorization) - { - #ifdef EIGEN_SUPERLU_HAS_ILU - SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0], - &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0], - &m_sluL, &m_sluU, - NULL, 0, - &m_sluB, &m_sluX, - &recip_pivot_gross, &rcond, - &m_sluStat, &info, Scalar()); - #else - //std::cerr << "Incomplete factorization is only available in SuperLU v4\n"; - return false; - #endif - } - else - { - SuperLU_gssvx( - &m_sluOptions, &m_sluA, - m_q.data(), m_p.data(), - &m_sluEtree[0], &m_sluEqued, - &m_sluRscale[0], &m_sluCscale[0], - &m_sluL, &m_sluU, - NULL, 0, - &m_sluB, &m_sluX, - &recip_pivot_gross, &rcond, - &m_sluFerr[0], &m_sluBerr[0], - &m_sluStat, &info, Scalar()); - } - StatFree(&m_sluStat); - - // reset to previous state - m_sluOptions.Trans = NOTRANS; - return info==0; -} - -// -// the code of this extractData() function has been adapted from the SuperLU's Matlab support code, -// -// Copyright (c) 1994 by Xerox Corporation. All rights reserved. -// -// THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY -// EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -// -template -void SparseLU::extractData() const -{ - if (m_extractedDataAreDirty) - { - int upper; - int fsupc, istart, nsupr; - int lastl = 0, lastu = 0; - SCformat *Lstore = static_cast(m_sluL.Store); - NCformat *Ustore = static_cast(m_sluU.Store); - Scalar *SNptr; - - const int size = m_matrix.rows(); - m_l.resize(size,size); - m_l.resizeNonZeros(Lstore->nnz); - m_u.resize(size,size); - m_u.resizeNonZeros(Ustore->nnz); - - int* Lcol = m_l._outerIndexPtr(); - int* Lrow = m_l._innerIndexPtr(); - Scalar* Lval = m_l._valuePtr(); - - int* Ucol = m_u._outerIndexPtr(); - int* Urow = m_u._innerIndexPtr(); - Scalar* Uval = m_u._valuePtr(); - - Ucol[0] = 0; - Ucol[0] = 0; - - /* for each supernode */ - for (int k = 0; k <= Lstore->nsuper; ++k) - { - fsupc = L_FST_SUPC(k); - istart = L_SUB_START(fsupc); - nsupr = L_SUB_START(fsupc+1) - istart; - upper = 1; - - /* for each column in the supernode */ - for (int j = fsupc; j < L_FST_SUPC(k+1); ++j) - { - SNptr = &((Scalar*)Lstore->nzval)[L_NZ_START(j)]; - - /* Extract U */ - for (int i = U_NZ_START(j); i < U_NZ_START(j+1); ++i) - { - Uval[lastu] = ((Scalar*)Ustore->nzval)[i]; - /* Matlab doesn't like explicit zero. */ - if (Uval[lastu] != 0.0) - Urow[lastu++] = U_SUB(i); - } - for (int i = 0; i < upper; ++i) - { - /* upper triangle in the supernode */ - Uval[lastu] = SNptr[i]; - /* Matlab doesn't like explicit zero. */ - if (Uval[lastu] != 0.0) - Urow[lastu++] = L_SUB(istart+i); - } - Ucol[j+1] = lastu; - - /* Extract L */ - Lval[lastl] = 1.0; /* unit diagonal */ - Lrow[lastl++] = L_SUB(istart + upper - 1); - for (int i = upper; i < nsupr; ++i) - { - Lval[lastl] = SNptr[i]; - /* Matlab doesn't like explicit zero. */ - if (Lval[lastl] != 0.0) - Lrow[lastl++] = L_SUB(istart+i); - } - Lcol[j+1] = lastl; - - ++upper; - } /* for j ... */ - - } /* for k ... */ - - // squeeze the matrices : - m_l.resizeNonZeros(lastl); - m_u.resizeNonZeros(lastu); - - m_extractedDataAreDirty = false; - } -} - -template -typename SparseLU::Scalar SparseLU::determinant() const -{ - assert((!NumTraits::IsComplex) && "This function is not implemented for complex yet"); - if (m_extractedDataAreDirty) - extractData(); - - // TODO this code could be moved to the default/base backend - // FIXME perhaps we have to take into account the scale factors m_sluRscale and m_sluCscale ??? - Scalar det = Scalar(1); - for (int j=0; j 0) - { - int lastId = m_u._outerIndexPtr()[j+1]-1; - eigen_assert(m_u._innerIndexPtr()[lastId]<=j); - if (m_u._innerIndexPtr()[lastId]==j) - { - det *= m_u._valuePtr()[lastId]; - } - } -// std::cout << m_sluRscale[j] << " " << m_sluCscale[j] << " \n"; - } - return det; -} - -#endif // EIGEN_SUPERLUSUPPORT_LEGACY_H diff --git a/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h deleted file mode 100644 index 3d30e1ed1..000000000 --- a/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h +++ /dev/null @@ -1,257 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 Gael Guennebaud -// -// Eigen is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 3 of the License, or (at your option) any later version. -// -// Alternatively, you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of -// the License, or (at your option) any later version. -// -// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License and a copy of the GNU General Public License along with -// Eigen. If not, see . - -#ifndef EIGEN_UMFPACKSUPPORT_LEGACY_H -#define EIGEN_UMFPACKSUPPORT_LEGACY_H - -/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */ -template -class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType> -{ - protected: - typedef SparseLU<_MatrixType> Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::RealScalar RealScalar; - typedef Matrix Vector; - typedef Matrix IntRowVectorType; - typedef Matrix IntColVectorType; - typedef SparseMatrix LMatrixType; - typedef SparseMatrix UMatrixType; - using Base::m_flags; - using Base::m_status; - - public: - typedef _MatrixType MatrixType; - typedef typename MatrixType::Index Index; - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLU(int flags = NaturalOrdering) - : Base(flags), m_numeric(0) - { - } - - /** \deprecated the entire class is deprecated */ - EIGEN_DEPRECATED SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) - : Base(flags), m_numeric(0) - { - compute(matrix); - } - - ~SparseLU() - { - if (m_numeric) - umfpack_free_numeric(&m_numeric,Scalar()); - } - - inline const LMatrixType& matrixL() const - { - if (m_extractedDataAreDirty) extractData(); - return m_l; - } - - inline const UMatrixType& matrixU() const - { - if (m_extractedDataAreDirty) extractData(); - return m_u; - } - - inline const IntColVectorType& permutationP() const - { - if (m_extractedDataAreDirty) extractData(); - return m_p; - } - - inline const IntRowVectorType& permutationQ() const - { - if (m_extractedDataAreDirty) extractData(); - return m_q; - } - - Scalar determinant() const; - - template - bool solve(const MatrixBase &b, MatrixBase* x) const; - - template - inline const internal::solve_retval, Rhs> - solve(const MatrixBase& b) const - { - eigen_assert(true && "SparseLU is not initialized."); - return internal::solve_retval, Rhs>(*this, b.derived()); - } - - void compute(const MatrixType& matrix); - - inline Index cols() const { return m_matrixRef->cols(); } - inline Index rows() const { return m_matrixRef->rows(); } - - inline const MatrixType& matrixLU() const - { - //eigen_assert(m_isInitialized && "LU is not initialized."); - return *m_matrixRef; - } - - const void* numeric() const - { - return m_numeric; - } - - protected: - - void extractData() const; - - protected: - // cached data: - void* m_numeric; - const MatrixType* m_matrixRef; - mutable LMatrixType m_l; - mutable UMatrixType m_u; - mutable IntColVectorType m_p; - mutable IntRowVectorType m_q; - mutable bool m_extractedDataAreDirty; -}; - -namespace internal { - -template - struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef SparseLU<_MatrixType, UmfPack> SpLUDecType; - EIGEN_MAKE_SOLVE_HELPERS(SpLUDecType,Rhs) - - template void evalTo(Dest& dst) const - { - const int rhsCols = rhs().cols(); - - eigen_assert((Rhs::Flags&RowMajorBit)==0 && "UmfPack backend does not support non col-major rhs yet"); - eigen_assert((Dest::Flags&RowMajorBit)==0 && "UmfPack backend does not support non col-major result yet"); - - void* numeric = const_cast(dec().numeric()); - - EIGEN_UNUSED int errorCode = 0; - for (int j=0; j -void SparseLU::compute(const MatrixType& a) -{ - typedef typename MatrixType::Index Index; - const Index rows = a.rows(); - const Index cols = a.cols(); - eigen_assert((MatrixType::Flags&RowMajorBit)==0 && "Row major matrices are not supported yet"); - - m_matrixRef = &a; - - if (m_numeric) - umfpack_free_numeric(&m_numeric,Scalar()); - - void* symbolic; - int errorCode = 0; - errorCode = umfpack_symbolic(rows, cols, a._outerIndexPtr(), a._innerIndexPtr(), a._valuePtr(), - &symbolic, 0, 0); - if (errorCode==0) - errorCode = umfpack_numeric(a._outerIndexPtr(), a._innerIndexPtr(), a._valuePtr(), - symbolic, &m_numeric, 0, 0); - - umfpack_free_symbolic(&symbolic,Scalar()); - - m_extractedDataAreDirty = true; - - Base::m_succeeded = (errorCode==0); -} - -template -void SparseLU::extractData() const -{ - if (m_extractedDataAreDirty) - { - // get size of the data - int lnz, unz, rows, cols, nz_udiag; - umfpack_get_lunz(&lnz, &unz, &rows, &cols, &nz_udiag, m_numeric, Scalar()); - - // allocate data - m_l.resize(rows,(std::min)(rows,cols)); - m_l.resizeNonZeros(lnz); - - m_u.resize((std::min)(rows,cols),cols); - m_u.resizeNonZeros(unz); - - m_p.resize(rows); - m_q.resize(cols); - - // extract - umfpack_get_numeric(m_l._outerIndexPtr(), m_l._innerIndexPtr(), m_l._valuePtr(), - m_u._outerIndexPtr(), m_u._innerIndexPtr(), m_u._valuePtr(), - m_p.data(), m_q.data(), 0, 0, 0, m_numeric); - - m_extractedDataAreDirty = false; - } -} - -template -typename SparseLU::Scalar SparseLU::determinant() const -{ - Scalar det; - umfpack_get_determinant(&det, 0, m_numeric, 0); - return det; -} - -template -template -bool SparseLU::solve(const MatrixBase &b, MatrixBase *x) const -{ - //const int size = m_matrix.rows(); - const int rhsCols = b.cols(); -// eigen_assert(size==b.rows()); - eigen_assert((BDerived::Flags&RowMajorBit)==0 && "UmfPack backend does not support non col-major rhs yet"); - eigen_assert((XDerived::Flags&RowMajorBit)==0 && "UmfPack backend does not support non col-major result yet"); - - int errorCode; - for (int j=0; j_outerIndexPtr(), m_matrixRef->_innerIndexPtr(), m_matrixRef->_valuePtr(), - &x->col(j).coeffRef(0), &b.const_cast_derived().col(j).coeffRef(0), m_numeric, 0, 0); - if (errorCode!=0) - return false; - } -// errorCode = umfpack_di_solve(UMFPACK_A, -// m_matrixRef._outerIndexPtr(), m_matrixRef._innerIndexPtr(), m_matrixRef._valuePtr(), -// x->derived().data(), b.derived().data(), m_numeric, 0, 0); - - return true; -} - -#endif // EIGEN_UMFPACKSUPPORT_H diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt index 5dfc81fff..83e947665 100644 --- a/unsupported/test/CMakeLists.txt +++ b/unsupported/test/CMakeLists.txt @@ -2,46 +2,6 @@ include_directories(../../test ../../unsupported ../../Eigen ${CMAKE_CURRENT_BINARY_DIR}/../../test) -set(SPARSE_LIBS "") - -# configure blas/lapack (use Eigen's by default) -set(BLAS_FOUND TRUE) -set(LAPACK_FOUND TRUE) -set(BLAS_LIBRARIES eigen_blas) -set(LAPACK_LIBRARIES eigen_lapack) - -find_package(Cholmod) -if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND) - add_definitions("-DEIGEN_CHOLMOD_SUPPORT") - include_directories(${CHOLMOD_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${CHOLMOD_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) - ei_add_property(EIGEN_TESTED_BACKENDS "Cholmod, ") -else() - ei_add_property(EIGEN_MISSING_BACKENDS "Cholmod, ") -endif() - -find_package(Umfpack) -if(UMFPACK_FOUND AND BLAS_FOUND) - add_definitions("-DEIGEN_UMFPACK_SUPPORT") - include_directories(${UMFPACK_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) - set(UMFPACK_ALL_LIBS ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES}) - ei_add_property(EIGEN_TESTED_BACKENDS "UmfPack, ") -else() - ei_add_property(EIGEN_MISSING_BACKENDS "UmfPack, ") -endif() - -find_package(SuperLU) -if(SUPERLU_FOUND AND BLAS_FOUND) - add_definitions("-DEIGEN_SUPERLU_SUPPORT") - include_directories(${SUPERLU_INCLUDES}) - set(SPARSE_LIBS ${SPARSE_LIBS} ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) - set(SUPERLU_ALL_LIBS ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES}) - ei_add_property(EIGEN_TESTED_BACKENDS "SuperLU, ") -else() - ei_add_property(EIGEN_MISSING_BACKENDS "SuperLU, ") -endif() - find_package(GoogleHash) if(GOOGLEHASH_FOUND) add_definitions("-DEIGEN_GOOGLEHASH_SUPPORT") @@ -88,22 +48,6 @@ else() ei_add_property(EIGEN_MISSING_BACKENDS "MPFR C++, ") endif() -ei_add_test(sparse_llt "" "${SPARSE_LIBS}") -ei_add_test(sparse_ldlt "" "${SPARSE_LIBS}") -ei_add_test(sparse_lu_legacy "" "${SPARSE_LIBS}") - -ei_add_test(simplicial_cholesky) -ei_add_test(conjugate_gradient) -ei_add_test(bicgstab) - -if(UMFPACK_FOUND) - ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}") -endif() - -if(SUPERLU_FOUND) - ei_add_test(superlu_support "" "${SUPERLU_ALL_LIBS}") -endif() - ei_add_test(sparse_extra "" "") find_package(FFTW) @@ -150,4 +94,3 @@ endif(GSL_FOUND) ei_add_test(polynomialsolver " " "${GSL_LIBRARIES}" ) ei_add_test(polynomialutils) ei_add_test(kronecker_product) -ei_add_test(cg)