#include <alg.hh>
Inheritance diagram for RVLAlg::Terminator:
Public Member Functions | |
virtual | ~Terminator () |
virtual bool | query ()=0 |
In general, it is an object which we can query for a boolean value:
true = stop looping false = criteria not satisfied, so continue iterating
Note that the query function has no parameters. Thus, it is imperative that appropriate constructors be written and references kept for specific termination criteria. See the examples below.
Also, generally speaking these are lightweight objects (i.e. don't own any large data members) and thus can be created, destroyed, passed as necessary. The author intended for each object to be used in a single loop or nest of loops.
It is intended that these objects be allowed to have side effects. For example, one of the desired behaviors we would like to eventually include is to allow a user to interact with their problem as an algorithm progresses by modifying the objective function and constraints. These I/O interactions and modifications would occur during a query to a special terminator that had references to problem data as data members.
A final note: the only difference between a Terminator and an Algorithm is that the Terminator has something to say when it's done.
Definition at line 155 of file alg.hh.
virtual bool RVLAlg::Terminator::query | ( | ) | [pure virtual] |
Implemented in RVLAlg::BoolTerminator, RVLAlg::AndTerminator, RVLAlg::OrTerminator, RVLAlg::NotTerminator, RVLAlg::XorTerminator, RVLAlg::IOTerminator, RVLAlg::VecWatchTerminator< Scalar >, RVLAlg::IterationTable< Scalar >, RVLAlg::SteppedIterationTable< Scalar >, RVLAlg::GradientThresholdIterationTable< Scalar >, RVLAlg::CountingThresholdIterationTable< Scalar >, RVLAlg::VectorCountingThresholdIterationTable< Scalar >, RVLAlg::CountingNormTable< Scalar >, RVLAlg::CountTerminator, RVLAlg::MaxTerminator< Scalar >, RVLAlg::MinTerminator< Scalar >, RVLAlg::MinTerminatorFE< Scalar >, RVLAlg::UnaryThresholdTerminator< Scalar >, RVLAlg::BinaryThresholdTerminator< Scalar >, RVLAlg::TernaryThresholdTerminator< Scalar >, RVLAlg::NormThresholdTerminator< Scalar >, RVLAlg::Norm2ThresholdTerminator< Scalar >, RVLAlg::DiffThresholdTerminator< Scalar >, RVLAlg::Diff2ThresholdTerminator< Scalar >, RVLAlg::IPThresholdTerminator< Scalar >, RVLAlg::AbsIPThresholdTerminator< Scalar >, RVLAlg::NormGradientTerminator< Scalar >, RVLAlg::DiffBallProjTerminator< Scalar >, and RVLAlg::BallProjTerminator< Scalar >.
Referenced by RVLAlg::XorTerminator::query(), RVLAlg::NotTerminator::query(), RVLAlg::OrTerminator::query(), RVLAlg::AndTerminator::query(), RVLAlg::BranchAlg::run(), RVLAlg::CondListAlg::run(), and RVLAlg::LoopAlg::run().