25#include "rheolef/cg.h"
26#include "rheolef/gmres.h"
27#include "rheolef/vec_expr_v2.h"
28#include "rheolef/eye.h"
30#pragma GCC diagnostic push
31#pragma GCC diagnostic ignored "-Weffc++"
33#pragma GCC diagnostic pop
38template<
class T,
class M>
46 if (
_a.is_symmetric() &&
_a.is_definite_positive()) {
49 using namespace Eigen;
51 Matrix<T,Dynamic,Dynamic> h(m+1,m+1);
52 Matrix<T,Dynamic,1> dummy(m);
57 <<
" after " <<
base::option().max_iter <<
" iterations");
60 <<
" after " <<
base::option().max_iter <<
" iterations");
63template<
class T,
class M>
67 if (
_a.is_symmetric())
return solve(b);
72template <
class T,
class M>
76 error_macro (
"undefined determinant computation for iterative solver (HINT: use a direct method)");
84#ifdef _RHEOLEF_HAVE_MPI
const solver_option & option() const
solver_basic< T, M > _precond
determinant_type det() const
base::size_type size_type
base::determinant_type determinant_type
vec< T, M > trans_solve(const vec< T, M > &rhs) const
vec< T, M > solve(const vec< T, M > &rhs) const
see the vec page for the full documentation
#define error_macro(message)
#define warning_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
void solve(tiny_matrix< T > &a, tiny_vector< size_t > &piv, const tiny_vector< T > &b, tiny_vector< T > &x)
int gmres(const Matrix &A, Vector &x, const Vector &b, const Preconditioner &M, SmallMatrix &H, const SmallVector &V, const solver_option &sopt=solver_option())
solver_basic< T, M > eye_basic()
int cg(const Matrix &A, Vector &x, const Vector2 &Mb, const Preconditioner &M, const solver_option &sopt=solver_option())
field residue(Float p, const field &uh)