LAMA
lama::IterationCount Class Reference

IterationCount is a stopping criterion of a solver which checks the number of iterations a solver has executed. More...

#include <IterationCount.hpp>

Inheritance diagram for lama::IterationCount:

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

Detailed Description

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.


Member Enumeration Documentation

Defines the operators which can be used to connect Criterions with.

Enumerator:
AND 

stands for logical and composition

OR 

stands for logical or composition


Constructor & Destructor Documentation

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

Parameters:
[in]iterationExtremathe number of iterations a solver should execute at most or minimal
[in]checkModeif the number of iterations should be checked for a minimal number of iterations or a maximal number of iterations.

Creates a copy of the passed IterationCount object.

Destroys this IterationCount object.


Member Function Documentation

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.

Parameters:
[in]solverthe solver to check the state of.
Returns:
if this Criterion is true for the state of solver.

Reimplemented from lama::Criterion.

References lama::IterativeSolver::getIterationCount(), and mIterationExtrema.

Reimplemented from lama::Criterion.

void lama::Criterion::setLeftChild ( const CriterionPtr  leftChild) [inherited]
void lama::Criterion::setOperation ( const BooleanOperator  operation) [inherited]
void lama::Criterion::setRightChild ( const CriterionPtr  rightChild) [inherited]
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.

Parameters:
[out]streamthe stream to write to.

Reimplemented from lama::Criterion.

References getIterationExtrema().


Field Documentation


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