xref: /aosp_15_r20/external/eigen/unsupported/test/dgmres.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
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) 2011 Gael Guennebaud <[email protected]>
5*bf2c3715SXin Li // Copyright (C) 2012 desire Nuentsa <[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 #include "../../test/sparse_solver.h"
12*bf2c3715SXin Li #include <unsupported/Eigen/IterativeSolvers>
13*bf2c3715SXin Li 
test_dgmres_T()14*bf2c3715SXin Li template<typename T> void test_dgmres_T()
15*bf2c3715SXin Li {
16*bf2c3715SXin Li   DGMRES<SparseMatrix<T>, DiagonalPreconditioner<T> > dgmres_colmajor_diag;
17*bf2c3715SXin Li   DGMRES<SparseMatrix<T>, IdentityPreconditioner    > dgmres_colmajor_I;
18*bf2c3715SXin Li   DGMRES<SparseMatrix<T>, IncompleteLUT<T> >           dgmres_colmajor_ilut;
19*bf2c3715SXin Li   //GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     dgmres_colmajor_ssor;
20*bf2c3715SXin Li 
21*bf2c3715SXin Li   CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_diag)  );
22*bf2c3715SXin Li //   CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_I)     );
23*bf2c3715SXin Li   CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ilut)     );
24*bf2c3715SXin Li   //CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ssor)     );
25*bf2c3715SXin Li }
26*bf2c3715SXin Li 
EIGEN_DECLARE_TEST(dgmres)27*bf2c3715SXin Li EIGEN_DECLARE_TEST(dgmres)
28*bf2c3715SXin Li {
29*bf2c3715SXin Li   CALL_SUBTEST_1(test_dgmres_T<double>());
30*bf2c3715SXin Li   CALL_SUBTEST_2(test_dgmres_T<std::complex<double> >());
31*bf2c3715SXin Li }
32