mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 17:33:15 +08:00
Bug #1910: Make SparseCholesky work for RowMajor matrices
This commit is contained in:
parent
128eebf05e
commit
a7749c09bc
@ -287,8 +287,8 @@ template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<Simp
|
|||||||
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
||||||
typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
|
typedef TriangularView<const CholMatrixType, Eigen::Lower> MatrixL;
|
||||||
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
|
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper> MatrixU;
|
||||||
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
|
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
||||||
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
|
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
|
template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
|
||||||
@ -301,8 +301,8 @@ template<typename _MatrixType,int _UpLo, typename _Ordering> struct traits<Simpl
|
|||||||
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> CholMatrixType;
|
||||||
typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
|
typedef TriangularView<const CholMatrixType, Eigen::UnitLower> MatrixL;
|
||||||
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper> MatrixU;
|
typedef TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper> MatrixU;
|
||||||
static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); }
|
static inline MatrixL getL(const CholMatrixType& m) { return MatrixL(m); }
|
||||||
static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); }
|
static inline MatrixU getU(const CholMatrixType& m) { return MatrixU(m.adjoint()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
|
template<typename _MatrixType, int _UpLo, typename _Ordering> struct traits<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
#include "sparse_solver.h"
|
#include "sparse_solver.h"
|
||||||
|
|
||||||
template<typename T, typename I_> void test_simplicial_cholesky_T()
|
template<typename T, typename I_, int flag> void test_simplicial_cholesky_T()
|
||||||
{
|
{
|
||||||
typedef SparseMatrix<T,0,I_> SparseMatrixType;
|
typedef SparseMatrix<T,flag,I_> SparseMatrixType;
|
||||||
SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
|
SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
|
||||||
SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
|
SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
|
||||||
SimplicialLLT< SparseMatrixType, Lower> llt_colmajor_lower_amd;
|
SimplicialLLT< SparseMatrixType, Lower> llt_colmajor_lower_amd;
|
||||||
@ -41,7 +41,10 @@ template<typename T, typename I_> void test_simplicial_cholesky_T()
|
|||||||
|
|
||||||
EIGEN_DECLARE_TEST(simplicial_cholesky)
|
EIGEN_DECLARE_TEST(simplicial_cholesky)
|
||||||
{
|
{
|
||||||
CALL_SUBTEST_1(( test_simplicial_cholesky_T<double,int>() ));
|
CALL_SUBTEST_11(( test_simplicial_cholesky_T<double, int, ColMajor>() ));
|
||||||
CALL_SUBTEST_2(( test_simplicial_cholesky_T<std::complex<double>, int>() ));
|
CALL_SUBTEST_12(( test_simplicial_cholesky_T<std::complex<double>, int, ColMajor>() ));
|
||||||
CALL_SUBTEST_3(( test_simplicial_cholesky_T<double,long int>() ));
|
CALL_SUBTEST_13(( test_simplicial_cholesky_T<double, long int, ColMajor>() ));
|
||||||
|
CALL_SUBTEST_21(( test_simplicial_cholesky_T<double, int, RowMajor>() ));
|
||||||
|
CALL_SUBTEST_22(( test_simplicial_cholesky_T<std::complex<double>, int, RowMajor>() ));
|
||||||
|
CALL_SUBTEST_23(( test_simplicial_cholesky_T<double, long int, RowMajor>() ));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user