43#ifndef ANASAZI_STATUS_TEST_OUTPUT_HPP
44#define ANASAZI_STATUS_TEST_OUTPUT_HPP
71template <
class ScalarType,
class MV,
class OP>
96 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test,
99 : printer_(printer), test_(test), state_(
Undefined), stateTest_(printStates), modTest_(mod), numCalls_(0)
126 TEUCHOS_TEST_FOR_EXCEPTION(test_ == Teuchos::null,
StatusTestError,
"StatusTestOutput::checkStatus(): child pointer is null.");
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);
168 void setChild(Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test) {
174 Teuchos::RCP<StatusTest<ScalarType,MV,OP> >
getChild()
const {
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;
233 os <<
" )" << std::endl;
236 test_->print(os,indent+3);
243 Teuchos::RCP<OutputManager<ScalarType> > printer_;
244 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test_;
Anasazi header file which uses auto-configuration information to include necessary C++ headers.
Pure virtual base class which describes the basic interface to the iterative eigensolver.
Declaration and definition of Anasazi::StatusTest.
Types and exceptions used within Anasazi solvers and interfaces.
Exception thrown to signal error in a status test during Anasazi::StatusTest::checkStatus().
A special StatusTest for printing other status tests.
int howMany() const
Get the number of vectors that passed the test.
StatusTestOutput(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod=1, int printStates=Passed)
Constructor.
void setChild(Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
Set child test.
std::vector< int > whichVecs() const
Get the indices for the vectors that passed the test.
void reset()
Informs the status test that it should reset its internal configuration to the uninitialized state.
TestStatus checkStatus(Eigensolver< ScalarType, MV, OP > *solver)
std::ostream & print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
virtual ~StatusTestOutput()
Destructor.
TestStatus getStatus() const
Return the result of the most recent checkStatus call, or undefined if it has not been run.
Teuchos::RCP< StatusTest< ScalarType, MV, OP > > getChild() const
Get child test.
Common interface of stopping criteria for Anasazi's solvers.
Namespace Anasazi contains the classes, structs, enums and utilities used by the Anasazi package.
TestStatus
Enumerated type used to pass back information from a StatusTest.