43#ifndef BELOS_STATUS_TEST_MAXITERS_HPP
44#define BELOS_STATUS_TEST_MAXITERS_HPP
62template <
class ScalarType,
class MV,
class OP>
117 void print(std::ostream& os,
int indent = 0)
const;
130 std::ostringstream oss;
152 template <
class ScalarType,
class MV,
class OP>
158 maxIters_ = maxIters;
164 template <
class ScalarType,
class MV,
class OP>
169 if (nIters_ >= maxIters_)
174 template <
class ScalarType,
class MV,
class OP>
181 template <
class ScalarType,
class MV,
class OP>
184 for (
int j = 0; j < indent; j ++)
186 printStatus(os, status_);
187 os <<
"Number of Iterations = ";
189 os << ((nIters_ < maxIters_) ?
" < " : ((nIters_ == maxIters_) ?
" == " :
" > "));
194 template <
class ScalarType,
class MV,
class OP>
197 os << std::left << std::setw(13) << std::setfill(
'.');
210 os << std::left << std::setfill(
' ');
Pure virtual base class for defining the status testing capabilities of Belos.
virtual int getNumIters() const =0
Get the current iteration count.
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 status_
Status.
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.
int maxIters_
Maximum number of iterations allowed.
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.
int nIters_
Current number of iterations.
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.