minres.cpp
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2011 Gael Guennebaud <g.gael@free.fr>
00005 // Copyright (C) 2012 Giacomo Po <gpo@ucla.edu>
00006 //
00007 // This Source Code Form is subject to the terms of the Mozilla
00008 // Public License v. 2.0. If a copy of the MPL was not distributed
00009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00010 #include <cmath>
00011 
00012 #include "../../test/sparse_solver.h"
00013 #include <Eigen/IterativeSolvers>
00014 
00015 template<typename T> void test_minres_T()
00016 {
00017   MINRES<SparseMatrix<T>, Lower|Upper, DiagonalPreconditioner<T> > minres_colmajor_diag;
00018   MINRES<SparseMatrix<T>, Lower, IdentityPreconditioner    > minres_colmajor_lower_I;
00019   MINRES<SparseMatrix<T>, Upper, IdentityPreconditioner    > minres_colmajor_upper_I;
00020 //  MINRES<SparseMatrix<T>, Lower, IncompleteLUT<T> >           minres_colmajor_ilut;
00021   //minres<SparseMatrix<T>, SSORPreconditioner<T> >     minres_colmajor_ssor;
00022 
00023 
00024 //   CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_diag)  );
00025  // CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_ilut)     );
00026   //CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_ssor)     );
00027 
00028   // Diagonal preconditioner
00029   MINRES<SparseMatrix<T>, Lower, DiagonalPreconditioner<T> > minres_colmajor_lower_diag;
00030   MINRES<SparseMatrix<T>, Upper, DiagonalPreconditioner<T> > minres_colmajor_upper_diag;
00031   MINRES<SparseMatrix<T>, Upper|Lower, DiagonalPreconditioner<T> > minres_colmajor_uplo_diag;
00032   
00033   // call tests for SPD matrix
00034   CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_I) );
00035   CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_I) );
00036     
00037   CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_lower_diag)  );
00038   CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_upper_diag)  );
00039 //   CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_uplo_diag)  );
00040     
00041   // TO DO: symmetric semi-definite matrix
00042   // TO DO: symmetric indefinite matrix
00043 }
00044 
00045 void test_minres()
00046 {
00047   CALL_SUBTEST_1(test_minres_T<double>());
00048 //  CALL_SUBTEST_2(test_minres_T<std::complex<double> >());
00049 }


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:33:19