Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Types | Private Attributes | List of all members
Belos::StatusTestUserOutput< ScalarType, MV, OP > Class Template Reference

A special StatusTest for printing other status tests in a simple format. More...

#include <BelosStatusTestUserOutput.hpp>

Inheritance diagram for Belos::StatusTestUserOutput< ScalarType, MV, OP >:
Inheritance graph
[legend]

Private Types

typedef MultiVecTraits
< ScalarType, MV > 
MVT
 
typedef Belos::StatusTestCombo
< ScalarType, MV, OP > 
StatusTestCombo_t
 
typedef
Belos::StatusTestResNorm
< ScalarType, MV, OP > 
StatusTestResNorm_t
 
typedef
Belos::StatusTestMaxIters
< ScalarType, MV, OP > 
StatusTestMaxIters_t
 

Private Attributes

Teuchos::RCP< OutputManager
< ScalarType > > 
printer_
 
Teuchos::RCP< StatusTest
< ScalarType, MV, OP > > 
test_
 
Teuchos::RCP< std::map
< std::string, Teuchos::RCP
< StatusTest< ScalarType, MV,
OP > > > > 
taggedTests_
 
Teuchos::RCP
< StatusTestMaxIters
< ScalarType, MV, OP > > 
iterTest_
 
std::vector< Teuchos::RCP
< StatusTest< ScalarType, MV,
OP > > > 
resTestVec_
 Vector of residual status tests. More...
 
std::vector< std::string > resTestNamesVec_
 Name tags for status tests. More...
 
std::string solverDesc_
 
std::string precondDesc_
 
std::vector< int > currIdx_
 
StatusType state_
 
bool headerPrinted_
 
int stateTest_
 
int modTest_
 
int lastNumIters_
 
int comboType_
 
int blockSize_
 
int currNumRHS_
 
int currLSNum_
 
int numLSDgts_
 
int numIterDgts_
 

Constructors/destructors

 StatusTestUserOutput (const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > > taggedTests, int mod=1, int printStates=Passed)
 Constructor. More...
 
virtual ~StatusTestUserOutput ()
 Destructor. More...
 

Status methods

StatusType checkStatus (Iteration< ScalarType, MV, OP > *solver)
 
StatusType getStatus () const
 Return the result of the most recent checkStatus call, or undefined if it has not been run. More...
 

Accessor methods

void setOutputManager (const Teuchos::RCP< OutputManager< ScalarType > > &printer)
 Set the output manager. More...
 
void setOutputFrequency (int mod)
 Set how often the child test is printed. More...
 
void setChild (Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test)
 Set child test, which must be a combination of a Belos::StatusTestMaxIters AND a combination of Belos::StatusTestResNorms and user-specified tests. More...
 
Teuchos::RCP< StatusTest
< ScalarType, MV, OP > > 
getChild () const
 Get child test. More...
 
void setSolverDesc (const std::string &solverDesc)
 Set a short solver description for output clarity. More...
 
void setPrecondDesc (const std::string &precondDesc)
 Set a short preconditioner description for output clarity. More...
 

Reset methods

void reset ()
 Informs the status test that it should reset its internal configuration to the uninitialized state. More...
 
void resetNumCalls ()
 Informs the outputting status test that it should reset the number of calls to zero. More...
 

Print methods

void print (std::ostream &os, int indent=0) const
 Output formatted description of stopping test to output stream. More...
 

Additional Inherited Members

- Public Member Functions inherited from Belos::StatusTestOutput< ScalarType, MV, OP >
 StatusTestOutput ()
 Default constructor. More...
 
 StatusTestOutput (const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod=1, int printStates=Passed)
 Constructor. More...
 
virtual ~StatusTestOutput ()
 Destructor. More...
 
- Public Member Functions inherited from Belos::StatusTest< ScalarType, MV, OP >
 StatusTest ()
 Constructor. More...
 
virtual ~StatusTest ()
 Destructor. More...
 
virtual void printStatus (std::ostream &os, StatusType type) const
 Output the result of the most recent CheckStatus call. More...
 
- Public Member Functions inherited from Teuchos::Describable
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
virtual std::string description () const
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 

Detailed Description

template<class ScalarType, class MV, class OP>
class Belos::StatusTestUserOutput< ScalarType, MV, OP >

A special StatusTest for printing other status tests in a simple format.

Definition at line 38 of file BelosStatusTestUserOutput.hpp.

Member Typedef Documentation

template<class ScalarType , class MV , class OP >
typedef MultiVecTraits<ScalarType,MV> Belos::StatusTestUserOutput< ScalarType, MV, OP >::MVT
private

Definition at line 40 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestCombo<ScalarType,MV,OP> Belos::StatusTestUserOutput< ScalarType, MV, OP >::StatusTestCombo_t
private

Definition at line 41 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestResNorm<ScalarType,MV,OP> Belos::StatusTestUserOutput< ScalarType, MV, OP >::StatusTestResNorm_t
private

Definition at line 42 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestMaxIters<ScalarType,MV,OP> Belos::StatusTestUserOutput< ScalarType, MV, OP >::StatusTestMaxIters_t
private

Definition at line 43 of file BelosStatusTestUserOutput.hpp.

Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Belos::StatusTestUserOutput< ScalarType, MV, OP >::StatusTestUserOutput ( const Teuchos::RCP< OutputManager< ScalarType > > &  printer,
Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test,
Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > >  taggedTests,
int  mod = 1,
int  printStates = Passed 
)
inline

Constructor.

The StatusTestUserOutput requires an OutputManager for printing the underlying StatusTest on calls to checkStatus(), as well as an underlying StatusTest.

The last two parameters, described below, in addition to the verbosity level of the OutputManager, control when printing is called. When both the mod criterion and the printStates criterion are satisfied, the status test will be printed to the OutputManager with MsgType of StatusTestDetails.

