source: pacpussensors/trunk/Vislab/lib3dv-1.2.0/lib3dv/eigen/test/pastix_support.cpp

Last change on this file was 136, checked in by ldecherf, 8 years ago

Doc

File size: 1.6 KB
Line 
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2012 Gael Guennebaud <gael.guennebaud@inria.fr>
5// Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
6//
7// This Source Code Form is subject to the terms of the Mozilla
8// Public License v. 2.0. If a copy of the MPL was not distributed
9// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10#include "sparse_solver.h"
11#include <Eigen/PaStiXSupport>
12#include <unsupported/Eigen/SparseExtra>
13
14
15template<typename T> void test_pastix_T()
16{
17 PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_llt_lower;
18 PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_ldlt_lower;
19 PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_llt_upper;
20 PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_ldlt_upper;
21 PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
22
23 check_sparse_spd_solving(pastix_llt_lower);
24 check_sparse_spd_solving(pastix_ldlt_lower);
25 check_sparse_spd_solving(pastix_llt_upper);
26 check_sparse_spd_solving(pastix_ldlt_upper);
27 check_sparse_square_solving(pastix_lu);
28}
29
30// There is no support for selfadjoint matrices with PaStiX.
31// Complex symmetric matrices should pass though
32template<typename T> void test_pastix_T_LU()
33{
34 PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
35 check_sparse_square_solving(pastix_lu);
36}
37
38void test_pastix_support()
39{
40 CALL_SUBTEST_1(test_pastix_T<float>());
41 CALL_SUBTEST_2(test_pastix_T<double>());
42 CALL_SUBTEST_3( (test_pastix_T_LU<std::complex<float> >()) );
43 CALL_SUBTEST_4(test_pastix_T_LU<std::complex<double> >());
44}
Note: See TracBrowser for help on using the repository browser.