idrs.cpp 942 B

123456789101112131415161718192021222324252627
  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_idrs_T()
  13. {
  14. IDRS<SparseMatrix<T>, DiagonalPreconditioner<T> > idrs_colmajor_diag;
  15. IDRS<SparseMatrix<T>, IncompleteLUT<T> > idrs_colmajor_ilut;
  16. CALL_SUBTEST( check_sparse_square_solving(idrs_colmajor_diag) );
  17. CALL_SUBTEST( check_sparse_square_solving(idrs_colmajor_ilut) );
  18. }
  19. EIGEN_DECLARE_TEST(idrs)
  20. {
  21. CALL_SUBTEST_1(test_idrs_T<double>());
  22. CALL_SUBTEST_2(test_idrs_T<std::complex<double> >());
  23. }