Add unit tests for CG and sparse-LLT for long int as storage-index

This commit is contained in:
Gael Guennebaud
2015-03-09 14:33:15 +01:00
parent 224a1fe4c6
commit 9e885fb766
5 changed files with 29 additions and 24 deletions

View File

@@ -9,16 +9,17 @@
#include "sparse_solver.h"
template<typename T> void test_simplicial_cholesky_T()
template<typename T, typename I> void test_simplicial_cholesky_T()
{
SimplicialCholesky<SparseMatrix<T>, Lower> chol_colmajor_lower_amd;
SimplicialCholesky<SparseMatrix<T>, Upper> chol_colmajor_upper_amd;
SimplicialLLT<SparseMatrix<T>, Lower> llt_colmajor_lower_amd;
SimplicialLLT<SparseMatrix<T>, Upper> llt_colmajor_upper_amd;
SimplicialLDLT<SparseMatrix<T>, Lower> ldlt_colmajor_lower_amd;
SimplicialLDLT<SparseMatrix<T>, Upper> ldlt_colmajor_upper_amd;
SimplicialLDLT<SparseMatrix<T>, Lower, NaturalOrdering<int> > ldlt_colmajor_lower_nat;
SimplicialLDLT<SparseMatrix<T>, Upper, NaturalOrdering<int> > ldlt_colmajor_upper_nat;
typedef SparseMatrix<T,0,I> SparseMatrixType;
SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
SimplicialLLT< SparseMatrixType, Lower> llt_colmajor_lower_amd;
SimplicialLLT< SparseMatrixType, Upper> llt_colmajor_upper_amd;
SimplicialLDLT< SparseMatrixType, Lower> ldlt_colmajor_lower_amd;
SimplicialLDLT< SparseMatrixType, Upper> ldlt_colmajor_upper_amd;
SimplicialLDLT< SparseMatrixType, Lower, NaturalOrdering<I> > ldlt_colmajor_lower_nat;
SimplicialLDLT< SparseMatrixType, Upper, NaturalOrdering<I> > ldlt_colmajor_upper_nat;
check_sparse_spd_solving(chol_colmajor_lower_amd);
check_sparse_spd_solving(chol_colmajor_upper_amd);
@@ -40,6 +41,7 @@ template<typename T> void test_simplicial_cholesky_T()
void test_simplicial_cholesky()
{
CALL_SUBTEST_1(test_simplicial_cholesky_T<double>());
CALL_SUBTEST_2(test_simplicial_cholesky_T<std::complex<double> >());
CALL_SUBTEST_1(( test_simplicial_cholesky_T<double,int>() ));
CALL_SUBTEST_2(( test_simplicial_cholesky_T<std::complex<double>, int>() ));
CALL_SUBTEST_3(( test_simplicial_cholesky_T<double,long int>() ));
}