Loading...
Searching...
No Matches
solver_gmres_cg.h
Go to the documentation of this file.
#ifndef _RHEOLEF_SOLVER_GMRES_CG_H
#define _RHEOLEF_SOLVER_GMRES_CG_H
#include "rheolef/solver.h"
namespace rheolef {
template<class T, class M>
class solver_gmres_cg_rep : public solver_abstract_rep<T,M> {
public:
// typedef:
typedef solver_abstract_rep<T,M> base;
typedef typename base::size_type size_type;
typedef typename base::determinant_type determinant_type;
// allocator:
explicit solver_gmres_cg_rep (const csr<T,M>& a, const solver_option& opt = solver_option());
solver_abstract_rep<T,M>* clone() const;
bool initialized() const { return true; }
void update_values (const csr<T,M>& a) { _a = a; }
void set_preconditioner (const solver_basic<T,M>& p) { _precond = p; }
// accessors:
vec<T,M> trans_solve (const vec<T,M>& rhs) const;
vec<T,M> solve (const vec<T,M>& rhs) const;
determinant_type det() const;
protected:
// data:
csr<T,M> _a;
mutable solver_basic<T,M> _precond;
};
template<class T, class M>
inline
solver_gmres_cg_rep<T,M>::solver_gmres_cg_rep (const csr<T,M>& a, const solver_option& opt)
: solver_abstract_rep<T,M>(opt),
_a(a),
_precond()
{
update_values (_a);
}
template <class T, class M>
inline
solver_abstract_rep<T,M>*
solver_gmres_cg_rep<T,M>::clone() const
{
typedef solver_gmres_cg_rep<T,M> rep;
return new_macro (rep(*this));
}
} // namespace rheolef
#endif // _RHEOLEF_SOLVER_GMRES_CG_H
rheolef::csr
see the csr page for the full documentation
Definition csr.h:317
rheolef::solver_abstract_rep
Definition solver.h:191
rheolef::solver_abstract_rep::solver_abstract_rep
solver_abstract_rep(const solver_option &opt)
Definition solver.h:195
rheolef::solver_abstract_rep::size_type
csr< T, M >::size_type size_type
Definition solver.h:193
rheolef::solver_basic
Definition solver.h:264
rheolef::solver_gmres_cg_rep::_precond
solver_basic< T, M > _precond
Definition solver_gmres_cg.h:52
rheolef::solver_gmres_cg_rep::_a
csr< T, M > _a
Definition solver_gmres_cg.h:51
rheolef::solver_gmres_cg_rep::det
determinant_type det() const
Definition solver_gmres_cg.cc:74
rheolef::solver_gmres_cg_rep::set_preconditioner
void set_preconditioner(const solver_basic< T, M > &p)
Definition solver_gmres_cg.h:41
rheolef::solver_gmres_cg_rep::solver_gmres_cg_rep
solver_gmres_cg_rep(const csr< T, M > &a, const solver_option &opt=solver_option())
Definition solver_gmres_cg.h:57
rheolef::solver_gmres_cg_rep::update_values
void update_values(const csr< T, M > &a)
Definition solver_gmres_cg.h:40
rheolef::solver_gmres_cg_rep::size_type
base::size_type size_type
Definition solver_gmres_cg.h:32
rheolef::solver_gmres_cg_rep::base
solver_abstract_rep< T, M > base
Definition solver_gmres_cg.h:31
rheolef::solver_gmres_cg_rep::determinant_type
base::determinant_type determinant_type
Definition solver_gmres_cg.h:33
rheolef::solver_gmres_cg_rep::trans_solve
vec< T, M > trans_solve(const vec< T, M > &rhs) const
Definition solver_gmres_cg.cc:65
rheolef::solver_gmres_cg_rep::clone
solver_abstract_rep< T, M > * clone() const
Definition solver_gmres_cg.h:67
rheolef::solver_gmres_cg_rep::solve
vec< T, M > solve(const vec< T, M > &rhs) const
Definition solver_gmres_cg.cc:40
rheolef::solver_gmres_cg_rep::initialized
bool initialized() const
Definition solver_gmres_cg.h:39
rheolef::solver_option
see the solver_option page for the full documentation
Definition solver_option.h:155
rheolef::vec
see the vec page for the full documentation
Definition vec.h:79
T
Expr1::float_type T
Definition field_expr.h:230
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
p
Definition sphere.icc:25
rheolef::solver_abstract_rep::determinant_type
Definition solver.h:215
M
Expr1::memory_type M
Definition vec_expr_v2.h:416