Belos::StatusTestResNormOutput< ScalarType, MV, OP > Class Template Reference

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

#include <BelosStatusTestResNormOutput.hpp>

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

List of all members.

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
< StatusTestMaxIters
< ScalarType, MV, OP > > 
iterTest_
std::vector< Teuchos::RCP
< StatusTestResNorm
< ScalarType, MV, OP > > > 
resTestVec_
 Vector of residual status tests.
std::string solverDesc_
std::string precondDesc_
std::vector< int > currIdx_
StatusType state_
bool headerPrinted_
int stateTest_
int modTest_
int lastNumIters_
int comboType_
int numResTests_
int blockSize_
int currNumRHS_
int currLSNum_
int numLSDgts_
int numIterDgts_

Constructors/destructors



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

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.

Accessor methods



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

Reset methods



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

Print methods



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

Detailed Description

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

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

StatusTestResNormOutput is a wrapper around an StatusTest that calls StatusTest::print() on the underlying object on calls to StatusTestResNormOutput::checkStatus(). The frequency and occasion of the printing can be dictated according to some parameters passed to StatusTestResNormOutput::StatusTestResNormOutput().

Definition at line 61 of file BelosStatusTestResNormOutput.hpp.


Member Typedef Documentation

template<class ScalarType , class MV , class OP >
typedef MultiVecTraits<ScalarType,MV> Belos::StatusTestResNormOutput< ScalarType, MV, OP >::MVT [private]

Definition at line 63 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestCombo<ScalarType,MV,OP> Belos::StatusTestResNormOutput< ScalarType, MV, OP >::StatusTestCombo_t [private]

Definition at line 64 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestResNorm<ScalarType,MV,OP> Belos::StatusTestResNormOutput< ScalarType, MV, OP >::StatusTestResNorm_t [private]

Definition at line 65 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
typedef Belos::StatusTestMaxIters<ScalarType,MV,OP> Belos::StatusTestResNormOutput< ScalarType, MV, OP >::StatusTestMaxIters_t [private]

Definition at line 66 of file BelosStatusTestResNormOutput.hpp.


Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP >
Belos::StatusTestResNormOutput< ScalarType, MV, OP >::StatusTestResNormOutput ( const Teuchos::RCP< OutputManager< ScalarType > > &  printer,
Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test,
int  mod = 1,
int  printStates = Passed 
) [inline]

Constructor.

The StatusTestResNormOutput 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] test A reference-counted pointer to an object that combines Belos::StatusTestMaxIters and a set of Belos::StatusTestResNorm
[in] mod A 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] printStates A combination of StatusType values for which the output may be printed. Default: Passed (attempt to print whenever checkStatus() will return Passed)

Definition at line 87 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
virtual Belos::StatusTestResNormOutput< ScalarType, MV, OP >::~StatusTestResNormOutput (  )  [inline, virtual]

Destructor.

Definition at line 110 of file BelosStatusTestResNormOutput.hpp.


Member Function Documentation

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestResNormOutput< ScalarType, MV, OP >::checkStatus ( Iteration< ScalarType, MV, OP > *  solver  )  [inline, virtual]

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 132 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestResNormOutput< ScalarType, MV, OP >::getStatus (  )  const [inline, virtual]

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 166 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::setOutputManager ( const Teuchos::RCP< OutputManager< ScalarType > > &  printer  )  [inline, virtual]

Set the output manager.

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

Definition at line 177 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::setOutputFrequency ( int  mod  )  [inline, virtual]

Set how often the child test is printed.

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

Definition at line 181 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::setChild ( Teuchos::RCP< StatusTest< ScalarType, MV, OP > >  test  )  [inline, virtual]

Set child test, which must be a combination of a Belos::StatusTestMaxIters AND a single or combination of Belos::StatusTestResNorms.

Note:
This also resets the test status to Undefined.

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

Definition at line 187 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTest<ScalarType,MV,OP> > Belos::StatusTestResNormOutput< ScalarType, MV, OP >::getChild (  )  const [inline, virtual]

Get child test.

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

Definition at line 238 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::setSolverDesc ( const std::string &  solverDesc  )  [inline, virtual]

Set a short solver description for output clarity.

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

Definition at line 244 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::setPrecondDesc ( const std::string &  precondDesc  )  [inline, virtual]

Set a short preconditioner description for output clarity.

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

Definition at line 248 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::reset (  )  [inline, virtual]

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 BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::resetNumCalls (  )  [inline, virtual]

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 BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
void Belos::StatusTestResNormOutput< ScalarType, MV, OP >::print ( std::ostream &  os,
int  indent = 0 
) const [inline, virtual]

Output formatted description of stopping test to output stream.

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

Definition at line 278 of file BelosStatusTestResNormOutput.hpp.


Member Data Documentation

template<class ScalarType , class MV , class OP >
Teuchos::RCP<OutputManager<ScalarType> > Belos::StatusTestResNormOutput< ScalarType, MV, OP >::printer_ [private]

Definition at line 333 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTest<ScalarType,MV,OP> > Belos::StatusTestResNormOutput< ScalarType, MV, OP >::test_ [private]

Definition at line 336 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP<StatusTestMaxIters<ScalarType,MV,OP> > Belos::StatusTestResNormOutput< ScalarType, MV, OP >::iterTest_ [private]

Definition at line 339 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
std::vector<Teuchos::RCP<StatusTestResNorm<ScalarType,MV,OP> > > Belos::StatusTestResNormOutput< ScalarType, MV, OP >::resTestVec_ [private]

Vector of residual status tests.

Definition at line 342 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
std::string Belos::StatusTestResNormOutput< ScalarType, MV, OP >::solverDesc_ [private]

Definition at line 344 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
std::string Belos::StatusTestResNormOutput< ScalarType, MV, OP >::precondDesc_ [private]

Definition at line 345 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
std::vector<int> Belos::StatusTestResNormOutput< ScalarType, MV, OP >::currIdx_ [private]

Definition at line 346 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
StatusType Belos::StatusTestResNormOutput< ScalarType, MV, OP >::state_ [private]

Definition at line 347 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
bool Belos::StatusTestResNormOutput< ScalarType, MV, OP >::headerPrinted_ [mutable, private]

Definition at line 348 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::stateTest_ [private]

Definition at line 349 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::modTest_ [private]

Definition at line 349 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::lastNumIters_ [private]

Definition at line 350 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::comboType_ [private]

Definition at line 350 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::numResTests_ [private]

Definition at line 351 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::blockSize_ [private]

Definition at line 351 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::currNumRHS_ [private]

Definition at line 352 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::currLSNum_ [private]

Definition at line 352 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::numLSDgts_ [private]

Definition at line 353 of file BelosStatusTestResNormOutput.hpp.

template<class ScalarType , class MV , class OP >
int Belos::StatusTestResNormOutput< ScalarType, MV, OP >::numIterDgts_ [private]

Definition at line 353 of file BelosStatusTestResNormOutput.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:05:19 2011 for Belos Package Browser (Single Doxygen Collection) by  doxygen 1.6.3