KASKADE 7 development version
Public Types | Public Member Functions | List of all members
Kaskade::StrakosTichyPTerminationCriterion< R > Class Template Referenceabstract

Relative error termination criterion based on the norm induced by the preconditioner, according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients. Requires that IterateType::CG starts at \( x = 0 \). More general starting values might be used, but must be chosen such that the estimate for the energy norm of the solution stays positive (see the above mentioned paper for details). More...

#include <cgTerminationCriteria.hh>

Detailed Description

template<class R>
class Kaskade::StrakosTichyPTerminationCriterion< R >

Relative error termination criterion based on the norm induced by the preconditioner, according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients. Requires that IterateType::CG starts at \( x = 0 \). More general starting values might be used, but must be chosen such that the estimate for the energy norm of the solution stays positive (see the above mentioned paper for details).

Definition at line 199 of file cgTerminationCriteria.hh.

Inheritance diagram for Kaskade::StrakosTichyPTerminationCriterion< R >:
Kaskade::PCGTerminationCriterion< R >

Public Types

typedef R Real
 

Public Member Functions

 StrakosTichyPTerminationCriterion (Real tol_, int maxit_, double eps_=1e-12)
 constructor More...
 
 StrakosTichyPTerminationCriterion (Real tol_, Real minTol_, int maxit_, double eps_=1e-12)
 constructor More...
 
virtual void clear ()
 re-initializes the termination criterion for a new IterateType::CG run More...
 
virtual void setTolerance (Real tol_)
 set requested relative tolerance More...
 
virtual void setLookAhead (int d_)
 set requested lookahead value More...
 
virtual void addStepQuantities (Real stepLength, Real qAq, Real qPq, Real rPINVr)
 addStepQuantities supplies algorithmic quantities to the termination criterion More...
 
virtual int getMaxIterationSteps ()
 get the maximum number of allowed iteration steps More...
 
virtual operator bool ()
 termination decision More...
 
Real relativeError ()
 returns the estimated absolute energy error More...
 
bool minimalDecreaseAchieved ()
 
virtual PCGTerminationCriterion< R > & tolerance (Real tol)=0
 set requested tolerance More...
 
virtual void step (Real gamma2)=0
 supplies energy of step to the termination criterion More...
 
virtual void residual (Real sigma)=0
 supplies the preconditioned residual to the termination criterion More...
 
virtual operator bool () const =0
 termination decision More...
 

Member Typedef Documentation

◆ Real

template<class R >
typedef R Kaskade::StrakosTichyPTerminationCriterion< R >::Real

Definition at line 201 of file cgTerminationCriteria.hh.

Constructor & Destructor Documentation

◆ StrakosTichyPTerminationCriterion() [1/2]

template<class R >
Kaskade::StrakosTichyPTerminationCriterion< R >::StrakosTichyPTerminationCriterion ( Real  tol_,
int  maxit_,
double  eps_ = 1e-12 
)
inline

constructor

The pcg iteration is terminated as soon as either the estimated error satisfies \( [\epsilon] \le \mathrm{tol} \) or the number of iterations exceeds the limit maxit. Note that the estimate of the relative error requires a look ahead parameter L. Thus, if \(\mathrm{maxit}\ge\mathrm{L}\), then the error is first estimated in the (L+1)-th iteration.

Parameters
tolthe relative error tolerance for termination
maxitthe maximum number of iterations
epsmaximal attainable accuracy

Definition at line 214 of file cgTerminationCriteria.hh.

◆ StrakosTichyPTerminationCriterion() [2/2]

template<class R >
Kaskade::StrakosTichyPTerminationCriterion< R >::StrakosTichyPTerminationCriterion ( Real  tol_,
Real  minTol_,
int  maxit_,
double  eps_ = 1e-12 
)
inline

constructor

The pcg iteration is terminated as soon as either the estimated error satisfies \( [\epsilon] \le \mathrm{tol} \) or the number of iterations exceeds the limit maxit. Note that the estimate of the relative error requires a look ahead parameter L. Thus, if \(\mathrm{maxit}\ge\mathrm{L}\), then the error is first estimated in the (L+1)-th iteration.

Parameters
tolthe relative error tolerance for termination
minTolrelative error tolerance to admit truncation in the hybrid cg implementation
maxitthe maximum number of iterations
epsmaximal attainable accuracy

Definition at line 230 of file cgTerminationCriteria.hh.

Member Function Documentation

◆ addStepQuantities()

