![]() |
KASKADE 7 development version
|
Relative energy error termination criterion according to Strakos, Tichy: Error estimation in preconditioned conjugate gradients. More...
#include <cgTerminationCriteria.hh>
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 | |
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.
| typedef R Kaskade::StrakosTichyEnergyErrorTerminationCriterion< R >::Real |
Definition at line 379 of file cgTerminationCriteria.hh.
|
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.
| tol | the relative error tolerance for termination |
| maxit | the maximum number of iterations |
| eps | maximal attainable accuracy |
Definition at line 394 of file cgTerminationCriteria.hh.
|
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.
| tol | the relative error tolerance for termination |
| minTol | relative error tolerance to admit truncation in the hybrid cg implementation |
| maxit | the maximum number of iterations |
| eps | maximal attainable accuracy |
Definition at line 412 of file cgTerminationCriteria.hh.
|
inlinevirtual |
re-initializes the termination criterion for a new IterateType::CG run
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 420 of file cgTerminationCriteria.hh.
|
inlinevirtual |
get the maximum number of allowed iteration steps
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 455 of file cgTerminationCriteria.hh.
|
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.
|
inlinevirtual |
termination decision
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 463 of file cgTerminationCriteria.hh.
|
inline |
returns the estimated relative energy error
Definition at line 471 of file cgTerminationCriteria.hh.
Referenced by minimalDecreaseAchieved(), and operator bool().
|
inlinevirtualinherited |
supplies the preconditioned residual to the termination criterion
| sigma | the preconditioned residual norm |
Definition at line 84 of file cgTerminationCriteria.hh.
|
inline |
set requested lookahead value
| lah | the requested lookahead (nonnegative) |
The default value is 50.
Definition at line 440 of file cgTerminationCriteria.hh.
|
inlinevirtual |
supplies energy of step to the termination criterion
| gamma | the energy \( \gamma^2 = \alpha \langle q, Aq \rangle \) of the step |
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 446 of file cgTerminationCriteria.hh.
|
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.
| alpha | scaling for the conjugate search direction \( q \) |
| qAq | squared energy norm of the conjugate search direction \( q \) |
| qPq | squared \(P\)-norm, i. e. the norm induced by the preconditioner, of the conjugate search direction \( q \) |
| rPINVr | squared \(P^{-1}\)-norm of the residual |
Reimplemented in Kaskade::StrakosTichyPTerminationCriterion< R >.
Definition at line 78 of file cgTerminationCriteria.hh.
|
inlinevirtual |
set requested relative tolerance
| tol | the requested tolerance (nonnegative) |
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 431 of file cgTerminationCriteria.hh.