6#ifndef DUNE_ISTL_SOLVERS_HH
7#define DUNE_ISTL_SOLVERS_HH
17#include <dune/common/exceptions.hh>
18#include <dune/common/math.hh>
19#include <dune/common/simd/io.hh>
20#include <dune/common/simd/simd.hh>
21#include <dune/common/std/type_traits.hh>
22#include <dune/common/timer.hh>
79 _op->applyscaleadd(-1,x,b);
83 if(iteration.step(0, def)){
99 _op->applyscaleadd(-1,v,b);
101 if(iteration.step(i, def))
147 _op->applyscaleadd(-1,x,b);
150 if(iteration.step(0, def)){
165 auto alpha =
_sp->dot(q,p);
173 if(iteration.step(i, def))
224 condition_estimate_(condition_estimate)
227 condition_estimate_ =
false;
228 std::cerr <<
"WARNING: Condition estimate was disabled. It is only available for double and float field types!" << std::endl;
240 scalar_real_type reduction,
int maxit,
int verbose,
bool condition_estimate) :
IterativeSolver<X,X>(op, sp, prec, reduction, maxit, verbose),
241 condition_estimate_(condition_estimate)
243 if (condition_estimate && !(std::is_same<field_type,float>::value || std::is_same<field_type,double>::value)) {
244 condition_estimate_ =
false;
245 std::cerr <<
"WARNING: Condition estimate was disabled. It is only available for double and float field types!" << std::endl;
259 scalar_real_type reduction,
int maxit,
int verbose,
bool condition_estimate)
261 condition_estimate_(condition_estimate)
263 if (condition_estimate && !(std::is_same<field_type,float>::value || std::is_same<field_type,double>::value)) {
264 condition_estimate_ =
false;
265 std::cerr <<
"WARNING: Condition estimate was disabled. It is only available for double and float field types!" << std::endl;
285 _op->applyscaleadd(-1,x,b);
288 if(iteration.step(0, def)){
297 std::vector<real_type> lambdas(0);
298 std::vector<real_type> betas(0);
306 rholast =
_sp->dot(p,b);
314 alpha =
_sp->dot(p,q);
317 if (condition_estimate_)
318 lambdas.push_back(std::real(lambda));
324 if(iteration.step(i, def))
333 if (condition_estimate_)
334 betas.push_back(std::real(beta));
342 if (condition_estimate_) {
353 for (
auto row = T.createbegin(); row != T.createend(); ++row) {
355 row.insert(row.index()-1);
356 row.insert(row.index());
357 if (row.index() < T.N() - 1)
358 row.insert(row.index()+1);
360 for (
int row = 0; row < i; ++row) {
362 T[row][row-1] = sqrt(betas[row-1]) / lambdas[row-1];
365 T[row][row] = 1.0 / lambdas[row];
367 T[row][row] += betas[row-1] / lambdas[row-1];
371 T[row][row+1] = sqrt(betas[row]) / lambdas[row];
387 std::cout <<
"Min eigv estimate: " << Simd::io(min_eigv) <<
'\n';
388 std::cout <<
"Max eigv estimate: " << Simd::io(max_eigv) <<
'\n';
389 std::cout <<
"Condition estimate: "
390 << Simd::io(max_eigv / min_eigv) << std::endl;
394 std::cerr <<
"WARNING: Condition estimate was requested. This requires ARPACK, but ARPACK was not found!" << std::endl;
400 bool condition_estimate_ =
false;
443 const Simd::Scalar<real_type> EPSILON=1e-80;
446 field_type rho, rho_new, alpha, beta, h, omega;
467 _op->applyscaleadd(-1,x,r);
472 if(iteration.step(0, norm)){
487 for (it = 0.5; it <
_maxit; it+=.5)
494 rho_new =
_sp->dot(rt,r);
497 if (Simd::allTrue(abs(rho) <= EPSILON))
498 DUNE_THROW(
SolverAbort,
"breakdown in BiCGSTAB - rho "
499 << Simd::io(rho) <<
" <= EPSILON " << EPSILON
500 <<
" after " << it <<
" iterations");
501 if (Simd::allTrue(abs(omega) <= EPSILON))
502 DUNE_THROW(
SolverAbort,
"breakdown in BiCGSTAB - omega "
503 << Simd::io(omega) <<
" <= EPSILON " << EPSILON
504 <<
" after " << it <<
" iterations");
513 field_type(( rho_new / rho ) * ( alpha / omega )));
529 if ( Simd::allTrue(abs(h) < EPSILON) )
530 DUNE_THROW(
SolverAbort,
"abs(h) < EPSILON in BiCGSTAB - abs(h) "
531 << Simd::io(abs(h)) <<
" < EPSILON " << EPSILON
532 <<
" after " << it <<
" iterations");
550 if(iteration.step(it, norm)){
583 if(iteration.step(it, norm)){
598 template<
class CountType>
637 _op->applyscaleadd(-1.0,x,b);
646 if (iteration.step(0, def)){
654 std::array<real_type,2> c{{0.0,0.0}};
656 std::array<field_type,2> s{{0.0,0.0}};
659 std::array<field_type,3> T{{0.0,0.0,0.0}};
662 std::array<field_type,2> xi{{1.0,0.0}};
666 beta = sqrt(
_sp->dot(b,z));
670 std::array<X,3> p{{b,b,b}};
676 std::array<X,3> q{{b,b,b}};
698 q[i2].axpy(-beta,q[i0]);
702 alpha =
_sp->dot(z,q[i2]);
703 q[i2].axpy(-alpha,q[i1]);
706 _prec->apply(z,q[i2]);
710 beta = sqrt(
_sp->dot(q[i2],z));
727 T[2] = c[(i+1)%2]*alpha - s[(i+1)%2]*T[1];
728 T[1] = c[(i+1)%2]*T[1] + s[(i+1)%2]*alpha;
734 generateGivensRotation(T[2],beta,c[i%2],s[i%2]);
736 T[2] = c[i%2]*T[2] + s[i%2]*beta;
738 xi[i%2] = -s[i%2]*xi[(i+1)%2];
739 xi[(i+1)%2] *= c[i%2];
743 p[i2].axpy(-T[1],p[i1]);
744 p[i2].axpy(-T[0],p[i0]);
748 x.axpy(beta0*xi[(i+1)%2],p[i2]);
755 def = abs(beta0*xi[i%2]);
756 if(iteration.step(i, def)){
776 real_type norm_max = max(norm_dx, norm_dy);
777 real_type norm_min = min(norm_dx, norm_dy);
780 cs = Simd::cond(norm_dy < eps,
788 sn = Simd::cond(norm_dy < eps,
826 template<
class X,
class Y=X,
class F = Y>
927 const Simd::Scalar<real_type> EPSILON = 1e-80;
931 std::vector<field_type,fAlloc> s(m+1), sn(m);
932 std::vector<real_type,rAlloc> cs(m);
937 std::vector< std::vector<field_type,fAlloc> > H(m+1,s);
938 std::vector<F> v(m+1,b);
946 _op->applyscaleadd(-1.0,x,b);
948 v[0] = 0.0;
_prec->apply(v[0],b);
949 norm =
_sp->norm(v[0]);
950 if(iteration.step(0, norm)){
970 _op->apply(v[i],v[i+1]);
971 _prec->apply(w,v[i+1]);
972 for(
int k=0; k<i+1; k++) {
977 H[k][i] =
_sp->dot(v[k],w);
979 w.axpy(-H[k][i],v[k]);
981 H[i+1][i] =
_sp->norm(w);
982 if(Simd::allTrue(abs(H[i+1][i]) < EPSILON))
984 "breakdown in GMRes - |w| == 0.0 after " << j <<
" iterations");
988 v[i+1] *= Simd::cond(norm==
real_type(0.),
993 for(
int k=0; k<i; k++)
1005 iteration.step(j, norm);
1021 std::cout <<
"=== GMRes::restart" << std::endl;
1025 _op->applyscaleadd(-1.0,x,b);
1028 _prec->apply(v[0],b);
1029 norm =
_sp->norm(v[0]);
1041 const std::vector<std::vector<field_type,fAlloc> >& H,
1042 const std::vector<field_type,fAlloc>& s,
1043 const std::vector<X>& v) {
1045 std::vector<field_type,fAlloc> y(s);
1048 for(
int a=i-1; a>=0; a--) {
1050 for(
int b=a+1; b<i; b++)
1051 rhs -= H[a][b]*y[b];
1062 template<
typename T>
1063 typename std::enable_if<std::is_same<field_type,real_type>::value,T>
::type conjugate(
const T& t) {
1067 template<
typename T>
1068 typename std::enable_if<!std::is_same<field_type,real_type>::value,T>
::type conjugate(
const T& t) {
1083 real_type norm_max = max(norm_dx, norm_dy);
1084 real_type norm_min = min(norm_dx, norm_dy);
1087 cs = Simd::cond(norm_dy < eps,
1089 Simd::cond(norm_dx < eps,
1095 sn = Simd::cond(norm_dy < eps,
1097 Simd::cond(norm_dx < eps,
1138 template<
class X,
class Y=X,
class F = Y>
1173 const Simd::Scalar<real_type> EPSILON = 1e-80;
1177 std::vector<field_type,fAlloc> s(m+1), sn(m);
1178 std::vector<real_type,rAlloc> cs(m);
1181 std::vector< std::vector<field_type,fAlloc> > H(m+1,s);
1182 std::vector<F> v(m+1,b);
1183 std::vector<X> w(m+1,b);
1185 Iteration iteration(*
this,res);
1191 _op->applyscaleadd(-1.0, x, v[0]);
1193 norm =
_sp->norm(v[0]);
1194 if(iteration.step(0, norm)){
1203 v[0] *= (1.0 / norm);
1205 for(i=1; i<m+1; ++i)
1213 _prec->apply(w[i], v[i]);
1216 _op->apply(w[i], v[i+1]);
1218 for(
int kk=0; kk<i+1; kk++)
1224 H[kk][i] =
_sp->dot(v[kk],v[i+1]);
1226 v[i+1].axpy(-H[kk][i], v[kk]);
1228 H[i+1][i] =
_sp->norm(v[i+1]);
1229 if(Simd::allTrue(abs(H[i+1][i]) < EPSILON))
1230 DUNE_THROW(
SolverAbort,
"breakdown in fGMRes - |w| (-> "
1231 << w[i] <<
") == 0.0 after "
1232 << j <<
" iterations");
1251 iteration.step(j, norm);
1256 this->
update(tmp, i, H, s, w);
1266 std::cout <<
"=== fGMRes::restart" << std::endl;
1270 _op->applyscaleadd(-1.0, x,v[0]);
1272 norm =
_sp->norm(v[0]);
1364 _restart(configuration.
get<int>(
"restart"))
1369 _restart(configuration.
get<int>(
"restart"))
1393 Iteration iteration(*
this, res);
1395 _op->applyscaleadd(-1,x,b);
1397 std::vector<std::shared_ptr<X> > p(_restart);
1398 std::vector<field_type,fAlloc> pp(_restart);
1402 p[0].reset(
new X(x));
1405 if(iteration.step(0, def)){
1415 _prec->apply(*(p[0]),b);
1416 rho =
_sp->dot(*(p[0]),b);
1417 _op->apply(*(p[0]),q);
1418 pp[0] =
_sp->dot(*(p[0]),q);
1420 x.axpy(lambda,*(p[0]));
1426 if(iteration.step(i, def)){
1433 int end=std::min(_restart,
_maxit-i+1);
1434 for (
int ii = 1; ii < end; ++ii)
1439 _prec->apply(prec_res,b);
1441 p[ii].reset(
new X(prec_res));
1442 _op->apply(prec_res, q);
1444 for(
int j=0; j<ii; ++j) {
1445 rho =
_sp->dot(q,*(p[j]))/pp[j];
1446 p[ii]->axpy(-rho, *(p[j]));
1450 _op->apply(*(p[ii]),q);
1451 pp[ii] =
_sp->dot(*(p[ii]),q);
1452 rho =
_sp->dot(*(p[ii]),b);
1453 lambda = rho/pp[ii];
1454 x.axpy(lambda,*(p[ii]));
1461 iteration.step(i, def);
1466 *(p[0])=*(p[_restart-1]);
1467 pp[0]=pp[_restart-1];
1529 scalar_real_type reduction,
int maxit,
int verbose,
int mmax = 10) :
IterativeSolver<X,X>(op, sp, prec, reduction, maxit, verbose),
_mmax(mmax)
1560 const ParameterTree& configuration)
1567 const ParameterTree& config)
1589 _op->applyscaleadd(-1,x,b);
1592 std::vector<X> d(
_mmax+1, x);
1593 std::vector<X> Ad(
_mmax+1, x);
1594 std::vector<field_type,rAlloc> ddotAd(
_mmax+1,0);
1598 if(iteration.step(0, def)){
1610 for (; i_bounded <=
_mmax && i<=
_maxit; i_bounded++) {
1612 _prec->apply(d[i_bounded], b);
1615 orthogonalizations(i_bounded,Ad,w,ddotAd,d);
1618 _op->apply(d[i_bounded], Ad[i_bounded]);
1619 ddotAd[i_bounded]=
_sp->dot(d[i_bounded],Ad[i_bounded]);
1620 alpha =
_sp->dot(d[i_bounded], b)/ddotAd[i_bounded];
1623 x.axpy(alpha, d[i_bounded]);
1624 b.axpy(-alpha, Ad[i_bounded]);
1629 iteration.step(i, def);
1633 cycle(Ad,d,ddotAd,i_bounded);
1646 for (
int k = 0; k < i_bounded; k++) {
1647 d[i_bounded].axpy(-
_sp->dot(Ad[k], w) / ddotAd[k], d[k]);
1655 std::swap(Ad[0], Ad[
_mmax]);
1656 std::swap(d[0], d[
_mmax]);
1657 std::swap(ddotAd[0], ddotAd[
_mmax]);
1704 for (
int k = 0; k < _k_limit; k++) {
1706 d[i_bounded].axpy(-
_sp->dot(Ad[k], w) / ddotAd[k], d[k]);
1709 if(_k_limit<=i_bounded)
1719 _k_limit = Ad.size();
Implementation of the BCRSMatrix class.
Define general, extensible interface for operators. The available implementation wraps a matrix.
Define base class for scalar product and norm.
#define DUNE_REGISTER_SOLVER(name,...)
Definition solverregistry.hh:16
Define general, extensible interface for inverse operators.
auto defaultIterativeSolverCreator()
Definition solverregistry.hh:76
Definition allocator.hh:11
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition dependency.hh:293
const Dtype_t BaseGetSuperLUType< T >::type
Definition supermatrix.hh:135
typename std::allocator_traits< typename AllocatorTraits< T >::type >::template rebind_alloc< X > ReboundAllocatorType
Definition allocator.hh:37
A sparse block matrix with compressed row storage.
Definition bcrsmatrix.hh:467
@ row_wise
Definition bcrsmatrix.hh:518
A vector of blocks with memory management.
Definition bvector.hh:392
Wrapper to use a range of ARPACK++ eigenvalue solvers.
Definition arpackpp.hh:245
void computeSymMaxMagnitude(const Real &epsilon, BlockVector &x, Real &lambda) const
Assume the matrix to be square, symmetric and perform IRLM to compute an approximation lambda of its ...
Definition arpackpp.hh:289
void computeSymMinMagnitude(const Real &epsilon, BlockVector &x, Real &lambda) const
Assume the matrix to be square, symmetric and perform IRLM to compute an approximation lambda of its ...
Definition arpackpp.hh:391
Thrown when a solver aborts due to some problem.
Definition istlexception.hh:46
A linear operator.
Definition operators.hh:68
Base class for matrix free definition of preconditioners.
Definition preconditioner.hh:33
Base class for scalar product and norm computation.
Definition scalarproducts.hh:52
Statistics about the application of an inverse operator.
Definition solver.hh:50
double condition_estimate
Estimate of condition number.
Definition solver.hh:81
void clear()
Resets all data.
Definition solver.hh:58
bool converged
True if convergence criterion has been met.
Definition solver.hh:75
Simd::Scalar< real_type > scalar_real_type
scalar type underlying the field_type
Definition solver.hh:116
Y range_type
Type of the range of the operator to be inverted.
Definition solver.hh:107
X domain_type
Type of the domain of the operator to be inverted.
Definition solver.hh:104
X::field_type field_type
The field type of the operator.
Definition solver.hh:110
FieldTraits< field_type >::real_type real_type
The real type of the field type (is the same if using real numbers, but differs for std::complex).
Definition solver.hh:113
Base class for all implementations of iterative solvers.
Definition solver.hh:205
std::shared_ptr< const ScalarProduct< X > > _sp
Definition solver.hh:508
IterativeSolver(const LinearOperator< X, X > &op, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose)
Definition solver.hh:232
std::shared_ptr< const LinearOperator< X, X > > _op
Definition solver.hh:506
int _maxit
Definition solver.hh:510
int _verbose
Definition solver.hh:511
scalar_real_type _reduction
Definition solver.hh:509
std::shared_ptr< Preconditioner< X, X > > _prec
Definition solver.hh:507
Preconditioned loop solver.
Definition solvers.hh:59
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:116
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator,.
Definition solvers.hh:73
gradient method
Definition solvers.hh:124
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:142
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:187
CGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, scalar_real_type reduction, int maxit, int verbose, bool condition_estimate)
Constructor to initialize a CG solver.
Definition solvers.hh:257
static constexpr bool enableConditionEstimate
Definition solvers.hh:208
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:280
CGSolver(const LinearOperator< X, X > &op, const ScalarProduct< X > &sp, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, bool condition_estimate)
Constructor to initialize a CG solver.
Definition solvers.hh:239
CGSolver(const LinearOperator< X, X > &op, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, bool condition_estimate)
Constructor to initialize a CG solver.
Definition solvers.hh:222
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:413
Bi-conjugate Gradient Stabilized (BiCG-STAB).
Definition solvers.hh:420
typename IterativeSolver< X, X >::template Iteration< CountType > Iteration
Definition solvers.hh:599
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:440
Minimal Residual Method (MINRES).
Definition solvers.hh:610
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:809
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:628
implements the Generalized Minimal Residual (GMRes) method
Definition solvers.hh:828
RestartedGMResSolver(std::shared_ptr< const LinearOperator< X, Y > > op, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &configuration)
Constructor.
Definition solvers.hh:879
void apply(X &x, Y &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:911
std::enable_if<!std::is_same< field_type, real_type >::value, T >::type conjugate(const T &t)
Definition solvers.hh:1068
RestartedGMResSolver(std::shared_ptr< const LinearOperator< X, Y > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &configuration)
Definition solvers.hh:884
void update(X &w, int i, const std::vector< std::vector< field_type, fAlloc > > &H, const std::vector< field_type, fAlloc > &s, const std::vector< X > &v)
Definition solvers.hh:1040
std::enable_if< std::is_same< field_type, real_type >::value, T >::type conjugate(const T &t)
Definition solvers.hh:1063
ReboundAllocatorType< X, field_type > fAlloc
field_type Allocator retrieved from domain type
Definition solvers.hh:839
int _restart
Definition solvers.hh:1121
ReboundAllocatorType< X, real_type > rAlloc
real_type Allocator retrieved from domain type
Definition solvers.hh:841
RestartedGMResSolver(const LinearOperator< X, Y > &op, Preconditioner< X, Y > &prec, scalar_real_type reduction, int restart, int maxit, int verbose)
Set up RestartedGMResSolver solver.
Definition solvers.hh:851
RestartedGMResSolver(const LinearOperator< X, Y > &op, const ScalarProduct< X > &sp, Preconditioner< X, Y > &prec, scalar_real_type reduction, int restart, int maxit, int verbose)
Set up RestartedGMResSolver solver.
Definition solvers.hh:862
void generatePlaneRotation(field_type &dx, field_type &dy, real_type &cs, field_type &sn)
Definition solvers.hh:1074
void apply(X &x, Y &b, double reduction, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:924
RestartedGMResSolver(std::shared_ptr< const LinearOperator< X, Y > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, Y > > prec, scalar_real_type reduction, int restart, int maxit, int verbose)
Set up RestartedGMResSolver solver.
Definition solvers.hh:895
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:1120
void applyPlaneRotation(field_type &dx, field_type &dy, real_type &cs, field_type &sn)
Definition solvers.hh:1107
implements the Flexible Generalized Minimal Residual (FGMRes) method (right preconditioned)
Definition solvers.hh:1140
void apply(X &x, Y &b, double reduction, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:1170
GeneralizedPCGSolver(const LinearOperator< X, X > &op, const ScalarProduct< X > &sp, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, int restart=10)
Set up nonlinear preconditioned conjugate gradient solver.
Definition solvers.hh:1344
GeneralizedPCGSolver(const LinearOperator< X, X > &op, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, int restart=10)
Set up nonlinear preconditioned conjugate gradient solver.
Definition solvers.hh:1332
GeneralizedPCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &configuration)
Set up nonlinear preconditioned conjugate gradient solver.
Definition solvers.hh:1362
GeneralizedPCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, scalar_real_type reduction, int maxit, int verbose, int restart=10)
Set up nonlinear preconditioned conjugate gradient solver.
Definition solvers.hh:1377
GeneralizedPCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &configuration)
Definition solvers.hh:1367
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:1391
RestartedFCGSolver(const LinearOperator< X, X > &op, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, int mmax=10)
Constructor to initialize a RestartedFCG solver.
Definition solvers.hh:1518
RestartedFCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, scalar_real_type reduction, int maxit, int verbose, int mmax=10)
Constructor to initialize a RestartedFCG solver.
Definition solvers.hh:1538
int _mmax
Definition solvers.hh:1661
RestartedFCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< const ScalarProduct< X > > sp, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &config)
Definition solvers.hh:1564
typename IterativeSolver< X, X >::template Iteration< unsigned int > Iteration
Definition solvers.hh:1668
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator.
Definition solvers.hh:1583
RestartedFCGSolver(std::shared_ptr< const LinearOperator< X, X > > op, std::shared_ptr< Preconditioner< X, X > > prec, const ParameterTree &configuration)
Constructor to initialize a RestartedFCG solver.
Definition solvers.hh:1558
RestartedFCGSolver(const LinearOperator< X, X > &op, const ScalarProduct< X > &sp, Preconditioner< X, X > &prec, scalar_real_type reduction, int maxit, int verbose, int mmax=10)
Constructor to initialize a RestartedFCG solver.
Definition solvers.hh:1528
Complete flexible conjugate gradient method.
Definition solvers.hh:1679
void apply(X &x, X &b, InverseOperatorResult &res) override
Apply inverse operator,.
Definition solvers.hh:1693