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 
test_simplicial_cholesky_T()12 template<typename T> void test_simplicial_cholesky_T()
13 {
14   SimplicialCholesky<SparseMatrix<T>, Lower> chol_colmajor_lower_amd;
15   SimplicialCholesky<SparseMatrix<T>, Upper> chol_colmajor_upper_amd;
16   SimplicialLLT<SparseMatrix<T>, Lower> llt_colmajor_lower_amd;
17   SimplicialLLT<SparseMatrix<T>, Upper> llt_colmajor_upper_amd;
18   SimplicialLDLT<SparseMatrix<T>, Lower> ldlt_colmajor_lower_amd;
19   SimplicialLDLT<SparseMatrix<T>, Upper> ldlt_colmajor_upper_amd;
20   SimplicialLDLT<SparseMatrix<T>, Lower, NaturalOrdering<int> > ldlt_colmajor_lower_nat;
21   SimplicialLDLT<SparseMatrix<T>, Upper, NaturalOrdering<int> > ldlt_colmajor_upper_nat;
22 
23   check_sparse_spd_solving(chol_colmajor_lower_amd);
24   check_sparse_spd_solving(chol_colmajor_upper_amd);
25   check_sparse_spd_solving(llt_colmajor_lower_amd);
26   check_sparse_spd_solving(llt_colmajor_upper_amd);
27   check_sparse_spd_solving(ldlt_colmajor_lower_amd);
28   check_sparse_spd_solving(ldlt_colmajor_upper_amd);
29 
30   check_sparse_spd_determinant(chol_colmajor_lower_amd);
31   check_sparse_spd_determinant(chol_colmajor_upper_amd);
32   check_sparse_spd_determinant(llt_colmajor_lower_amd);
33   check_sparse_spd_determinant(llt_colmajor_upper_amd);
34   check_sparse_spd_determinant(ldlt_colmajor_lower_amd);
35   check_sparse_spd_determinant(ldlt_colmajor_upper_amd);
36 
37   check_sparse_spd_solving(ldlt_colmajor_lower_nat);
38   check_sparse_spd_solving(ldlt_colmajor_upper_nat);
39 }
40 
test_simplicial_cholesky()41 void test_simplicial_cholesky()
42 {
43   CALL_SUBTEST_1(test_simplicial_cholesky_T<double>());
44   CALL_SUBTEST_2(test_simplicial_cholesky_T<std::complex<double> >());
45 }
46