Anasazi Version of the Day
Anasazi::StatusTestMaxIters< ScalarType, MV, OP > Class Template Reference

A status test for testing the number of iterations. More...

#include <AnasaziStatusTestMaxIters.hpp>

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

List of all members.

Public Member Functions

Constructors/destructors
 StatusTestMaxIters (int maxIter, bool negate=false)
 Constructor.
virtual ~StatusTestMaxIters ()
 Destructor.
Status methods
TestStatus checkStatus (Eigensolver< ScalarType, MV, OP > *solver)
 Check status as defined by test.
TestStatus getStatus () const
 Return the result of the most recent checkStatus call.
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 setMaxIters (int maxIters)
 Set the maximum number of iterations.
int getMaxIters ()
 Get the maximum number of iterations.
void setNegate (bool negate)
 Set the negation policy for the status test.
bool getNegate () const
 Get the negation policy for the status test.
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::StatusTestMaxIters< ScalarType, MV, OP >

A status test for testing the number of iterations.

Anasazi::StatusTestMaxIters will test true when an eigensolver has reached some number of iterations. Specifically,

                     { Passed,  if solver->getNumIters() >= maxIter
    status(solver) = {
                     { Failed,  if solver->getNumIters()  < maxIter
    

where maxIter is the parameter given to the status tester.

This status test also supports negation, so that it negates the need for a StatusTestMinIters status tester. In this way, all tests on the range of iterations can be constructed through the appropriate use of StatusTestMaxIters and StatusTestCombo.

Definition at line 64 of file AnasaziStatusTestMaxIters.hpp.


Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::StatusTestMaxIters ( int  maxIter,
bool  negate = false 
) [inline]

Constructor.

Definition at line 71 of file AnasaziStatusTestMaxIters.hpp.

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

Destructor.

Definition at line 76 of file AnasaziStatusTestMaxIters.hpp.


Member Function Documentation

template<class ScalarType , class MV , class OP >
TestStatus Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::checkStatus ( Eigensolver< ScalarType, MV, OP > *  solver) [inline, 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 85 of file AnasaziStatusTestMaxIters.hpp.

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

Return the result of the most recent checkStatus call.

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

Definition at line 95 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
std::vector<int> Anasazi::StatusTestMaxIters< 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 100 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::StatusTestMaxIters< 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 105 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::setMaxIters ( int  maxIters) [inline]

Set the maximum number of iterations.

Note:
This also resets the test status to Undefined.

Definition at line 117 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::getMaxIters ( ) [inline]

Get the maximum number of iterations.

Definition at line 123 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::setNegate ( bool  negate) [inline]

Set the negation policy for the status test.

Note:
This also reset the test status to Undefined.

Definition at line 128 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
bool Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::getNegate ( ) const [inline]

Get the negation policy for the status test.

Definition at line 134 of file AnasaziStatusTestMaxIters.hpp.

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

Informs the status test that it should reset its internal configuration to the uninitialized state.

The StatusTestMaxIters class has no internal state, so this call is equivalent to calling clearStatus(). 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 148 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestMaxIters< 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 158 of file AnasaziStatusTestMaxIters.hpp.

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

Output formatted description of stopping test to output stream.

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

Definition at line 168 of file AnasaziStatusTestMaxIters.hpp.


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