1*bf2c3715SXin Li // This file is part of Eigen, a lightweight C++ template library
2*bf2c3715SXin Li // for linear algebra.
3*bf2c3715SXin Li //
4*bf2c3715SXin Li // Copyright (C) 2008-2012 Gael Guennebaud <[email protected]>
5*bf2c3715SXin Li // Copyright (C) 2012 Désiré Nuentsa-Wakam <[email protected]>
6*bf2c3715SXin Li //
7*bf2c3715SXin Li // This Source Code Form is subject to the terms of the Mozilla
8*bf2c3715SXin Li // Public License v. 2.0. If a copy of the MPL was not distributed
9*bf2c3715SXin Li // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10*bf2c3715SXin Li
11*bf2c3715SXin Li #define EIGEN_NO_DEBUG_SMALL_PRODUCT_BLOCKS
12*bf2c3715SXin Li #include "sparse_solver.h"
13*bf2c3715SXin Li #include <Eigen/PaStiXSupport>
14*bf2c3715SXin Li #include <unsupported/Eigen/SparseExtra>
15*bf2c3715SXin Li
16*bf2c3715SXin Li
test_pastix_T()17*bf2c3715SXin Li template<typename T> void test_pastix_T()
18*bf2c3715SXin Li {
19*bf2c3715SXin Li PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_llt_lower;
20*bf2c3715SXin Li PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Lower > pastix_ldlt_lower;
21*bf2c3715SXin Li PastixLLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_llt_upper;
22*bf2c3715SXin Li PastixLDLT< SparseMatrix<T, ColMajor>, Eigen::Upper > pastix_ldlt_upper;
23*bf2c3715SXin Li PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
24*bf2c3715SXin Li
25*bf2c3715SXin Li check_sparse_spd_solving(pastix_llt_lower);
26*bf2c3715SXin Li check_sparse_spd_solving(pastix_ldlt_lower);
27*bf2c3715SXin Li check_sparse_spd_solving(pastix_llt_upper);
28*bf2c3715SXin Li check_sparse_spd_solving(pastix_ldlt_upper);
29*bf2c3715SXin Li check_sparse_square_solving(pastix_lu);
30*bf2c3715SXin Li
31*bf2c3715SXin Li // Some compilation check:
32*bf2c3715SXin Li pastix_llt_lower.iparm();
33*bf2c3715SXin Li pastix_llt_lower.dparm();
34*bf2c3715SXin Li pastix_ldlt_lower.iparm();
35*bf2c3715SXin Li pastix_ldlt_lower.dparm();
36*bf2c3715SXin Li pastix_lu.iparm();
37*bf2c3715SXin Li pastix_lu.dparm();
38*bf2c3715SXin Li }
39*bf2c3715SXin Li
40*bf2c3715SXin Li // There is no support for selfadjoint matrices with PaStiX.
41*bf2c3715SXin Li // Complex symmetric matrices should pass though
test_pastix_T_LU()42*bf2c3715SXin Li template<typename T> void test_pastix_T_LU()
43*bf2c3715SXin Li {
44*bf2c3715SXin Li PastixLU< SparseMatrix<T, ColMajor> > pastix_lu;
45*bf2c3715SXin Li check_sparse_square_solving(pastix_lu);
46*bf2c3715SXin Li }
47*bf2c3715SXin Li
EIGEN_DECLARE_TEST(pastix_support)48*bf2c3715SXin Li EIGEN_DECLARE_TEST(pastix_support)
49*bf2c3715SXin Li {
50*bf2c3715SXin Li CALL_SUBTEST_1(test_pastix_T<float>());
51*bf2c3715SXin Li CALL_SUBTEST_2(test_pastix_T<double>());
52*bf2c3715SXin Li CALL_SUBTEST_3( (test_pastix_T_LU<std::complex<float> >()) );
53*bf2c3715SXin Li CALL_SUBTEST_4(test_pastix_T_LU<std::complex<double> >());
54*bf2c3715SXin Li }
55