32template<
class T=real_t>
41 typedef typename Base::LinOpPtr LinOpPtr;
43 typedef memory::shared_ptr<gsMinResQLP> Ptr;
44 typedef memory::unique_ptr<gsMinResQLP> uPtr;
50 template<
typename OperatorType >
52 const LinOpPtr& precond = LinOpPtr())
53 :
Base(mat, precond), m_inexact_residual(false) {}
59 template<
typename OperatorType >
60 static uPtr
make(
const OperatorType& mat,
const LinOpPtr& precond = LinOpPtr() )
66 bool step( VectorType& x );
73 "If true, the residual is estimated, not accurately computed.",
82 m_inexact_residual = opt.
askSwitch(
"InexactResidual", m_inexact_residual);
90 std::ostream &
print(std::ostream &os)
const
92 os <<
"gsMinResQLP\n";
110 T beta1, betal, beta, tau, taul, taul2, phi, betan, gmin, cs, sn,cr1,sr1,
111 cr2,sr2, deltan,gamma,gammal, gammal2, gammal3, eta,etal, etal2,
112 vepln, veplnl, veplnl2, u, ul, ul2, ul3, rnorm, rnorml, xnorm, xl2norm,
113 Axnorm, Anorm, Acond, relres, alpha, pnorm, dbar, delta,
114 epsilon, epsilonn, gbar, maxxnorm, gammal_QLP, gamma_QLP, vepln_QLP,
115 abs_gamma, gminl, gminl2, Arnorml, Arnorm, relAresl, relAres,
116 rootl, ul_QLP, u_QLP;;
120 bool m_inexact_residual;
125#ifndef GISMO_BUILD_LIB
126#include GISMO_HPP_HEADER(gsMinResQLP.hpp)
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
The minimal residual (MinRes-QLP) method.
Definition gsMinResQLP.h:34
void finalizeIteration(VectorType &x)
Some post-processing might be required.
Definition gsMinResQLP.hpp:306
bool step(VectorType &x)
Perform one step, requires initIteration.
Definition gsMinResQLP.hpp:109
bool initIteration(const VectorType &rhs, VectorType &x)
Init the iteration.
Definition gsMinResQLP.hpp:57
static uPtr make(const OperatorType &mat, const LinOpPtr &precond=LinOpPtr())
Make function using a matrix (operator) and optionally a preconditionner.
Definition gsMinResQLP.h:60
gsMinResQLP & setOptions(const gsOptionList &opt)
Set the options based on a gsOptionList.
Definition gsMinResQLP.h:79
void setInexactResidual(bool flag)
If true, the residual is estimated, not accurately computed.
Definition gsMinResQLP.h:87
gsMinResQLP(const OperatorType &mat, const LinOpPtr &precond=LinOpPtr())
Constructor using a matrix (operator) and optionally a preconditionner.
Definition gsMinResQLP.h:51
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsMinResQLP.h:90
static gsOptionList defaultOptions()
Returns a list of default options.
Definition gsMinResQLP.h:69
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
bool askSwitch(const std::string &label, const bool &value=false) const
Reads value for option label from options.
Definition gsOptionList.cpp:128
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:235
#define index_t
Definition gsConfig.h:32
Abstract class for iterative solvers.
The G+Smo namespace, containing all definitions for the library.