24template<
class T = real_t>
32 typedef typename Base::LinOpPtr LinOpPtr;
34 typedef memory::shared_ptr<gsBiCgStab> Ptr;
35 typedef memory::unique_ptr<gsBiCgStab> uPtr;
41 template<
typename OperatorType >
42 explicit gsBiCgStab(
const OperatorType& mat,
const LinOpPtr& precond = LinOpPtr() )
43 :
Base(mat, precond), m_restartThereshold(1e-32) {}
49 template<
typename OperatorType >
50 static uPtr
make(
const OperatorType& mat,
const LinOpPtr& precond = LinOpPtr() )
51 {
return uPtr(
new gsBiCgStab(mat, precond) ); }
57 opt.
addReal(
"RestartThereshold",
"Thereshold for restarting gsBiCgStab solver.", 1e-32 );
65 m_restartThereshold = opt.
askReal(
"RestartThereshold", m_restartThereshold);
70 bool step( VectorType& x );
73 std::ostream &
print(std::ostream &os)
const
102 T m_restartThereshold;
107#ifndef GISMO_BUILD_LIB
108#include GISMO_HPP_HEADER(gsBiCgStab.hpp)
Biconjugate gradient stabilized solver.
Definition gsBiCgStab.h:26
bool step(VectorType &x)
Perform one step, requires initIteration.
Definition gsBiCgStab.hpp:44
gsBiCgStab & setOptions(const gsOptionList &opt)
Set the options based on a gsOptionList.
Definition gsBiCgStab.h:62
bool initIteration(const VectorType &rhs, VectorType &x)
Init the iteration.
Definition gsBiCgStab.hpp:18
static uPtr make(const OperatorType &mat, const LinOpPtr &precond=LinOpPtr())
Make function using a matrix (operator) and optionally a preconditionner.
Definition gsBiCgStab.h:50
gsBiCgStab(const OperatorType &mat, const LinOpPtr &precond=LinOpPtr())
Constructor using a matrix (operator) and optionally a preconditionner.
Definition gsBiCgStab.h:42
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsBiCgStab.h:73
static gsOptionList defaultOptions()
Returns a list of default options.
Definition gsBiCgStab.h:54
Abstract class for iterative solvers.
Definition gsIterativeSolver.h:27
virtual gsIterativeSolver & setOptions(const gsOptionList &opt)
Set the options based on a gsOptionList.
Definition gsIterativeSolver.h:102
T m_rhs_norm
The norm of the right-hand-side.
Definition gsIterativeSolver.h:257
T m_error
The relative error as absolute_error/m_rhs_norm.
Definition gsIterativeSolver.h:258
LinOpPtr m_precond
The preconditioner.
Definition gsIterativeSolver.h:253
static gsOptionList defaultOptions()
Returns a list of default options.
Definition gsIterativeSolver.h:92
gsOptionList::Real m_tol
The tolerance for m_error to be reached.
Definition gsIterativeSolver.h:255
index_t m_num_iter
The number of iterations performed.
Definition gsIterativeSolver.h:256
index_t m_max_iters
The upper bound for the number of iterations.
Definition gsIterativeSolver.h:254
const LinOpPtr m_mat
The matrix/operator to be solved for.
Definition gsIterativeSolver.h:252
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
Real askReal(const std::string &label, const Real &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:139
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:211
Abstract class for iterative solvers.
The G+Smo namespace, containing all definitions for the library.