RVLAlg::GradientThresholdIterationTable< Scalar > Class Template Reference

This terminator behaves like a combined CountTerminator and NormGradientTerminator, with the added side effect of printing an iteration table with the current functional value and norm of the gradient. More...

#include <ioterm.hh>

Inheritance diagram for RVLAlg::GradientThresholdIterationTable< Scalar >:

RVLAlg::CountTerminator RVLAlg::Terminator List of all members.

Public Member Functions

 GradientThresholdIterationTable (FunctionalEvaluation< Scalar > &_fx, int maxcount=1, atype _atol=numeric_limits< atype >::max(), atype _rtol=ScalarFieldTraits< atype >::One(), ostream &_out=cout, bool _doit=true)
bool query ()

Protected Attributes

atype atol
atype rtol
bool init
atype fxval0
atype ngfx0
atype ingfx
bool doit
FunctionalEvaluation< Scalar > & fx
ostream & out

Detailed Description

template<class Scalar>
class RVLAlg::GradientThresholdIterationTable< Scalar >

This terminator behaves like a combined CountTerminator and NormGradientTerminator, with the added side effect of printing an iteration table with the current functional value and norm of the gradient.

Tests both absolute and relative (to initial value) gradient norm tolerances, returns true when either descends below given tolerance. To force absolute gradient norm to descend below atol, set rtol=1; to force relative gradient norm to descend below rtol, set atol=0. Defaults are set to be satisfied at first iteration, for safety's sake.

Template on Scalar type, with absolute value type = abstype

Parameters:
[in] fx - (FunctionalEvaluation)
[in] maxcount - (int) max number of iterations permitted; default = 1
[in] atol - (abstype) absolute gradient tolerance; default = max value of abstype
[in] rtol - (abstype) relative gradient tolerance; default = abstype one
[in] doit - (bool) print table headings; default = true
[in] out - (ostream) output stream; default = cout

Definition at line 220 of file ioterm.hh.


Constructor & Destructor Documentation

template<class Scalar>
RVLAlg::GradientThresholdIterationTable< Scalar >::GradientThresholdIterationTable ( FunctionalEvaluation< Scalar > &  _fx,
int  maxcount = 1,
atype  _atol = numeric_limits<atype>::max(),
atype  _rtol = ScalarFieldTraits<atype>::One(),
ostream &  _out = cout,
bool  _doit = true 
)

Definition at line 225 of file ioterm.hh.

References RVLAlg::GradientThresholdIterationTable< Scalar >::doit, and RVLAlg::GradientThresholdIterationTable< Scalar >::out.


Member Function Documentation

template<class Scalar>
bool RVLAlg::GradientThresholdIterationTable< Scalar >::query (  )  [virtual]

Reimplemented from RVLAlg::CountTerminator.

Definition at line 239 of file ioterm.hh.

References RVLAlg::GradientThresholdIterationTable< Scalar >::atol, RVLAlg::GradientThresholdIterationTable< Scalar >::doit, RVLAlg::GradientThresholdIterationTable< Scalar >::fx, RVLAlg::GradientThresholdIterationTable< Scalar >::fxval0, RVLAlg::CountTerminator::getCount(), RVLAlg::GradientThresholdIterationTable< Scalar >::ingfx, RVLAlg::GradientThresholdIterationTable< Scalar >::init, RVLAlg::GradientThresholdIterationTable< Scalar >::ngfx0, RVLAlg::GradientThresholdIterationTable< Scalar >::out, RVLAlg::CountTerminator::query(), and RVLAlg::GradientThresholdIterationTable< Scalar >::rtol.


Member Data Documentation

template<class Scalar>
atype RVLAlg::GradientThresholdIterationTable< Scalar >::atol [protected]

Definition at line 301 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
atype RVLAlg::GradientThresholdIterationTable< Scalar >::rtol [protected]

Definition at line 302 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
bool RVLAlg::GradientThresholdIterationTable< Scalar >::init [mutable, protected]

Definition at line 303 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
atype RVLAlg::GradientThresholdIterationTable< Scalar >::fxval0 [mutable, protected]

Definition at line 304 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
atype RVLAlg::GradientThresholdIterationTable< Scalar >::ngfx0 [mutable, protected]

Definition at line 305 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
atype RVLAlg::GradientThresholdIterationTable< Scalar >::ingfx [mutable, protected]

Definition at line 306 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
bool RVLAlg::GradientThresholdIterationTable< Scalar >::doit [protected]

Definition at line 308 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::GradientThresholdIterationTable(), and RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
FunctionalEvaluation<Scalar>& RVLAlg::GradientThresholdIterationTable< Scalar >::fx [protected]

Definition at line 309 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::query().

template<class Scalar>
ostream& RVLAlg::GradientThresholdIterationTable< Scalar >::out [protected]

Definition at line 310 of file ioterm.hh.

Referenced by RVLAlg::GradientThresholdIterationTable< Scalar >::GradientThresholdIterationTable(), and RVLAlg::GradientThresholdIterationTable< Scalar >::query().


The documentation for this class was generated from the following file:
Generated on 5 Jan 2017 for RvlAlg by  doxygen 1.4.7