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

Relative error termination criterion based on the norm induced by the preconditioner, according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients. More...

#include <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
 StrakosTichyPTerminationCriterion (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 void stepDetail (Real alpha, Real qAq, Real qPq, Real rPINVr)
 supplies additional quantities for the \(P\)-criterion
virtual int getMaxIterationSteps ()
 get the maximum number of allowed iteration steps
virtual operator bool ()
 termination decision
Real relativeError ()
 returns the estimated relative error
bool minimalDecreaseAchieved ()
 whether a minimal decrease has been achieved (used by hybrid CG)
virtual void residual (Real sigma)
 supplies the preconditioned residual to the termination criterion

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.

This criterion measures the error in the norm induced by the preconditioner \( P \) (i.e. in the metric in which the preconditioned system \( P^{-1} A x = P^{-1} b \) is solved), instead of the energy norm used by the StrakosTichyEnergyErrorTerminationCriterion. The two norms are related along each search direction \( q_i \) by the Rayleigh quotient

\[ \sigma_i = \frac{\langle q_i, P q_i\rangle}{\langle q_i, A q_i\rangle}, \]

i.e. the ratio of the \(P\)-norm to the \(A\)-norm of the direction. Using the CG step energies \( \gamma_i = \alpha_i \langle q_i, A q_i\rangle = \|u_{i+1}-u_i\|_A^2 \) and the identity \( \gamma_i + 2\|x - u_{i+1}\|_A^2 = \|x-u_i\|_A^2 + \|x-u_{i+1}\|_A^2 \), the \(P\)-weighted error is assembled from the recent steps. The relative error estimate implemented here is

\[ \tau = \sum_{i=j}^{j+d-1} \sigma_i \Big( \gamma_i + 2 \sum_{k>i} \gamma_k \Big), \qquad j = n - 2d, \]

i.e. over the last \( d \) steps (with a history of \( 2d \) steps, \( d = 50 \) by default), weighting the remaining energy tails \( 2\sum_{k>i}\gamma_k \) by how strongly the preconditioner metric differs from the energy metric along that direction. The iteration stops as soon as \( \tau < \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 520 of file cgTerminationCriteria.hh.

Member Typedef Documentation

◆ Real

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

Definition at line 522 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 537 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 555 of file cgTerminationCriteria.hh.

Member Function Documentation

◆ 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 562 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 610 of file cgTerminationCriteria.hh.

◆ minimalDecreaseAchieved()

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

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

Reimplemented from Kaskade::PCGTerminationCriterion< R >.

Definition at line 638 of file cgTerminationCriteria.hh.

◆ operator bool()

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

◆ relativeError()

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

returns the estimated relative error

Definition at line 626 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::StrakosTichyPTerminationCriterion< R >::setLookAhead ( int d_)
inline

set requested lookahead value

Parameters
lahthe requested lookahead (nonnegative)

The default value is 50.

Definition at line 583 of file cgTerminationCriteria.hh.

◆ step()

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

supplies energy of step to the termination criterion

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

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 589 of file cgTerminationCriteria.hh.

◆ stepDetail()

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

supplies additional quantities for the \(P\)-criterion

Parameters
alphascaling for the conjugate search direction \( q \)
qAqsquared energy norm of the conjugate search direction \( q \)
qPqsquared \(P\)-norm of the conjugate search direction \( q \)
rPINVrsquared \(P^{-1}\)-norm of the residual

Reimplemented from Kaskade::PCGTerminationCriterion< R >.

Definition at line 602 of file cgTerminationCriteria.hh.

◆ tolerance()

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

set requested relative tolerance

Parameters
tolthe requested tolerance (nonnegative)

Implements Kaskade::PCGTerminationCriterion< R >.

Definition at line 574 of file cgTerminationCriteria.hh.


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