#include <NOX_StatusTest_FiniteValue.H>
Public Types | |
enum | VectorType { FVector, SolutionVector } |
Type of vector to run the finite value check on. More... | |
Public Member Functions | |
FiniteValue (VectorType v=FVector, NOX::Abstract::Vector::NormType n=NOX::Abstract::Vector::TwoNorm) | |
Constructor. Specify which vector to check and with what norm to use. | |
virtual | ~FiniteValue () |
Destructor. | |
virtual NOX::StatusTest::StatusType | checkStatus (const NOX::Solver::Generic &problem, NOX::StatusTest::CheckType checkType) |
Test the stopping criterion | |
virtual NOX::StatusTest::StatusType | getStatus () const |
Return the result of the most recent checkStatus call. | |
virtual ostream & | print (ostream &stream, int indent=0) const |
Output formatted description of stopping test to output stream. | |
virtual int | finiteNumberTest (double x) const |
The finite number test algorithm. | |
Protected Member Functions | |
bool | NOX_isnan (double x) const |
NOX's implementation of isnan(). | |
bool | NOX_isinf (double x) const |
NOX's implementation of isinf(). | |
Private Attributes | |
VectorType | vectorType |
Determines what type of vector (F or solution) to use in computing the norm. | |
string | vectorTypeLabel |
Vector label used for printing. | |
NOX::Abstract::Vector::NormType | normType |
Determines what norm type to use (NOX does not have access to vector entries so it must use the norm to evaluate NaN/Inf problems). | |
string | normTypeLabel |
Norm type label for printing. | |
NOX::StatusTest::StatusType | status |
Current Status. | |
int | result |
Return code from the call: result = fpclassify(double normValue). | |
double | normValue |
Computed norm value. |
This test returns NOX::StatusTest::Failed if the norm of a vector is calssified as a NaN or Inf. Otherwise, it returns NOX::StatusTest::Unconverged. The user can specify whether to use the F vector or the solution vector from the current solution group for the check. NOX does not have access to vector entries so the number used in the NaN/Inf check is based on the norm of a vector.
Definition at line 66 of file NOX_StatusTest_FiniteValue.H.
Type of vector to run the finite value check on.
Definition at line 71 of file NOX_StatusTest_FiniteValue.H.
NOX::StatusTest::FiniteValue::FiniteValue | ( | VectorType | v = FVector , |
|
NOX::Abstract::Vector::NormType | n = NOX::Abstract::Vector::TwoNorm | |||
) |
Constructor. Specify which vector to check and with what norm to use.
Definition at line 48 of file NOX_StatusTest_FiniteValue.C.
References normType, normTypeLabel, NOX::Abstract::Vector::OneNorm, NOX::Abstract::Vector::TwoNorm, NOX::StatusTest::Unevaluated, vectorType, and vectorTypeLabel.
NOX::StatusTest::FiniteValue::~FiniteValue | ( | ) | [virtual] |
NOX::StatusTest::StatusType NOX::StatusTest::FiniteValue::checkStatus | ( | const NOX::Solver::Generic & | problem, | |
NOX::StatusTest::CheckType | checkType | |||
) | [virtual] |
Test the stopping criterion
The test can (and should, if possible) be skipped if checkType is NOX::StatusType::None. If the test is skipped, then the status should be set to NOX::StatusTest::Unevaluated.
Implements NOX::StatusTest::Generic.
Definition at line 78 of file NOX_StatusTest_FiniteValue.C.
References NOX::StatusTest::Complete, NOX::StatusTest::Failed, finiteNumberTest(), NOX::Abstract::Group::getF(), NOX::Abstract::Group::getNormF(), NOX::Solver::Generic::getSolutionGroup(), NOX::Abstract::Group::getX(), NOX::StatusTest::Minimal, NOX::StatusTest::None, NOX::Abstract::Vector::norm(), normType, normValue, result, status, NOX::Abstract::Vector::TwoNorm, NOX::StatusTest::Unconverged, NOX::StatusTest::Unevaluated, and vectorType.
NOX::StatusTest::StatusType NOX::StatusTest::FiniteValue::getStatus | ( | ) | const [virtual] |
Return the result of the most recent checkStatus call.
Implements NOX::StatusTest::Generic.
Definition at line 116 of file NOX_StatusTest_FiniteValue.C.
References status.
ostream & NOX::StatusTest::FiniteValue::print | ( | ostream & | stream, | |
int | indent = 0 | |||
) | const [virtual] |
Output formatted description of stopping test to output stream.
Implements NOX::StatusTest::Generic.
Definition at line 121 of file NOX_StatusTest_FiniteValue.C.
References normTypeLabel, result, status, and vectorTypeLabel.
int NOX::StatusTest::FiniteValue::finiteNumberTest | ( | double | x | ) | const [virtual] |
The finite number test algorithm.
Autoconf will test to see if the compiler implements the isnan() and isinf() functions in the cmath or math.h headers. If so, we will use these. If not, we supply a default implementation. The default implementation is only guaranteed to work if the code is IEEE 748/754 compliant. The checks for isnan and isinf are separate because compilers like the old sgi platforms support one but not the other. See bug 2019 for more details.
This method is public so that other objects (solvers, line searches, and directions) can use this test on their own values.
Return Values:
Definition at line 147 of file NOX_StatusTest_FiniteValue.C.
References NOX_isinf(), and NOX_isnan().
Referenced by NOX::LineSearch::Polynomial::checkConvergence(), checkStatus(), and NOX::LineSearch::Backtrack::compute().
bool NOX::StatusTest::FiniteValue::NOX_isnan | ( | double | x | ) | const [protected] |
NOX's implementation of isnan().
Definition at line 158 of file NOX_StatusTest_FiniteValue.C.
Referenced by finiteNumberTest(), and NOX_isinf().
bool NOX::StatusTest::FiniteValue::NOX_isinf | ( | double | x | ) | const [protected] |
NOX's implementation of isinf().
Definition at line 170 of file NOX_StatusTest_FiniteValue.C.
References NOX_isnan().
Referenced by finiteNumberTest().
Determines what type of vector (F or solution) to use in computing the norm.
Definition at line 120 of file NOX_StatusTest_FiniteValue.H.
Referenced by checkStatus(), and FiniteValue().
string NOX::StatusTest::FiniteValue::vectorTypeLabel [private] |
Vector label used for printing.
Definition at line 123 of file NOX_StatusTest_FiniteValue.H.
Referenced by FiniteValue(), and print().
Determines what norm type to use (NOX does not have access to vector entries so it must use the norm to evaluate NaN/Inf problems).
Definition at line 126 of file NOX_StatusTest_FiniteValue.H.
Referenced by checkStatus(), and FiniteValue().
string NOX::StatusTest::FiniteValue::normTypeLabel [private] |
Norm type label for printing.
Definition at line 129 of file NOX_StatusTest_FiniteValue.H.
Referenced by FiniteValue(), and print().
Current Status.
Definition at line 132 of file NOX_StatusTest_FiniteValue.H.
Referenced by checkStatus(), getStatus(), and print().
int NOX::StatusTest::FiniteValue::result [private] |
Return code from the call: result = fpclassify(double normValue).
Definition at line 135 of file NOX_StatusTest_FiniteValue.H.
Referenced by checkStatus(), and print().
double NOX::StatusTest::FiniteValue::normValue [private] |
Computed norm value.
Definition at line 138 of file NOX_StatusTest_FiniteValue.H.
Referenced by checkStatus().