Stokhos Package Browser (Single Doxygen Collection)
Version of the Day
|
#include <Belos_StatusTest_ImpResNorm_MP_Vector.hpp>
Inherits StatusTestResNorm< Sacado::MP::Vector< Storage >, MV, OP >.
Public Types | |
typedef Sacado::MP::Vector< Storage > | ScalarType |
typedef Teuchos::ScalarTraits< ScalarType >::magnitudeType | MagnitudeType |
The type of the magnitude (absolute value) of a ScalarType. More... | |
Abbreviations for method implementations | |
typedef Teuchos::ScalarTraits< ScalarType > | STS |
typedef Teuchos::ScalarTraits< MagnitudeType > | STM |
typedef MultiVecTraits< ScalarType, MV > | MVT |
Constructors and destructor. | |
StatusTestImpResNorm (MagnitudeType Tolerance, int quorum=-1, bool showMaxResNormOnly=false) | |
Constructor. More... | |
virtual | ~StatusTestImpResNorm () |
Destructor (virtual for memory safety). More... | |
Form and parameter definition methods. | |
int | defineResForm (NormType TypeOfNorm) |
Define form of the residual, its norm and optional weighting vector. More... | |
int | defineScaleForm (ScaleType TypeOfScaling, NormType TypeOfNorm, MagnitudeType ScaleValue=Teuchos::ScalarTraits< MagnitudeType >::one()) |
Define form of the scaling, its norm, its optional weighting vector, or, alternatively, define an explicit value. More... | |
int | setTolerance (MagnitudeType tolerance) |
Set the value of the tolerance. More... | |
int | setQuorum (int quorum) |
int | setShowMaxResNormOnly (bool showMaxResNormOnly) |
Set whether the only maximum residual norm is displayed when the print() method is called. More... | |
Status methods | |
StatusType | checkStatus (Iteration< ScalarType, MV, OP > *iSolver) |
Check convergence status: Passed, Failed, or Undefined. More... | |
StatusType | getStatus () const |
Return the result of the most recent CheckStatus call. More... | |
Reset methods | |
void | reset () |
Resets the internal configuration to the initial state. More... | |
Print methods | |
void | print (std::ostream &os, int indent=0) const |
Output formatted description of stopping test to output stream. More... | |
void | printStatus (std::ostream &os, StatusType type) const |
Print message for each status specific to this stopping test. More... | |
Methods to access data members. | |
Teuchos::RCP< MV > | getSolution () |
Returns the current solution estimate that was computed for the most recent residual test. More... | |
int | getQuorum () const |
bool | getShowMaxResNormOnly () |
Returns whether the only maximum residual norm is displayed when the print() method is called. More... | |
std::vector< int > | convIndices () |
Returns the vector containing the indices of the residuals that passed the test. More... | |
MagnitudeType | getTolerance () const |
"Original" convergence tolerance ![]() | |
MagnitudeType | getCurrTolerance () const |
Current convergence tolerance; may be changed to prevent loss of accuracy. More... | |
const std::vector< MagnitudeType > * | getTestValue () const |
Returns the test value, ![]() | |
const std::vector< MagnitudeType > * | getResNormValue () const |
Returns the residual norm value, ![]() | |
const std::vector< MagnitudeType > * | getScaledNormValue () const |
Returns the scaled norm value, ![]() | |
bool | getLOADetected () const |
Returns a boolean indicating a loss of accuracy has been detected in computing the residual. More... | |
const std::vector< int > | getEnsembleIterations () const |
Returns number of ensemble iterations. More... | |
Misc. | |
StatusType | firstCallCheckStatusSetup (Iteration< ScalarType, MV, OP > *iSolver) |
Call to setup initial scaling vector. More... | |
Overridden from Teuchos::Describable | |
std::string | description () const |
Method to return description of the maximum iteration status test. More... | |
Private methods. | |
std::string | resFormStr () const |
Description of current residual form. More... | |
Private data members. | |
MagnitudeType | tolerance_ |
Current tolerance used to determine convergence and the default tolerance set by user. More... | |
MagnitudeType | currTolerance_ |
int | quorum_ |
Number of residuals that must pass the convergence test before Passed is returned. More... | |
bool | showMaxResNormOnly_ |
Determines if the entries for all of the residuals are shown or just the max. More... | |
NormType | resnormtype_ |
Type of norm to use on residual (OneNorm, TwoNorm, or InfNorm). More... | |
ScaleType | scaletype_ |
Type of scaling to use (Norm of RHS, Norm of Initial Residual, None or User provided) More... | |
NormType | scalenormtype_ |
Type of norm to use on the scaling (OneNorm, TwoNorm, or InfNorm) More... | |
MagnitudeType | scalevalue_ |
Scaling value. More... | |
std::vector< MagnitudeType > | scalevector_ |
Scaling vector. More... | |
std::vector< MagnitudeType > | resvector_ |
Residual norm vector. More... | |
std::vector< MagnitudeType > | testvector_ |
Test vector = resvector_ / scalevector_. More... | |
Teuchos::RCP< MV > | curSoln_ |
Current solution vector. More... | |
std::vector< int > | ind_ |
Vector containing the indices for the vectors that passed the test. More... | |
StatusType | status_ |
Status. More... | |
int | curBlksz_ |
The current blocksize of the linear system being solved. More... | |
int | curNumRHS_ |
The current number of right-hand sides being solved for. More... | |
std::vector< int > | curLSIdx_ |
The indices of the current number of right-hand sides being solved for. More... | |
int | curLSNum_ |
The current number of linear systems that have been loaded into the linear problem. More... | |
int | numrhs_ |
The total number of right-hand sides being solved for. More... | |
bool | firstcallCheckStatus_ |
Is this the first time CheckStatus is called? More... | |
bool | firstcallDefineResForm_ |
Is this the first time DefineResForm is called? More... | |
bool | firstcallDefineScaleForm_ |
Is this the first time DefineScaleForm is called? More... | |
bool | lossDetected_ |
Has a loss in accuracy been detected? More... | |
std::vector< int > | ensemble_iterations |
The number of iterations at which point each ensemble component converges. More... | |
Definition at line 110 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
typedef Sacado::MP::Vector<Storage> Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::ScalarType |
Definition at line 114 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
typedef Teuchos::ScalarTraits<ScalarType>::magnitudeType Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::MagnitudeType |
The type of the magnitude (absolute value) of a ScalarType.
Definition at line 116 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Definition at line 121 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Definition at line 122 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Definition at line 123 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::StatusTestImpResNorm | ( | MagnitudeType | Tolerance, |
int | quorum = -1 , |
||
bool | showMaxResNormOnly = false |
||
) |
Constructor.
Tolerance | [in] Convergence tolerance ![]() |
quorum | [in] The number of vectors in the problem that must pass the convergence criteria before this StatusTest passes. -1 means that all residuals must pass. |
showMaxResNormOnly | [in] Whether only the maximum residual norm (of all vectors) is displayed when the print() method is called. |
|
virtual |
Destructor (virtual for memory safety).
int Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::defineResForm | ( | NormType | TypeOfNorm | ) |
Define form of the residual, its norm and optional weighting vector.
This method defines the form of . We specify:
int Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::defineScaleForm | ( | ScaleType | TypeOfScaling, |
NormType | TypeOfNorm, | ||
MagnitudeType | ScaleValue = Teuchos::ScalarTraits< MagnitudeType >::one() |
||
) |
Define form of the scaling, its norm, its optional weighting vector, or, alternatively, define an explicit value.
This method defines the form of how the residual is scaled (if at all). It operates in two modes:
User-provided scaling value:
|
inline |
Set the value of the tolerance.
We allow the tolerance to be reset for cases where, in the process of testing the residual, we find that the initial tolerance was too tight or too lax.
Definition at line 188 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Sets the number of residuals that must pass the convergence test before Passed is returned.
quorum=-1
then all residuals must pass the convergence test before Passed is returned. Definition at line 195 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Set whether the only maximum residual norm is displayed when the print() method is called.
Definition at line 201 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
StatusType Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::checkStatus | ( | Iteration< ScalarType, MV, OP > * | iSolver | ) |
Check convergence status: Passed, Failed, or Undefined.
This method checks to see if the convergence criteria are met. Depending on how the residual test is constructed this method will return the appropriate status type.
|
inline |
Return the result of the most recent CheckStatus call.
Definition at line 220 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
void Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::reset | ( | ) |
Resets the internal configuration to the initial state.
void Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::print | ( | std::ostream & | os, |
int | indent = 0 |
||
) | const |
Output formatted description of stopping test to output stream.
void Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::printStatus | ( | std::ostream & | os, |
StatusType | type | ||
) | const |
Print message for each status specific to this stopping test.
|
inline |
Returns the current solution estimate that was computed for the most recent residual test.
Definition at line 245 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns the number of residuals that must pass the convergence test before Passed is returned.
quorum=-1
then all residuals must pass the convergence test before Passed is returned. Definition at line 249 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns whether the only maximum residual norm is displayed when the print() method is called.
Definition at line 252 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns the vector containing the indices of the residuals that passed the test.
Definition at line 255 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
"Original" convergence tolerance as set by user.
This value is the convergence tolerance as set by the user in the constructor, or by the setTolerance() method. See this class' main documentation and the documentation of getCurrTolerance() for an explanation of the difference between the "original" and "current" tolerances.
Definition at line 264 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Current convergence tolerance; may be changed to prevent loss of accuracy.
The difference between "original" tolerance (the value of getTolerance()) and "current" tolerance (the value of this method) relates to the idea of "loss of accuracy." See this class' main documentation for details. We do not allow users to set the "current" tolerance.
Definition at line 275 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns the test value, , computed in most recent call to CheckStatus.
Definition at line 280 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns the residual norm value, , computed in most recent call to CheckStatus.
Definition at line 283 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns the scaled norm value, .
Definition at line 286 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns a boolean indicating a loss of accuracy has been detected in computing the residual.
Definition at line 289 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inline |
Returns number of ensemble iterations.
Definition at line 292 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
StatusType Belos::StatusTestImpResNorm< Sacado::MP::Vector< Storage >, MV, OP >::firstCallCheckStatusSetup | ( | Iteration< ScalarType, MV, OP > * | iSolver | ) |
Call to setup initial scaling vector.
After this function is called getScaledNormValue()
can be called to get the scaling vector.
|
inline |
Method to return description of the maximum iteration status test.
Definition at line 311 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
inlineprivate |
Description of current residual form.
Definition at line 327 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Current tolerance used to determine convergence and the default tolerance set by user.
Definition at line 363 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Definition at line 363 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Number of residuals that must pass the convergence test before Passed is returned.
Definition at line 366 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Determines if the entries for all of the residuals are shown or just the max.
Definition at line 369 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Type of norm to use on residual (OneNorm, TwoNorm, or InfNorm).
Definition at line 372 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Type of scaling to use (Norm of RHS, Norm of Initial Residual, None or User provided)
Definition at line 375 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Type of norm to use on the scaling (OneNorm, TwoNorm, or InfNorm)
Definition at line 378 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Scaling value.
Definition at line 381 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Scaling vector.
Definition at line 384 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Residual norm vector.
Definition at line 387 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Test vector = resvector_ / scalevector_.
Definition at line 390 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Current solution vector.
Definition at line 393 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Vector containing the indices for the vectors that passed the test.
Definition at line 396 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Status.
Definition at line 399 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The current blocksize of the linear system being solved.
Definition at line 402 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The current number of right-hand sides being solved for.
Definition at line 405 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The indices of the current number of right-hand sides being solved for.
Definition at line 408 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The current number of linear systems that have been loaded into the linear problem.
Definition at line 411 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The total number of right-hand sides being solved for.
Definition at line 414 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Is this the first time CheckStatus is called?
Definition at line 417 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Is this the first time DefineResForm is called?
Definition at line 420 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Is this the first time DefineScaleForm is called?
Definition at line 423 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
Has a loss in accuracy been detected?
Definition at line 426 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.
|
private |
The number of iterations at which point each ensemble component converges.
Definition at line 429 of file Belos_StatusTest_ImpResNorm_MP_Vector.hpp.