44 #ifndef ROL_BICGSTAB_H
45 #define ROL_BICGSTAB_H
64 BiCGSTAB(Real absTol = 1.e-4, Real relTol = 1.e-2,
unsigned maxit = 100,
bool useInexact =
false)
67 BiCGSTAB(ParameterList &parlist,
bool useInexact =
false)
71 int &iter,
int &flag ) {
79 Real rho(1), rho1(1), alpha(1), beta(0), omega(1);
80 Real rnorm = b.
norm();
81 Real itol = std::sqrt(ROL_EPSILON<Real>());
83 if (rnorm <= rtol)
return rnorm;
94 for (iter = 0; iter < (int)Krylov<Real>::getMaximumIteration(); iter++) {
96 beta = (rho1/rho)*(alpha/omega);
106 alpha = rho1 /
v_->dot(*
r1_);
110 s_->axpy(-alpha,*
v_);
123 omega =
t_->dot(*
s_) /
t_->dot(*
t_);
127 r_->axpy(-omega,*
t_);
130 if (rnorm <= rtol)
break;
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Contains definitions of custom data types in ROL.
BiCGSTAB(ParameterList &parlist, bool useInexact=false)
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const =0
Apply linear operator.
Ptr< Vector< Real > > r1_
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
BiCGSTAB(Real absTol=1.e-4, Real relTol=1.e-2, unsigned maxit=100, bool useInexact=false)
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
Provides definitions for Krylov solvers.
Provides the interface to apply a linear operator.
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
Real run(Vector< Real > &x, LinearOperator< Real > &A, const Vector< Real > &b, LinearOperator< Real > &M, int &iter, int &flag)