44 #ifndef ROL_CONJUGATERESIDUALS_H 45 #define ROL_CONJUGATERESIDUALS_H 63 Teuchos::RCP<Vector<Real> >
r_;
64 Teuchos::RCP<Vector<Real> >
v_;
65 Teuchos::RCP<Vector<Real> >
p_;
66 Teuchos::RCP<Vector<Real> >
Ap_;
67 Teuchos::RCP<Vector<Real> >
MAp_;
70 ConjugateResiduals( Real absTol = 1.e-4, Real relTol = 1.e-2,
int maxit = 100,
bool useInexact =
false )
75 int &iter,
int &flag ) {
86 Real rnorm = b.
norm();
88 Real itol = std::sqrt(ROL_EPSILON<Real>());
112 Real kappa(0), beta(0), alpha(0), tmp(0);
113 Real gHg =
r_->dot(
v_->dual());
115 for (iter = 0; iter < (int)Krylov<Real>::getMaximumIteration(); iter++) {
116 itol = std::sqrt(ROL_EPSILON<Real>());
118 kappa =
MAp_->dot(
Ap_->dual());
129 if ( rnorm < rtol ) {
138 gHg =
r_->dot(
v_->dual());
Provides definition of the Conjugate Residual solver.
Teuchos::RCP< Vector< Real > > v_
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.
Teuchos::RCP< Vector< Real > > Ap_
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Teuchos::RCP< Vector< Real > > r_
Teuchos::RCP< Vector< Real > > MAp_
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void 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.
ConjugateResiduals(Real absTol=1.e-4, Real relTol=1.e-2, int maxit=100, bool useInexact=false)
virtual Real norm() const =0
Returns where .
Teuchos::RCP< Vector< Real > > p_