Parameters
[in]testA reference-counted pointer to an object that combines Belos::StatusTestMaxIters and a set of Belos::StatusTestResNorm
[in]modA positive number describes how often the output should be printed. On every call to checkStatus(), an internal counter is incremented. Printing may only occur when this counter is congruent to zero modulo mod. Default: 1 (attempt to print on every call to checkStatus())
[in]printStatesA combination of StatusType values for which the output may be printed. Default: Passed (attempt to print whenever checkStatus() will return Passed)

Definition at line 64 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
virtual Belos::StatusTestUserOutput< ScalarType, MV, OP >::~StatusTestUserOutput ( )
inlinevirtual

Destructor.

Definition at line 88 of file BelosStatusTestUserOutput.hpp.

Member Function Documentation

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestUserOutput< ScalarType, MV, OP >::checkStatus ( Iteration< ScalarType, MV, OP > *  solver)
inlinevirtual

Check and return status of underlying StatusTest.

This method calls checkStatus() on the StatusTest object passed in the constructor. If appropriate, the method will follow this call with a call to print() on the underlying object, using the OutputManager passed via the constructor with verbosity level StatusTestDetails.

The internal counter will be incremented during this call, but only after performing the tests to decide whether or not to print the underlying StatusTest. This way, the very first call to checkStatus() following initialization or reset() will enable the underlying StatusTest to be printed, regardless of the mod parameter, as the current number of calls will be zero.

If the specified Teuchos::RCP for the child class is Teuchos::null, then calling checkStatus() will result in a StatusTestError std::exception being thrown.

Returns
StatusType indicating whether the underlying test passed or failed.

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

Definition at line 110 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestUserOutput< ScalarType, MV, OP >::getStatus ( ) const
inlinevirtual

Return the result of the most recent checkStatus call, or undefined if it has not been run.

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

Definition at line 144 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::setOutputManager ( const Teuchos::RCP< OutputManager< ScalarType > > &  printer)
inlinevirtual

Set the output manager.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 155 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::setOutputFrequency ( int  mod)
inlinevirtual

Set how often the child test is printed.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 159 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::setChild ( Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test)
inlinevirtual

Set child test, which must be a combination of a Belos::StatusTestMaxIters AND a combination of Belos::StatusTestResNorms and user-specified tests.

Note
This also resets the test status to Undefined.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 165 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTest<ScalarType,MV,OP> > Belos::StatusTestUserOutput< ScalarType, MV, OP >::getChild ( ) const
inlinevirtual

Get child test.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 238 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::setSolverDesc ( const std::string &  solverDesc)
inlinevirtual

Set a short solver description for output clarity.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 244 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::setPrecondDesc ( const std::string &  precondDesc)
inlinevirtual

Set a short preconditioner description for output clarity.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 248 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::reset ( )
inlinevirtual

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

This resets the cached state to an Undefined state and calls reset() on the underlying test. It also resets the counter for the number of calls to checkStatus().

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

Definition at line 259 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::resetNumCalls ( )
inlinevirtual

Informs the outputting status test that it should reset the number of calls to zero.

Note
This outputting status test relies on the number of iterations performed, not number of times the status test has been called, so this method has no effect.

Implements Belos::StatusTestOutput< ScalarType, MV, OP >.

Definition at line 270 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestUserOutput< ScalarType, MV, OP >::print ( std::ostream &  os,
int  indent = 0 
) const
inlinevirtual

Output formatted description of stopping test to output stream.

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

Definition at line 278 of file BelosStatusTestUserOutput.hpp.

Member Data Documentation

template<class ScalarType , class MV , class OP >
Teuchos::RCP<OutputManager<ScalarType> > Belos::StatusTestUserOutput< ScalarType, MV, OP >::printer_
private

Definition at line 353 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTest<ScalarType,MV,OP> > Belos::StatusTestUserOutput< ScalarType, MV, OP >::test_
private

Definition at line 356 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > > Belos::StatusTestUserOutput< ScalarType, MV, OP >::taggedTests_
private

Definition at line 359 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > Belos::StatusTestUserOutput< ScalarType, MV, OP >::iterTest_
private

Definition at line 362 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
std::vector<Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > Belos::StatusTestUserOutput< ScalarType, MV, OP >::resTestVec_
private

Vector of residual status tests.

Definition at line 365 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
std::vector<std::string> Belos::StatusTestUserOutput< ScalarType, MV, OP >::resTestNamesVec_
private

Name tags for status tests.

Definition at line 368 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
std::string Belos::StatusTestUserOutput< ScalarType, MV, OP >::solverDesc_
private

Definition at line 370 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
std::string Belos::StatusTestUserOutput< ScalarType, MV, OP >::precondDesc_
private

Definition at line 371 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
std::vector<int> Belos::StatusTestUserOutput< ScalarType, MV, OP >::currIdx_
private

Definition at line 372 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestUserOutput< ScalarType, MV, OP >::state_
private

Definition at line 373 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
bool Belos::StatusTestUserOutput< ScalarType, MV, OP >::headerPrinted_
mutableprivate

Definition at line 374 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::stateTest_
private

Definition at line 375 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::modTest_
private

Definition at line 375 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::lastNumIters_
private

Definition at line 376 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::comboType_
private

Definition at line 376 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::blockSize_
private

Definition at line 377 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::currNumRHS_
private

Definition at line 378 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::currLSNum_
private

Definition at line 378 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::numLSDgts_
private

Definition at line 379 of file BelosStatusTestUserOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestUserOutput< ScalarType, MV, OP >::numIterDgts_
private

Definition at line 379 of file BelosStatusTestUserOutput.hpp.


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