OpenMD  2.5
Molecular Dynamics in the Open
QuantLib::LineSearch Class Referenceabstract

Base class for line search. More...

#include <LineSearch.hpp>

Inheritance diagram for QuantLib::LineSearch:
QuantLib::ArmijoLineSearch

Public Member Functions

 LineSearch (RealType=0.0)
 Default constructor. More...
 
virtual ~LineSearch ()
 Destructor. More...
 
const DynamicVector< RealType > & lastX ()
 return last x value More...
 
RealType lastFunctionValue ()
 return last objective function value More...
 
const DynamicVector< RealType > & lastGradient ()
 return last gradient More...
 
RealType lastGradientNorm2 ()
 return square norm of last gradient More...
 
bool succeed ()
 
virtual RealType operator() (Problem &P, EndCriteria::Type &ecType, const EndCriteria &, const RealType t_ini)=0
 Perform line search. More...
 
RealType update (DynamicVector< RealType > &params, const DynamicVector< RealType > &direction, RealType beta, const Constraint &constraint)
 
const DynamicVector< RealType > & searchDirection () const
 current value of the search direction More...
 
DynamicVector< RealType > & searchDirection ()
 

Protected Attributes

DynamicVector< RealType > searchDirection_
 current values of the search direction More...
 
DynamicVector< RealType > xtd_
 new x and its gradient More...
 
DynamicVector< RealType > gradient_
 
RealType qt_
 objective function value and gradient norm corresponding to xtd_ More...
 
RealType qpt_
 
bool succeed_
 flag to know if linesearch succeed More...
 

Detailed Description

Base class for line search.

Definition at line 39 of file LineSearch.hpp.

Constructor & Destructor Documentation

◆ LineSearch()

QuantLib::LineSearch::LineSearch ( RealType  = 0.0)
inline

Default constructor.

Definition at line 42 of file LineSearch.hpp.

◆ ~LineSearch()

virtual QuantLib::LineSearch::~LineSearch ( )
inlinevirtual

Destructor.

Definition at line 45 of file LineSearch.hpp.

Member Function Documentation

◆ lastFunctionValue()

RealType QuantLib::LineSearch::lastFunctionValue ( )
inline

return last objective function value

Definition at line 50 of file LineSearch.hpp.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ lastGradient()

const DynamicVector<RealType>& QuantLib::LineSearch::lastGradient ( )
inline

◆ lastGradientNorm2()

RealType QuantLib::LineSearch::lastGradientNorm2 ( )
inline

return square norm of last gradient

Definition at line 54 of file LineSearch.hpp.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ lastX()

const DynamicVector<RealType>& QuantLib::LineSearch::lastX ( )
inline

return last x value

Definition at line 48 of file LineSearch.hpp.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ operator()()

virtual RealType QuantLib::LineSearch::operator() ( Problem P,
EndCriteria::Type ecType,
const EndCriteria ,
const RealType  t_ini 
)
pure virtual

Perform line search.

Implemented in QuantLib::ArmijoLineSearch.

◆ searchDirection() [1/2]

const DynamicVector<RealType>& QuantLib::LineSearch::searchDirection ( ) const
inline

◆ searchDirection() [2/2]

DynamicVector<RealType>& QuantLib::LineSearch::searchDirection ( )
inline

Definition at line 70 of file LineSearch.hpp.

◆ succeed()

bool QuantLib::LineSearch::succeed ( )
inline

Definition at line 56 of file LineSearch.hpp.

Referenced by QuantLib::LineSearchBasedMethod::minimize().

◆ update()

RealType QuantLib::LineSearch::update ( DynamicVector< RealType > &  params,
const DynamicVector< RealType > &  direction,
RealType  beta,
const Constraint constraint 
)

Member Data Documentation

◆ gradient_

DynamicVector<RealType> QuantLib::LineSearch::gradient_
protected

Definition at line 75 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ qpt_

RealType QuantLib::LineSearch::qpt_
protected

Definition at line 77 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ qt_

RealType QuantLib::LineSearch::qt_
protected

objective function value and gradient norm corresponding to xtd_

Definition at line 77 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ searchDirection_

DynamicVector<RealType> QuantLib::LineSearch::searchDirection_
protected

current values of the search direction

Definition at line 73 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ succeed_

bool QuantLib::LineSearch::succeed_
protected

flag to know if linesearch succeed

Definition at line 79 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().

◆ xtd_

DynamicVector<RealType> QuantLib::LineSearch::xtd_
protected

new x and its gradient

Definition at line 75 of file LineSearch.hpp.

Referenced by QuantLib::ArmijoLineSearch::operator()().


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