11 #ifndef ANASAZI_STATUS_TEST_OUTPUT_HPP
12 #define ANASAZI_STATUS_TEST_OUTPUT_HPP
39 template <
class ScalarType,
class MV,
class OP>
67 : printer_(printer), test_(test), state_(
Undefined), stateTest_(printStates), modTest_(mod), numCalls_(0)
95 state_ = test_->checkStatus(solver);
97 if (numCalls_++ % modTest_ == 0) {
98 if ( (state_ & stateTest_) == state_) {
102 else if ( printer_->isVerbosity(
Debug) ) {
118 return std::vector<int>(0);
158 if (test_ != Teuchos::null) {
168 if (test_ != Teuchos::null) {
169 test_->clearStatus();
179 std::ostream&
print(std::ostream& os,
int indent = 0)
const {
180 std::string ind(indent,
' ');
181 os << ind <<
"- StatusTestOutput: ";
184 os <<
"Passed" << std::endl;
187 os <<
"Failed" << std::endl;
190 os <<
"Undefined" << std::endl;
193 os << ind <<
" (Num calls,Mod test,State test): " <<
"(" << numCalls_ <<
", " << modTest_ <<
",";
194 if (stateTest_ == 0) {
195 os <<
" none )" << std::endl;
198 if ( (stateTest_ &
Passed) == Passed ) os <<
" Passed";
199 if ( (stateTest_ &
Failed) == Failed ) os <<
" Failed";
200 if ( (stateTest_ &
Undefined) == Undefined ) os <<
" Undefined";
201 os <<
" )" << std::endl;
204 test_->print(os,indent+3);
A special StatusTest for printing other status tests.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getChild() const
Get child test.
Exception thrown to signal error in a status test during Anasazi::StatusTest::checkStatus().
void reset()
Informs the status test that it should reset its internal configuration to the uninitialized state...
TestStatus
Enumerated type used to pass back information from a StatusTest.
Pure virtual base class which describes the basic interface to the iterative eigensolver.
std::vector< int > whichVecs() const
Get the indices for the vectors that passed the test.
void setChild(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
Set child test.
Output managers remove the need for the eigensolver to know any information about the required output...
TestStatus getStatus() const
Return the result of the most recent checkStatus call, or undefined if it has not been run...
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
int howMany() const
Get the number of vectors that passed the test.
Types and exceptions used within Anasazi solvers and interfaces.
std::ostream & print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
TestStatus checkStatus(Eigensolver< ScalarType, MV, OP > *solver)
StatusTestOutput(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod=1, int printStates=Passed)
Constructor.
Common interface of stopping criteria for Anasazi's solvers.
The Eigensolver is a templated virtual base class that defines the basic interface that any eigensolv...
virtual ~StatusTestOutput()
Destructor.
Declaration and definition of Anasazi::StatusTest.