template<class R >
virtual void Kaskade::StrakosTichyPTerminationCriterion< R >::addStepQuantities ( Real  stepLength,
Real  qAq,
Real  qPq,
Real  rPINVr 
)
inlinevirtual

addStepQuantities supplies algorithmic quantities to the termination criterion

Parameters
stepLengthscaling for the conjugate search direction \(q\)
qAqsquared energy norm of the conjugate search direction \(q\) (here: unused)
qPqsquared \(P\)-norm, i. e. the norm induced by the preconditioner, of the conjugate search direction \(q\) (here: unused)
rPINVrsquared \(P^{-1}\)-norm of the residual

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 266 of file cgTerminationCriteria.hh.

◆ clear()

template<class R >
virtual void Kaskade::StrakosTichyPTerminationCriterion< R >::clear ( )
inlinevirtual

re-initializes the termination criterion for a new IterateType::CG run

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 237 of file cgTerminationCriteria.hh.

◆ getMaxIterationSteps()

template<class R >
virtual int Kaskade::StrakosTichyPTerminationCriterion< R >::getMaxIterationSteps ( )
inlinevirtual

get the maximum number of allowed iteration steps

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 276 of file cgTerminationCriteria.hh.

◆ minimalDecreaseAchieved()

template<class R >
bool Kaskade::StrakosTichyPTerminationCriterion< R >::minimalDecreaseAchieved ( )
inlinevirtual

Reimplemented from Kaskade::PCGTerminationCriterion< R >.

Definition at line 303 of file cgTerminationCriteria.hh.

◆ operator bool() [1/2]

template<class R >
virtual Kaskade::StrakosTichyPTerminationCriterion< R >::operator bool ( )
inlinevirtual

termination decision

Returns
true if the iteration has reached the required accuracy

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 284 of file cgTerminationCriteria.hh.

◆ operator bool() [2/2]

template<class R >
virtual Kaskade::PCGTerminationCriterion< R >::operator bool ( ) const
pure virtualinherited

termination decision

Returns
true if the iteration has reached the required accuracy

Implemented in Kaskade::PCGCountingTerminationCriterion< R >, and Kaskade::PCGEnergyErrorTerminationCriterion< R >.

◆ relativeError()

template<class R >
Real Kaskade::StrakosTichyPTerminationCriterion< R >::relativeError ( )
inline

◆ residual()

template<class R >
virtual void Kaskade::PCGTerminationCriterion< R >::residual ( Real  sigma)
pure virtualinherited

supplies the preconditioned residual to the termination criterion

Parameters
sigmathe preconditioned residual norm

Implemented in Kaskade::PCGEnergyErrorTerminationCriterion< R >, and Kaskade::PCGCountingTerminationCriterion< R >.

Referenced by Kaskade::Pcg< X, Xstar >::apply().

◆ setLookAhead()

template<class R >
virtual void Kaskade::StrakosTichyPTerminationCriterion< R >::setLookAhead ( int  d_)
inlinevirtual

set requested lookahead value

Parameters
lahthe requested lookahead (nonnegative)

The default value is 50.

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 257 of file cgTerminationCriteria.hh.

◆ setTolerance()

template<class R >
virtual void Kaskade::StrakosTichyPTerminationCriterion< R >::setTolerance ( Real  tol_)
inlinevirtual

set requested relative tolerance

Parameters
tolthe requested tolerance (nonnegative)

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 248 of file cgTerminationCriteria.hh.

◆ step()

template<class R >
virtual void Kaskade::PCGTerminationCriterion< R >::step ( Real  gamma2)
pure virtualinherited

supplies energy of step to the termination criterion

Parameters
gamma2the energy \( \alpha^2 q^T A q \) of the step \( \alpha q \)

Implemented in Kaskade::PCGEnergyErrorTerminationCriterion< R >, and Kaskade::PCGCountingTerminationCriterion< R >.

Referenced by Kaskade::Pcg< X, Xstar >::apply().

◆ tolerance()

template<class R >
virtual PCGTerminationCriterion< R > & Kaskade::PCGTerminationCriterion< R >::tolerance ( Real  tol)
pure virtualinherited

set requested tolerance

Parameters
tolthe requested tolerance (nonnegative)

Implemented in Kaskade::PCGEnergyErrorTerminationCriterion< R >, and Kaskade::PCGCountingTerminationCriterion< R >.

Referenced by Kaskade::Pcg< X, Xstar >::apply().


The documentation for this class was generated from the following file: