RVLUmin::LineSearchAlg< Scalar > Class Template Reference

Abstract handle class template for line searches. More...

#include <lnsrch.hh>

Inheritance diagram for RVLUmin::LineSearchAlg< Scalar >:

RVLAlg::Algorithm RVLAlg::Terminator RVLUmin::BacktrackingLineSearchAlg< Scalar > List of all members.

Public Member Functions

 LineSearchAlg (Scalar _firststep=numeric_limits< Scalar >::max(), Scalar _minsteptol=numeric_limits< Scalar >::epsilon())
 constructor:
 LineSearchAlg (LineSearchAlg< Scalar > const &lsh)
 ~LineSearchAlg ()
void initialize (FunctionalEvaluation< Scalar > &fx, Vector< Scalar > const &dx)
 this method makes this class an abstract factory
void run ()
 run whatever you've got, then record step actually taken
bool query ()
 query functions
Scalar getStep () const
Scalar getBaseValue () const
Vector< Scalar > const & getBasePoint () const
Vector< Scalar > const & getBaseGradient () const
Vector< Scalar > & getTrialPoint () const
Vector< Scalar > const & getSearchDirection () const
FunctionalEvaluation< Scalar > & getFunctionalEvaluation () const
Scalar getMinStep () const
 Checks that the step is not senselessly small.

Protected Member Functions

virtual LineSearchAlgBase<
Scalar > * 
build (FunctionalEvaluation< Scalar > &fx, Vector< Scalar > const &dx, Scalar firststep)=0
 Protected initialization - to be supplied by subclass.

Detailed Description

template<typename Scalar>
class RVLUmin::LineSearchAlg< Scalar >

Abstract handle class template for line searches.

Instantiates its captive LineSearchAlgBase data member via protected pure virtual constructor (build(...)), and implements run() by delegation to this internal Alg. Also manages two key items:

Definition at line 160 of file lnsrch.hh.


Constructor & Destructor Documentation

template<typename Scalar>
RVLUmin::LineSearchAlg< Scalar >::LineSearchAlg ( Scalar  _firststep = numeric_limits<Scalar>::max(),
Scalar  _minsteptol = numeric_limits<Scalar>::epsilon() 
)

constructor:

Parameters:
_firststep = initial step length, modified by each run to be the last successful step
_minsteptol = minimum permitted step

Definition at line 185 of file lnsrch.hh.

template<typename Scalar>
RVLUmin::LineSearchAlg< Scalar >::LineSearchAlg ( LineSearchAlg< Scalar > const &  lsh  ) 

Definition at line 188 of file lnsrch.hh.

References RVLUmin::LineSearchAlg< Scalar >::ls.

template<typename Scalar>
RVLUmin::LineSearchAlg< Scalar >::~LineSearchAlg (  ) 

Definition at line 192 of file lnsrch.hh.


Member Function Documentation

template<typename Scalar>
virtual LineSearchAlgBase<Scalar>* RVLUmin::LineSearchAlg< Scalar >::build ( FunctionalEvaluation< Scalar > &  fx,
Vector< Scalar > const &  dx,
Scalar  firststep 
) [protected, pure virtual]

Protected initialization - to be supplied by subclass.

Note that LSAlgBase class is responsible for sensibly extracting an initial step from the firststep arg, which is initially the max Scalar, then the step actually taken in the last successful line search.

Implemented in RVLUmin::BacktrackingLineSearchAlg< Scalar >.

Referenced by RVLUmin::LineSearchAlg< Scalar >::initialize().

template<typename Scalar>
void RVLUmin::LineSearchAlg< Scalar >::initialize ( FunctionalEvaluation< Scalar > &  fx,
Vector< Scalar > const &  dx 
)

this method makes this class an abstract factory

Definition at line 197 of file lnsrch.hh.

References RVLUmin::LineSearchAlg< Scalar >::build().

template<typename Scalar>
void RVLUmin::LineSearchAlg< Scalar >::run (  )  [virtual]

run whatever you've got, then record step actually taken

Implements RVLAlg::Algorithm.

Definition at line 204 of file lnsrch.hh.

template<typename Scalar>
bool RVLUmin::LineSearchAlg< Scalar >::query (  )  [virtual]

query functions

Implements RVLAlg::Terminator.

Definition at line 217 of file lnsrch.hh.

template<typename Scalar>
Scalar RVLUmin::LineSearchAlg< Scalar >::getStep (  )  const

Definition at line 224 of file lnsrch.hh.

template<typename Scalar>
Scalar RVLUmin::LineSearchAlg< Scalar >::getBaseValue (  )  const

Definition at line 226 of file lnsrch.hh.

template<typename Scalar>
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getBasePoint (  )  const

Definition at line 234 of file lnsrch.hh.

Referenced by RVLUmin::LBFGSDir< Scalar >::updateDir().

template<typename Scalar>
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getBaseGradient (  )  const

Definition at line 242 of file lnsrch.hh.

Referenced by RVLUmin::LBFGSDir< Scalar >::updateDir().

template<typename Scalar>
Vector<Scalar>& RVLUmin::LineSearchAlg< Scalar >::getTrialPoint (  )  const

Definition at line 250 of file lnsrch.hh.

Referenced by RVLUmin::LBFGSDir< Scalar >::updateDir().

template<typename Scalar>
Vector<Scalar> const& RVLUmin::LineSearchAlg< Scalar >::getSearchDirection (  )  const

Definition at line 258 of file lnsrch.hh.

template<typename Scalar>
FunctionalEvaluation<Scalar>& RVLUmin::LineSearchAlg< Scalar >::getFunctionalEvaluation (  )  const

Definition at line 266 of file lnsrch.hh.

Referenced by RVLUmin::LBFGSDir< Scalar >::updateDir().

template<typename Scalar>
Scalar RVLUmin::LineSearchAlg< Scalar >::getMinStep (  )  const

Checks that the step is not senselessly small.

Size of step times direction vector is measured either relative to the length of the current iterate, if the latter is nonzero, or absolutely if the current iterate happens to be the zero vector. In either case returns true if stepsize is greater than this measure, else false.

Definition at line 292 of file lnsrch.hh.


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