10 #ifndef ROL_CONJUGATERESIDUALS_H
11 #define ROL_CONJUGATERESIDUALS_H
27 ROL::Ptr<Vector<Real> >
r_;
28 ROL::Ptr<Vector<Real> >
v_;
29 ROL::Ptr<Vector<Real> >
p_;
30 ROL::Ptr<Vector<Real> >
Ap_;
31 ROL::Ptr<Vector<Real> >
MAp_;
34 ConjugateResiduals( Real absTol = 1.e-4, Real relTol = 1.e-2,
int maxit = 100,
bool useInexact =
false )
39 int &iter,
int &flag ) {
50 Real rnorm = b.
norm();
52 Real itol = std::sqrt(ROL_EPSILON<Real>());
76 Real kappa(0), beta(0), alpha(0), tmp(0);
78 Real gHg =
r_->apply(*
v_);
80 for (iter = 0; iter < (int)Krylov<Real>::getMaximumIteration(); iter++) {
81 itol = std::sqrt(ROL_EPSILON<Real>());
105 gHg =
r_->apply(*
v_);
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Provides definition of the Conjugate Residual solver.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Contains definitions of custom data types in ROL.
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const =0
Apply linear operator.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
ROL::Ptr< Vector< Real > > r_
ROL::Ptr< Vector< Real > > Ap_
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
Real run(Vector< Real > &x, LinearOperator< Real > &A, const Vector< Real > &b, LinearOperator< Real > &M, int &iter, int &flag)
Provides definitions for Krylov solvers.
Provides the interface to apply a linear operator.
ROL::Ptr< Vector< Real > > v_
ConjugateResiduals(Real absTol=1.e-4, Real relTol=1.e-2, int maxit=100, bool useInexact=false)
ROL::Ptr< Vector< Real > > p_
ROL::Ptr< Vector< Real > > MAp_
virtual Real norm() const =0
Returns where .