RVLAlg::NormGradientTerminator< Scalar > Class Template Reference

A terminator which checks for a stationary point in a functional. More...

#include <vectorterm.hh>

Inheritance diagram for RVLAlg::NormGradientTerminator< Scalar >:

RVLAlg::Terminator List of all members.

Public Types

typedef ScalarFieldTraits<
Scalar >::AbsType 
NormRetType

Public Member Functions

 NormGradientTerminator (Vector< Scalar > &x, Functional< Scalar > &f, NormRetType tol)
 Takes the current x, the functional f, and the tolerance.
bool query ()
 Returns true when norm of the gradient is less than tol.

Protected Attributes

NormRetType tol_
FunctionalEvaluation< Scalar > fx_

Detailed Description

template<class Scalar>
class RVLAlg::NormGradientTerminator< Scalar >

A terminator which checks for a stationary point in a functional.

Stops when

\[ \|\|\nabla f(x)\|\| <= tol \]

Note: For efficiency, we store $tol^2$ and compare it to the square of the norm, since this is ussually cheaper.

Definition at line 313 of file vectorterm.hh.


Member Typedef Documentation

template<class Scalar>
typedef ScalarFieldTraits<Scalar>::AbsType RVLAlg::NormGradientTerminator< Scalar >::NormRetType

Definition at line 315 of file vectorterm.hh.


Constructor & Destructor Documentation

template<class Scalar>
RVLAlg::NormGradientTerminator< Scalar >::NormGradientTerminator ( Vector< Scalar > &  x,
Functional< Scalar > &  f,
NormRetType  tol 
)

Takes the current x, the functional f, and the tolerance.

Notice that all inputs except for the tolerance are references, and similar internal data members are also references. Thus, external changes to these objects will affect the terminator. This is the intended behavior.

Definition at line 324 of file vectorterm.hh.


Member Function Documentation

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

Returns true when norm of the gradient is less than tol.

Implements RVLAlg::Terminator.

Definition at line 331 of file vectorterm.hh.

References RVLAlg::NormGradientTerminator< Scalar >::fx_, and RVLAlg::NormGradientTerminator< Scalar >::tol_.


Member Data Documentation

template<class Scalar>
NormRetType RVLAlg::NormGradientTerminator< Scalar >::tol_ [protected]

Definition at line 336 of file vectorterm.hh.

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

template<class Scalar>
FunctionalEvaluation<Scalar> RVLAlg::NormGradientTerminator< Scalar >::fx_ [protected]

Definition at line 337 of file vectorterm.hh.

Referenced by RVLAlg::NormGradientTerminator< 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