1c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// This file is part of Eigen, a lightweight C++ template library
2c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// for linear algebra.
3c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath//
4c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// Copyright (C) 2011 Gael Guennebaud <g.gael@free.fr>
5c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// Copyright (C) 2012 Kolja Brix <brix@igpm.rwth-aaachen.de>
6c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath//
7c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// This Source Code Form is subject to the terms of the Mozilla
8c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// Public License v. 2.0. If a copy of the MPL was not distributed
9c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
11c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath#include "../../test/sparse_solver.h"
12c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath#include <Eigen/IterativeSolvers>
13c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
14c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtemplate<typename T> void test_gmres_T()
15c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath{
16c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  GMRES<SparseMatrix<T>, DiagonalPreconditioner<T> > gmres_colmajor_diag;
17c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  GMRES<SparseMatrix<T>, IdentityPreconditioner    > gmres_colmajor_I;
18c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  GMRES<SparseMatrix<T>, IncompleteLUT<T> >           gmres_colmajor_ilut;
19c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  //GMRES<SparseMatrix<T>, SSORPreconditioner<T> >     gmres_colmajor_ssor;
20c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
21c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_diag)  );
22c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath//   CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I)     );
23c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ilut)     );
24c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  //CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor)     );
25c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath}
26c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
27c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathvoid test_gmres()
28c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath{
297faaa9f3f0df9d23790277834d426c3d992ac3baCarlos Hernandez  CALL_SUBTEST_1(test_gmres_T<double>());
307faaa9f3f0df9d23790277834d426c3d992ac3baCarlos Hernandez  CALL_SUBTEST_2(test_gmres_T<std::complex<double> >());
31c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath}
32