30 #ifndef ANASAZI_STATUS_TEST_OUTPUT_HPP 31 #define ANASAZI_STATUS_TEST_OUTPUT_HPP 58 template <
class ScalarType,
class MV,
class OP>
86 : printer_(printer), test_(test), state_(
Undefined), stateTest_(printStates), modTest_(mod), numCalls_(0)
113 TEUCHOS_TEST_FOR_EXCEPTION(test_ == Teuchos::null,
StatusTestError,
"StatusTestOutput::checkStatus(): child pointer is null.");
114 state_ = test_->checkStatus(solver);
116 if (numCalls_++ % modTest_ == 0) {
117 if ( (state_ & stateTest_) == state_) {
121 else if ( printer_->isVerbosity(
Debug) ) {
137 return std::vector<int>(0);
161 Teuchos::RCP<StatusTest<ScalarType,MV,OP> >
getChild()
const {
177 if (test_ != Teuchos::null) {
187 if (test_ != Teuchos::null) {
188 test_->clearStatus();
198 std::ostream&
print(std::ostream& os,
int indent = 0)
const {
199 std::string ind(indent,
' ');
200 os << ind <<
"- StatusTestOutput: ";
203 os <<
"Passed" << std::endl;
206 os <<
"Failed" << std::endl;
209 os <<
"Undefined" << std::endl;
212 os << ind <<
" (Num calls,Mod test,State test): " <<
"(" << numCalls_ <<
", " << modTest_ <<
",";
213 if (stateTest_ == 0) {
214 os <<
" none )" << std::endl;
217 if ( (stateTest_ &
Passed) == Passed ) os <<
" Passed";
218 if ( (stateTest_ &
Failed) == Failed ) os <<
" Failed";
219 if ( (stateTest_ &
Undefined) == Undefined ) os <<
" Undefined";
220 os <<
" )" << std::endl;
223 test_->print(os,indent+3);
230 Teuchos::RCP<OutputManager<ScalarType> > printer_;
231 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test_;
A special StatusTest for printing other status tests.
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.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package...
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.