Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | List of all members
Anasazi::StatusTestCombo< ScalarType, MV, OP > Class Template Reference

Status test for forming logical combinations of other status tests. More...

#include <AnasaziStatusTestCombo.hpp>

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

Public Types

enum  ComboType { OR, AND, SEQOR, SEQAND }
 Enumerated type to list the types of StatusTestCombo combo types. More...
 

Public Member Functions

Constructors/destructors
 StatusTestCombo ()
 Default constructor has no tests and initializes to StatusTestCombo::ComboType StatusTestCombo::OR. More...
 
 StatusTestCombo (ComboType type, Teuchos::Array< Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > tests)
 Constructor specifying the StatusTestCombo::ComboType and the tests. More...
 
virtual ~StatusTestCombo ()
 Destructor. More...
 
Status methods
TestStatus checkStatus (Eigensolver< ScalarType, MV, OP > *solver)
 
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 setComboType (ComboType type)
 Set the maximum number of iterations. This also resets the test status to Undefined. More...
 
ComboType getComboType () const
 Get the maximum number of iterations. More...
 
void setTests (Teuchos::Array< Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > tests)
 Set the tests This also resets the test status to Undefined. More...
 
Teuchos::Array< Teuchos::RCP
< StatusTest< ScalarType, MV,
OP > > > 
getTests () const
 Get the tests. More...
 
void addTest (Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
 Add a test to the combination. More...
 
void removeTest (const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &test)
 Removes a test from the combination, if it exists in the tester. 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::StatusTestCombo< ScalarType, MV, OP >

Status test for forming logical combinations of other status tests.

Test types include StatusTestCombo::OR, StatusTestCombo::AND, StatusTestCombo::SEQOR and StatusTestCombo::SEQAND. The StatusTestCombo::OR and StatusTestCombo::AND tests evaluate all of the tests, in the order they were passed to the StatusTestCombo. The StatusTestCombo::SEQOR and StatusTestCombo::SEQAND run only the tests necessary to determine the final outcome, short-circuiting on the first test that conclusively decides the outcome. More formally, StatusTestCombo::SEQAND runs the tests in the order they were given to the StatusTestCombo class and stops after the first test that evaluates Failed. StatusTestCombo::SEQOR run the tests in the order they were given to the StatusTestCombo class and stops after the first test that evaluates Passed.

Definition at line 75 of file AnasaziStatusTestCombo.hpp.

Member Enumeration Documentation

template<class ScalarType , class MV , class OP >
enum Anasazi::StatusTestCombo::ComboType

Enumerated type to list the types of StatusTestCombo combo types.

Enumerator
OR 

Logical OR which evaluates all tests

AND 

Logical AND which evaluates all tests

SEQOR 

Short-circuited logical OR

SEQAND 

Short-circuited logical AND

Definition at line 83 of file AnasaziStatusTestCombo.hpp.

Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Anasazi::StatusTestCombo< ScalarType, MV, OP >::StatusTestCombo ( )
inline

Default constructor has no tests and initializes to StatusTestCombo::ComboType StatusTestCombo::OR.

Constructor

Definition at line 106 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
Anasazi::StatusTestCombo< ScalarType, MV, OP >::StatusTestCombo ( ComboType  type,
Teuchos::Array< Teuchos::RCP< StatusTest< ScalarType, MV, OP > > >  tests 
)
inline

Constructor specifying the StatusTestCombo::ComboType and the tests.

Constructor

Definition at line 110 of file AnasaziStatusTestCombo.hpp.

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

Destructor.

Definition at line 118 of file AnasaziStatusTestCombo.hpp.

Member Function Documentation

template<class ScalarType , class MV , class OP >
TestStatus Anasazi::StatusTestCombo< 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 250 of file AnasaziStatusTestCombo.hpp.

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

Return the result of the most recent checkStatus call.

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

Definition at line 130 of file AnasaziStatusTestCombo.hpp.

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

Get the indices for the vectors that passed the test.

This returns some combination of the passing vectors from the tests comprising the StatusTestCombo. The nature of the combination depends on the StatusTestCombo::ComboType:

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

Definition at line 142 of file AnasaziStatusTestCombo.hpp.

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

Get the number of vectors that passed the test.

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

Definition at line 149 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::setComboType ( ComboType  type)
inline

Set the maximum number of iterations. This also resets the test status to Undefined.

Definition at line 161 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
ComboType Anasazi::StatusTestCombo< ScalarType, MV, OP >::getComboType ( ) const
inline

Get the maximum number of iterations.

Definition at line 167 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::setTests ( Teuchos::Array< Teuchos::RCP< StatusTest< ScalarType, MV, OP > > >  tests)
inline

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

Definition at line 172 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::Array<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > Anasazi::StatusTestCombo< ScalarType, MV, OP >::getTests ( ) const
inline

Get the tests.

Definition at line 178 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::addTest ( Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test)
inline

Add a test to the combination.

This also resets the test status to Undefined.

Definition at line 184 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::removeTest ( const Teuchos::RCP< StatusTest< ScalarType, MV, OP > > &  test)

Removes a test from the combination, if it exists in the tester.

This also resets the test status to Undefined, if a test was removed.

Definition at line 238 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::reset ( )
virtual

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

The StatusTestCombo class has no internal state, but children classes might, so this method will call reset() on all child status tests. It also resets the test status to Undefined.

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

Definition at line 271 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::StatusTestCombo< ScalarType, MV, OP >::clearStatus ( )
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 StatusTestCombo::SEQOR and StatusTestCombo::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 281 of file AnasaziStatusTestCombo.hpp.

template<class ScalarType , class MV , class OP >
std::ostream & Anasazi::StatusTestCombo< 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 291 of file AnasaziStatusTestCombo.hpp.


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