Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members
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 >

Public Member Functions

Constructors/destructors
 StatusTestMaxIters (int maxIter, bool negate=false)
 Constructor. More...
 
virtual ~StatusTestMaxIters ()
 Destructor. More...
 
Status methods
TestStatus checkStatus (Eigensolver< ScalarType, MV, OP > *solver)
 Check status as defined by test. More...
 
TestStatus getStatus () const
 Return the result of the most recent checkStatus call. More...
 
std::vector< int > whichVecs () const
 Get the indices for the vectors that passed the test. More...
 
int howMany () const
 Get the number of vectors that passed the test. More...
 
Accessor methods
void setMaxIters (int maxIters)
 Set the maximum number of iterations. More...
 
int getMaxIters ()
 Get the maximum number of iterations. More...
 
void setNegate (bool negate)
 Set the negation policy for the status test. More...
 
bool getNegate () const
 Get the negation policy for the status test. More...
 
Reset methods
void reset ()
 Informs the status test that it should reset its internal configuration to the uninitialized state. More...
 
void clearStatus ()
 Clears the results of the last status test. More...
 
Print methods
std::ostream & print (std::ostream &os, int indent=0) const
 Output formatted description of stopping test to output stream. More...
 
- Public Member Functions inherited from Anasazi::StatusTest< ScalarType, MV, OP >
 StatusTest ()
 Constructor. More...
 
virtual ~StatusTest ()
 Destructor. More...
 

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 77 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 84 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
virtual Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::~StatusTestMaxIters ( )
inlinevirtual

Destructor.

Definition at line 89 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)
inlinevirtual

Check status as defined by test.

Returns
TestStatus indicating whether the test passed or failed.

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

Definition at line 98 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
TestStatus Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::getStatus ( ) const
inlinevirtual

Return the result of the most recent checkStatus call.

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

Definition at line 108 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
std::vector<int> Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::whichVecs ( ) const
inlinevirtual

Get the indices for the vectors that passed the test.

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

Definition at line 113 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::howMany ( ) const
inlinevirtual

Get the number of vectors that passed the test.

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

Definition at line 118 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 130 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 136 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 141 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 147 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::reset ( )
inlinevirtual

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 161 of file AnasaziStatusTestMaxIters.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestMaxIters< ScalarType, MV, OP >::clearStatus ( )
inlinevirtual

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 171 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
inlinevirtual

Output formatted description of stopping test to output stream.

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

Definition at line 181 of file AnasaziStatusTestMaxIters.hpp.


The documentation for this class was generated from the following file: