![]() |
KASKADE 7 development version
|
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>
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 | |
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.
| typedef R Kaskade::StrakosTichyPTerminationCriterion< R >::Real |
Definition at line 522 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 537 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 555 of file cgTerminationCriteria.hh.
|
inlinevirtual |
re-initializes the termination criterion for a new IterateType::CG run
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 562 of file cgTerminationCriteria.hh.
|
inlinevirtual |
get the maximum number of allowed iteration steps
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 610 of file cgTerminationCriteria.hh.
|
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.
|
inlinevirtual |
termination decision
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 618 of file cgTerminationCriteria.hh.
|
inline |
returns the estimated relative error
Definition at line 626 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 583 of file cgTerminationCriteria.hh.
|
inlinevirtual |
supplies energy of step to the termination criterion
| gamma | the energy \( \gamma = \alpha \langle q, Aq \rangle \) of the step |
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 589 of file cgTerminationCriteria.hh.
|
inlinevirtual |
supplies additional quantities for the \(P\)-criterion
| alpha | scaling for the conjugate search direction \( q \) |
| qAq | squared energy norm of the conjugate search direction \( q \) |
| qPq | squared \(P\)-norm of the conjugate search direction \( q \) |
| rPINVr | squared \(P^{-1}\)-norm of the residual |
Reimplemented from Kaskade::PCGTerminationCriterion< R >.
Definition at line 602 of file cgTerminationCriteria.hh.
|
inlinevirtual |
set requested relative tolerance
| tol | the requested tolerance (nonnegative) |
Implements Kaskade::PCGTerminationCriterion< R >.
Definition at line 574 of file cgTerminationCriteria.hh.