LAMA
|
IterationCount is a stopping criterion of a solver which checks the number of iterations a solver has executed. More...
#include <IterationCount.hpp>
Public Types | |
enum | BooleanOperator { AND, OR } |
Defines the operators which can be used to connect Criterions with. More... | |
Public Member Functions | |
IterationCount () | |
Creates a IterationCount with checkMode Maximal and iterationExtream 1. | |
IterationCount (const IndexType iterationExtrema) | |
Creates a IterationCount with the passed checkMode and iterationExtream. | |
IterationCount (const IterationCount &other) | |
Creates a copy of the passed IterationCount object. | |
virtual | ~IterationCount () |
Destroys this IterationCount object. | |
virtual bool | isSatisfied (const IterativeSolver &solver) |
Checks if this Criterion is true for the state of the passed solver. | |
IndexType | getIterationExtrema () const |
void | setIterationExtrema (IndexType iterationExtrema) |
virtual void | writeAt (std::ostream &stream) const |
Writes some Information about this to the passed stream. | |
const CriterionPtr | getLeftChild () const |
const CriterionPtr | getRightChild () const |
BooleanOperator | getOperation () const |
void | setLeftChild (const CriterionPtr leftChild) |
void | setRightChild (const CriterionPtr rightChild) |
void | setOperation (const BooleanOperator operation) |
bool | hasLeftChild () const |
Returns true if the boolean condition has a left child Do not use getLeftChild() to compare pointers. | |
bool | hasRightChild () const |
Returns true if the boolean condition has a right child Do not use getRightChild() to compare pointers. | |
Protected Member Functions | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
Private Attributes | |
IndexType | mIterationExtrema |
IterationCount is a stopping criterion of a solver which checks the number of iterations a solver has executed.
IterationCount is a stopping criterion of a solver which checks the number of iterations a solver has executed. IterationCount is either true if the number of iterations is larger or smaller than a configured number of iterations. Depending on the configured IterationCheckMode.
enum lama::Criterion::BooleanOperator [inherited] |
Creates a IterationCount with checkMode Maximal and iterationExtream 1.
lama::IterationCount::IterationCount | ( | const IndexType | iterationExtrema | ) |
Creates a IterationCount with the passed checkMode and iterationExtream.
Creates a IterationCount with the passed checkMode and iterationExtream. If checkMode is Maximal isSatisfied evaluates to
if checkMOde is Minimal isSatisfied evaluates to
[in] | iterationExtrema | the number of iterations a solver should execute at most or minimal |
[in] | checkMode | if the number of iterations should be checked for a minimal number of iterations or a maximal number of iterations. |
lama::IterationCount::IterationCount | ( | const IterationCount & | other | ) |
Creates a copy of the passed IterationCount object.
lama::IterationCount::~IterationCount | ( | ) | [virtual] |
Destroys this IterationCount object.
References mIterationExtrema.
Referenced by writeAt().
const CriterionPtr lama::Criterion::getLeftChild | ( | ) | const [inherited] |
References lama::Criterion::mLeftChild.
Referenced by lama::Criterion::writeAt().
Criterion::BooleanOperator lama::Criterion::getOperation | ( | ) | const [inherited] |
References lama::Criterion::mOperation.
Referenced by lama::Criterion::writeAt().
const CriterionPtr lama::Criterion::getRightChild | ( | ) | const [inherited] |
References lama::Criterion::mRightChild.
Referenced by lama::Criterion::writeAt().
bool lama::Criterion::hasLeftChild | ( | ) | const [inherited] |
Returns true if the boolean condition has a left child Do not use getLeftChild() to compare pointers.
Logical operations are overwritten
return Returns true if the boolean condition has a left child. If pointer is not set: false
References lama::Criterion::mLeftChild.
Referenced by lama::Criterion::isSatisfied(), and lama::Criterion::writeAt().
bool lama::Criterion::hasRightChild | ( | ) | const [inherited] |
Returns true if the boolean condition has a right child Do not use getRightChild() to compare pointers.
Logical operations are overwritten
return Returns true if the boolean condition has a right child. If pointer is not set: false
References lama::Criterion::mRightChild.
Referenced by lama::Criterion::isSatisfied(), and lama::Criterion::writeAt().
bool lama::IterationCount::isSatisfied | ( | const IterativeSolver & | solver | ) | [virtual] |
Checks if this Criterion is true for the state of the passed solver.
[in] | solver | the solver to check the state of. |
Reimplemented from lama::Criterion.
References lama::IterativeSolver::getIterationCount(), and mIterationExtrema.
lama::IterationCount::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [protected] |
Reimplemented from lama::Criterion.
void lama::IterationCount::setIterationExtrema | ( | IndexType | iterationExtrema | ) |
References mIterationExtrema.
void lama::Criterion::setLeftChild | ( | const CriterionPtr | leftChild | ) | [inherited] |
References lama::Criterion::mLeftChild.
void lama::Criterion::setOperation | ( | const BooleanOperator | operation | ) | [inherited] |
References lama::Criterion::mOperation.
void lama::Criterion::setRightChild | ( | const CriterionPtr | rightChild | ) | [inherited] |
References lama::Criterion::mRightChild.
void lama::IterationCount::writeAt | ( | std::ostream & | stream | ) | const [virtual] |
Writes some Information about this to the passed stream.
If a deriving class does not overrides writeAt, typeid(this).name() is written to stream.
[out] | stream | the stream to write to. |
Reimplemented from lama::Criterion.
References getIterationExtrema().
Referenced by getIterationExtrema(), isSatisfied(), and setIterationExtrema().