43 #ifndef ANASAZI_STATUS_TEST_OUTPUT_HPP
44 #define ANASAZI_STATUS_TEST_OUTPUT_HPP
71 template <
class ScalarType,
class MV,
class OP>
99 : printer_(printer), test_(test), state_(
Undefined), stateTest_(printStates), modTest_(mod), numCalls_(0)
127 state_ = test_->checkStatus(solver);
129 if (numCalls_++ % modTest_ == 0) {
130 if ( (state_ & stateTest_) == state_) {
134 else if ( printer_->isVerbosity(
Debug) ) {
150 return std::vector<int>(0);
190 if (test_ != Teuchos::null) {
200 if (test_ != Teuchos::null) {
201 test_->clearStatus();
211 std::ostream&
print(std::ostream& os,
int indent = 0)
const {
212 std::string ind(indent,
' ');
213 os << ind <<
"- StatusTestOutput: ";
216 os <<
"Passed" << std::endl;
219 os <<
"Failed" << std::endl;
222 os <<
"Undefined" << std::endl;
225 os << ind <<
" (Num calls,Mod test,State test): " <<
"(" << numCalls_ <<
", " << modTest_ <<
",";
226 if (stateTest_ == 0) {
227 os <<
" none )" << std::endl;
230 if ( (stateTest_ &
Passed) == Passed ) os <<
" Passed";
231 if ( (stateTest_ &
Failed) == Failed ) os <<
" Failed";
232 if ( (stateTest_ &
Undefined) == Undefined ) os <<
" Undefined";
233 os <<
" )" << std::endl;
236 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.