simplicial_cholesky.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2011 Gael Guennebaud <g.gael@free.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #include "sparse_solver.h"
11 
12 template<typename T, typename I_, int flag> void test_simplicial_cholesky_T()
13 {
14  typedef SparseMatrix<T,flag,I_> SparseMatrixType;
15  SimplicialCholesky<SparseMatrixType, Lower> chol_colmajor_lower_amd;
16  SimplicialCholesky<SparseMatrixType, Upper> chol_colmajor_upper_amd;
17  SimplicialLLT< SparseMatrixType, Lower> llt_colmajor_lower_amd;
18  SimplicialLLT< SparseMatrixType, Upper> llt_colmajor_upper_amd;
19  SimplicialLDLT< SparseMatrixType, Lower> ldlt_colmajor_lower_amd;
20  SimplicialLDLT< SparseMatrixType, Upper> ldlt_colmajor_upper_amd;
23 
24  check_sparse_spd_solving(chol_colmajor_lower_amd);
25  check_sparse_spd_solving(chol_colmajor_upper_amd);
26  check_sparse_spd_solving(llt_colmajor_lower_amd);
27  check_sparse_spd_solving(llt_colmajor_upper_amd);
28  check_sparse_spd_solving(ldlt_colmajor_lower_amd);
29  check_sparse_spd_solving(ldlt_colmajor_upper_amd);
30 
31  check_sparse_spd_determinant(chol_colmajor_lower_amd);
32  check_sparse_spd_determinant(chol_colmajor_upper_amd);
33  check_sparse_spd_determinant(llt_colmajor_lower_amd);
34  check_sparse_spd_determinant(llt_colmajor_upper_amd);
35  check_sparse_spd_determinant(ldlt_colmajor_lower_amd);
36  check_sparse_spd_determinant(ldlt_colmajor_upper_amd);
37 
38  check_sparse_spd_solving(ldlt_colmajor_lower_nat, (std::min)(300,EIGEN_TEST_MAX_SIZE), 1000);
39  check_sparse_spd_solving(ldlt_colmajor_upper_nat, (std::min)(300,EIGEN_TEST_MAX_SIZE), 1000);
40 }
41 
42 EIGEN_DECLARE_TEST(simplicial_cholesky)
43 {
44  CALL_SUBTEST_11(( test_simplicial_cholesky_T<double, int, ColMajor>() ));
45  CALL_SUBTEST_12(( test_simplicial_cholesky_T<std::complex<double>, int, ColMajor>() ));
46  CALL_SUBTEST_13(( test_simplicial_cholesky_T<double, long int, ColMajor>() ));
47  CALL_SUBTEST_21(( test_simplicial_cholesky_T<double, int, RowMajor>() ));
48  CALL_SUBTEST_22(( test_simplicial_cholesky_T<std::complex<double>, int, RowMajor>() ));
49  CALL_SUBTEST_23(( test_simplicial_cholesky_T<double, long int, RowMajor>() ));
50 }
Eigen::SparseMatrix
A versatible sparse matrix representation.
Definition: SparseMatrix.h:96
Eigen::SimplicialLDLT
A direct sparse LDLT Cholesky factorizations without square root.
Definition: SimplicialCholesky.h:275
CALL_SUBTEST_22
#define CALL_SUBTEST_22(FUNC)
Definition: split_test_helper.h:130
Eigen::RowMajor
@ RowMajor
Definition: Constants.h:321
CALL_SUBTEST_11
#define CALL_SUBTEST_11(FUNC)
Definition: split_test_helper.h:64
Eigen::SimplicialLLT
A direct sparse LLT Cholesky factorizations.
Definition: SimplicialCholesky.h:274
CALL_SUBTEST_21
#define CALL_SUBTEST_21(FUNC)
Definition: split_test_helper.h:124
CALL_SUBTEST_13
#define CALL_SUBTEST_13(FUNC)
Definition: split_test_helper.h:76
check_sparse_spd_determinant
void check_sparse_spd_determinant(Solver &solver)
Definition: sparse_solver.h:489
test_simplicial_cholesky_T
void test_simplicial_cholesky_T()
Definition: simplicial_cholesky.cpp:12
Eigen::SimplicialCholesky
Definition: SimplicialCholesky.h:276
check_sparse_spd_solving
void check_sparse_spd_solving(Solver &solver, int maxSize=(std::min)(300, EIGEN_TEST_MAX_SIZE), int maxRealWorldSize=100000)
Definition: sparse_solver.h:404
sparse_solver.h
EIGEN_TEST_MAX_SIZE
#define EIGEN_TEST_MAX_SIZE
Definition: boostmultiprec.cpp:16
CALL_SUBTEST_12
#define CALL_SUBTEST_12(FUNC)
Definition: split_test_helper.h:70
min
#define min(a, b)
Definition: datatypes.h:19
CALL_SUBTEST_23
#define CALL_SUBTEST_23(FUNC)
Definition: split_test_helper.h:136
Eigen::ColMajor
@ ColMajor
Definition: Constants.h:319
EIGEN_DECLARE_TEST
EIGEN_DECLARE_TEST(simplicial_cholesky)
Definition: simplicial_cholesky.cpp:42


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:13:19