KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R > Class Template Reference

Relative energy error termination criterion according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients. More...

#include <cgTerminationCriteria.hh>

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

Public Types

typedef R Real

Public Member Functions

 StrakosTichyEnergyErrorTerminationCriterion (Real tol_, int maxit_, double eps_=1e-12)
 constructor
 StrakosTichyEnergyErrorTerminationCriterion (Real tol_, Real minTol_, int maxit_, double eps_=1e-12)
 constructor
virtual void clear ()
 re-initializes the termination criterion for a new IterateType::CG run
virtual PCGTerminationCriterion< Real > & tolerance (Real tol_)
 set requested relative tolerance
void setLookAhead (int d_)
 set requested lookahead value
virtual void step (Real gamma)
 supplies energy of step to the termination criterion
virtual int getMaxIterationSteps ()
 get the maximum number of allowed iteration steps
virtual operator bool ()
 termination decision
Real relativeError ()
 returns the estimated relative energy error
bool minimalDecreaseAchieved ()
 whether a minimal decrease has been achieved (used by hybrid CG)
virtual void stepDetail (Real alpha, Real qAq, Real qPq, Real rPINVr)
 supplies additional algorithmic quantities to the termination criterion
virtual void residual (Real sigma)
 supplies the preconditioned residual to the termination criterion

Detailed Description

template<class R>
class Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >

Relative energy error termination criterion according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients.

Starting from \( u_0 = 0 \), the energy norm of the solution is the telescoping sum of the squared CG step energies,

\[ \|x\|_A^2 = \sum_{i=0}^{\infty} \gamma_i, \qquad \gamma_i = \|u_{i+1} - u_i\|_A^2 = \alpha_i \langle q_i, A q_i\rangle, \]

and the remaining energy error of the iterate \( u_n \) is exactly the tail \( \|x - u_n\|_A^2 = \sum_{i\ge n} \gamma_i \). This tail is the quantity one would need to stop the iteration, and it is not directly available. The criterion estimates it by the energy of the most recent \( d \) steps (the lookahead, default 50): as long as CG is still making substantial progress the recent steps carry a significant share of the total energy, whereas close to convergence the steps shrink and the recent \( d \) steps contribute only a small fraction. The relative error is therefore estimated as

\[ \frac{\|x - u_n\|_A^2}{\|x\|_A^2} \approx \frac{\sum_{i=n-d}^{n-1} \gamma_i}{\sum_{j\ge 0} \gamma_j} = \frac{\text{energy of the last } d \text{ steps}}{\text{total energy}}, \]

and the iteration is stopped as soon as this quotient falls below \( \max(\mathrm{eps}, \mathrm{tol}^2) \).

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 377 of file cgTerminationCriteria.hh.

Member Typedef Documentation

◆ Real

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

Definition at line 379 of file cgTerminationCriteria.hh.

Constructor & Destructor Documentation

◆ StrakosTichyEnergyErrorTerminationCriterion() [1/2]

template<class R>
Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::StrakosTichyEnergyErrorTerminationCriterion ( 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 394 of file cgTerminationCriteria.hh.

◆ StrakosTichyEnergyErrorTerminationCriterion() [2/2]

template<class R>
Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::StrakosTichyEnergyErrorTerminationCriterion ( 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 412 of file cgTerminationCriteria.hh.

Member Function Documentation

◆ clear()

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

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

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 420 of file cgTerminationCriteria.hh.

◆ getMaxIterationSteps()

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

get the maximum number of allowed iteration steps

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 455 of file cgTerminationCriteria.hh.

◆ minimalDecreaseAchieved()

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

whether a minimal decrease has been achieved (used by hybrid CG)

Reimplemented from Kaskade::PCGTerminationCriterion< R >.

Definition at line 477 of file cgTerminationCriteria.hh.

◆ operator bool()

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

termination decision

Returns
true if the iteration has reached the required accuracy

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 463 of file cgTerminationCriteria.hh.

◆ relativeError()

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

returns the estimated relative energy error

Definition at line 471 of file cgTerminationCriteria.hh.

Referenced by minimalDecreaseAchieved(), and operator bool().

◆ residual()

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

supplies the preconditioned residual to the termination criterion

Parameters
sigmathe preconditioned residual norm

Definition at line 84 of file cgTerminationCriteria.hh.

◆ setLookAhead()

template<class R>
void Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::setLookAhead ( int d_)
inline

set requested lookahead value

Parameters
lahthe requested lookahead (nonnegative)

The default value is 50.

Definition at line 440 of file cgTerminationCriteria.hh.

◆ step()

template<class R>
virtual void Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::step ( Real gamma)
inlinevirtual

supplies energy of step to the termination criterion

Parameters
gammathe energy \( \gamma^2 = \alpha \langle q, Aq \rangle \) of the step

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 446 of file cgTerminationCriteria.hh.

◆ stepDetail()

template<class R>
virtual void Kaskade::PCGTerminationCriterion< R >::stepDetail ( Real alpha,
Real qAq,
Real qPq,
Real rPINVr )
inlinevirtualinherited

supplies additional algorithmic quantities to the termination criterion

The default implementation does nothing. Termination criteria that need more detailed information (e.g. the Strakos-Tichy \(P\)-criterion, which requires \( q^T A q \) and \( q^T P q \)) override this method.

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

Reimplemented in Kaskade::StrakosTichyPTerminationCriterion< R >.

Definition at line 78 of file cgTerminationCriteria.hh.

◆ tolerance()

template<class R>
virtual PCGTerminationCriterion< Real > & Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::tolerance ( Real tol_)
inlinevirtual

set requested relative tolerance

Parameters
tolthe requested tolerance (nonnegative)

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 431 of file cgTerminationCriteria.hh.


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