Anasazi Version of the Day
Public Types
Anasazi::StatusTestResNorm< ScalarType, MV, OP > Class Template Reference

A status test for testing the norm of the eigenvectors residuals. More...

#include <AnasaziStatusTestResNorm.hpp>

Inheritance diagram for Anasazi::StatusTestResNorm< ScalarType, MV, OP >:
Anasazi::StatusTest< ScalarType, MV, OP >

List of all members.

Public Types

enum  ResType

Public Member Functions

Constructors/destructors
 StatusTestResNorm (typename Teuchos::ScalarTraits< ScalarType >::magnitudeType tol, int quorum=-1, ResType whichNorm=RES_ORTH, bool scaled=true, bool throwExceptionOnNaN=true)
 Constructor.
virtual ~StatusTestResNorm ()
 Destructor.
Status methods
TestStatus checkStatus (Eigensolver< ScalarType, MV, OP > *solver)
TestStatus getStatus () const
 Return the result of the most recent checkStatus call, or undefined if it has not been run.
std::vector< int > whichVecs () const
 Get the indices for the vectors that passed the test.
int howMany () const
 Get the number of vectors that passed the test.
Accessor methods
void setQuorum (int quorum)
 Set quorum.
int getQuorum () const
 Get quorum.
void setTolerance (typename Teuchos::ScalarTraits< ScalarType >::magnitudeType tol)
 Set tolerance. This also resets the test status to Undefined.
Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
getTolerance ()
 Get tolerance.
void setWhichNorm (ResType whichNorm)
 Set the residual norm to be used by the status test.
ResType getWhichNorm ()
 Return the residual norm used by the status test.
void setScale (bool relscale)
 Instruct test to scale norms by eigenvalue estimates (relative scale). This also resets the test status to Undefined.
bool getScale ()
 Returns true if the test scales the norms by the eigenvalue estimates (relative scale).
Reset methods
void reset ()
 Informs the status test that it should reset its internal configuration to the uninitialized state.
void clearStatus ()
 Clears the results of the last status test.
Print methods
std::ostream & print (std::ostream &os, int indent=0) const
 Output formatted description of stopping test to output stream.

Detailed Description

template<class ScalarType, class MV, class OP>
class Anasazi::StatusTestResNorm< ScalarType, MV, OP >

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:

Definition at line 77 of file AnasaziStatusTestResNorm.hpp.


Member Enumeration Documentation

template<class ScalarType , class MV , class OP >
enum Anasazi::StatusTestResNorm::ResType

Enumerated type used to specify which residual norm used by this status test.

Definition at line 86 of file AnasaziStatusTestResNorm.hpp.


Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Anasazi::StatusTestResNorm< ScalarType, MV, OP >::StatusTestResNorm ( typename Teuchos::ScalarTraits< ScalarType >::magnitudeType  tol,
int  quorum = -1,
ResType  whichNorm = RES_ORTH,
bool  scaled = true,
bool  throwExceptionOnNaN = true 
)

Constructor.

Definition at line 224 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
virtual Anasazi::StatusTestResNorm< ScalarType, MV, OP >::~StatusTestResNorm ( ) [inline, virtual]

Destructor.

Definition at line 99 of file AnasaziStatusTestResNorm.hpp.


Member Function Documentation

template<class ScalarType , class MV , class OP >
TestStatus Anasazi::StatusTestResNorm< ScalarType, MV, OP >::checkStatus ( Eigensolver< ScalarType, MV, OP > *  solver) [virtual]

Check status as defined by test.

Returns:
TestStatus indicating whether the test passed or failed.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 229 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
TestStatus Anasazi::StatusTestResNorm< ScalarType, MV, OP >::getStatus ( ) const [inline, virtual]

Return the result of the most recent checkStatus call, or undefined if it has not been run.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 111 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
std::vector<int> Anasazi::StatusTestResNorm< ScalarType, MV, OP >::whichVecs ( ) const [inline, virtual]

Get the indices for the vectors that passed the test.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 114 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::StatusTestResNorm< ScalarType, MV, OP >::howMany ( ) const [inline, virtual]

Get the number of vectors that passed the test.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 119 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::setQuorum ( int  quorum) [inline]

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.

Definition at line 133 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::StatusTestResNorm< ScalarType, MV, OP >::getQuorum ( ) const [inline]

Get quorum.

Definition at line 140 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::setTolerance ( typename Teuchos::ScalarTraits< ScalarType >::magnitudeType  tol) [inline]

Set tolerance. This also resets the test status to Undefined.

Definition at line 147 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::ScalarTraits<ScalarType>::magnitudeType Anasazi::StatusTestResNorm< ScalarType, MV, OP >::getTolerance ( ) [inline]

Get tolerance.

Definition at line 153 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::setWhichNorm ( ResType  whichNorm) [inline]

Set the residual norm to be used by the status test.

This also resets the test status to Undefined.

Definition at line 159 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
ResType Anasazi::StatusTestResNorm< ScalarType, MV, OP >::getWhichNorm ( ) [inline]

Return the residual norm used by the status test.

Definition at line 165 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::setScale ( bool  relscale) [inline]

Instruct test to scale norms by eigenvalue estimates (relative scale). This also resets the test status to Undefined.

Definition at line 170 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
bool Anasazi::StatusTestResNorm< ScalarType, MV, OP >::getScale ( ) [inline]

Returns true if the test scales the norms by the eigenvalue estimates (relative scale).

Definition at line 176 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::reset ( ) [inline, virtual]

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.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 187 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestResNorm< ScalarType, MV, OP >::clearStatus ( ) [inline, virtual]

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.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 198 of file AnasaziStatusTestResNorm.hpp.

template<class ScalarType , class MV , class OP >
std::ostream & Anasazi::StatusTestResNorm< ScalarType, MV, OP >::print ( std::ostream &  os,
int  indent = 0 
) const [virtual]

Output formatted description of stopping test to output stream.

Implements Anasazi::StatusTest< ScalarType, MV, OP >.

Definition at line 286 of file AnasaziStatusTestResNorm.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends