You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

  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. // Copyright (C) 2012 Kolja Brix <brix@igpm.rwth-aaachen.de>
  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 "../../test/sparse_solver.h"
  11. #include <Eigen/IterativeSolvers>
  12. template<typename T> void test_gmres_T()
  13. {
  14. GMRES<SparseMatrix<T>, DiagonalPreconditioner<T> > gmres_colmajor_diag;
  15. GMRES<SparseMatrix<T>, IdentityPreconditioner > gmres_colmajor_I;
  16. GMRES<SparseMatrix<T>, IncompleteLUT<T> > gmres_colmajor_ilut;
  17. //GMRES<SparseMatrix<T>, SSORPreconditioner<T> > gmres_colmajor_ssor;
  18. CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_diag) );
  19. // CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I) );
  20. CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ilut) );
  21. //CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor) );
  22. }
  23. void test_gmres()
  24. {
  25. for(int i = 0; i < g_repeat; i++) {
  26. CALL_SUBTEST_1(test_gmres_T<double>());
  27. CALL_SUBTEST_2(test_gmres_T<std::complex<double> >());
  28. }
  29. }