11#ifndef BELOS_STATUS_TEST_MAXITERS_HPP
12#define BELOS_STATUS_TEST_MAXITERS_HPP
30template <
class ScalarType,
class MV,
class OP>
98 std::ostringstream
oss;
120 template <
class ScalarType,
class MV,
class OP>
132 template <
class ScalarType,
class MV,
class OP>
136 nIters_ =
iSolver->getNumIters();
137 if (nIters_ >= maxIters_)
142 template <
class ScalarType,
class MV,
class OP>
149 template <
class ScalarType,
class MV,
class OP>
154 printStatus(
os, status_);
155 os <<
"Number of Iterations = ";
157 os << ((nIters_ < maxIters_) ?
" < " : ((nIters_ == maxIters_) ?
" == " :
" > "));
162 template <
class ScalarType,
class MV,
class OP>
165 os << std::left << std::setw(13) << std::setfill(
'.');
178 os << std::left << std::setfill(
' ');
Pure virtual base class for defining the status testing capabilities of Belos.
Alternative run-time polymorphic interface for operators.
Operator()
Default constructor (does nothing).
A Belos::StatusTest class for specifying a maximum number of iterations.
void print(std::ostream &os, int indent=0) const
Output formatted description of stopping test to output stream.
StatusType checkStatus(Iteration< ScalarType, MV, OP > *iSolver)
Check convergence status of the iterative solver: Unconverged, Converged, Failed.
void reset()
Resets the status test to the initial internal state.
StatusTestMaxIters(int maxIters)
Constructor.
std::string description() const
Method to return description of the maximum iteration status test
virtual ~StatusTestMaxIters()
Destructor.
StatusType getStatus() const
Return the result of the most recent CheckStatus call.
void setMaxIters(int maxIters)
Sets the maximum number of iterations allowed.
int getMaxIters() const
Returns the maximum number of iterations set in the constructor.
int getNumIters() const
Returns the current number of iterations from the most recent StatusTest call.
void printStatus(std::ostream &os, StatusType type) const
Print message for each status specific to this stopping test.
A pure virtual class for defining the status tests for the Belos iterative solvers.
StatusType
Whether the StatusTest wants iteration to stop.