Class xlifepp::StatusTestResNorm#
-
template<class ScalarType, class MV, class OP>
class StatusTestResNorm : public xlifepp::StatusTest<ScalarType, MV, OP>#
-
Inheritence diagram for xlifepp::StatusTestResNorm:
Collaboration diagram for xlifepp::StatusTestResNorm:
A status test for testing the norm of the eigenvectors residuals.
StatusTestResNorm was designed to be used as a test for convergence. The tester compares the norms of the residual vectors against a user specified tolerance.
In addition to specifying the tolerance, the user may specify:
the norm to be used: 2-norm or OrthoManager::norm() or EigenSolver::getRitzRes2Norms()
the scale: absolute or relative to magnitude of Ritz value
the quorum: the number of vectors required for the test to evaluate as _passed.
Print methods
-
virtual std::ostream &print(std::ostream &os, int indent = 0) const#
-
Output formatted description of stopping test to output stream.
-
inline virtual PrintStream &print(PrintStream &os, int indent = 0) const#
-
Output formatted description of stopping test to output stream.
Constructors/destructors
-
StatusTestResNorm(typename NumTraits<ScalarType>::RealScalar tol, int quorum = -1, ResType whichNorm = _resOrth, bool scaled = true, bool throwExceptionOnNaN = true)#
-
Constructor.
-
inline virtual ~StatusTestResNorm()#
-
Destructor.
Status methods
-
virtual TestStatus checkStatus(EigenSolver<ScalarType, MV, OP> *solver)#
-
Check status as defined by test.
- Returns:
-
TestStatus indicating whether the test passed or failed.
-
inline virtual TestStatus getStatus() const#
-
Return the result of the most recent checkStatus call, or undefined if it has not been run.
-
inline virtual std::vector<int> whichVecs() const#
-
Get the indices for the vectors that passed the test.
-
inline virtual int howMany() const#
-
Get the number of vectors that passed the test.
Accessor methods
-
inline void setQuorum(int quorum)#
-
Set quorum.
Setting quorum to -1 signifies that all residuals from the solver must meet the tolerance. This also resets the test status to _undefined.
-
inline int getQuorum() const#
-
Get quorum.
-
inline void setTolerance(typename NumTraits<ScalarType>::RealScalar tol)#
-
Set tolerance.
This also resets the test status to _undefined.
-
inline NumTraits<ScalarType>::RealScalar getTolerance()#
-
Get tolerance.
-
inline void setWhichNorm(ResType whichNorm)#
-
Set the residual norm to be used by the status test.
This also resets the test status to _undefined.
-
inline void setScale(bool relscale)#
-
Instruct test to scale norms by eigenvalue estimates (relative scale).
This also resets the test status to _undefined.
-
inline bool getScale()#
-
Returns true if the test scales the norms by the eigenvalue estimates (relative scale).
Reset methods
-
inline virtual void reset()#
-
Informs the status test that it should reset its internal configuration to the uninitialized state.
This is necessary for the case when the status test is being reused by another solver or for another eigenvalue problem. The status test may have information that pertains to a particular problem or solver state. The internal information will be reset back to the uninitialized state. The user specified information that the convergence test uses will remain.
-
inline virtual void clearStatus()#
-
Clears the results of the last status test.
This should be distinguished from the reset() method, as it only clears the cached result from the last status test, so that a call to getStatus() will return _undefined. This is necessary for the SEQOR and SEQAND tests in the StatusTestCombo class, which may short circuit and not evaluate all of the StatusTests contained in them.