Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
ipo_function::detail::ForwardDifferenceGradientEstimate Class Reference

This class estimates a function value, gradient and Hessian at a given vector. More...

#include <ForwardDifferenceGradientEstimate.hpp>

Inheritance diagram for ipo_function::detail::ForwardDifferenceGradientEstimate:
Inheritance graph
Collaboration diagram for ipo_function::detail::ForwardDifferenceGradientEstimate:
Collaboration graph

Public Member Functions

 ForwardDifferenceGradientEstimate (Function &function, double const h=std::sqrt(std::numeric_limits< double >::epsilon()))
 Find forward difference quotient estimates. More...
 
virtual void setVector (gsl::vector const &vector)
 Set the vector to a new value. More...
 
- Public Member Functions inherited from ipo_function::GradientEstimate
 GradientEstimate (size_t const size=0)
 Constructor. More...
 
virtual double value () const
 
virtual gsl::vector gradient () const
 
- Public Member Functions inherited from ipo_function::detail::FunctionBase
 FunctionBase (size_t const size=0)
 Constructor. More...
 
virtual ~FunctionBase ()=0
 Make the class abstract. More...
 
size_t getSize () const
 Get size of vector for function arguments or zero for arbitrary size. More...
 

Protected Attributes

Functionfunction
 The function. More...
 
double const h
 The qotient size. More...
 
- Protected Attributes inherited from ipo_function::GradientEstimate
double functionValue
 The function value. More...
 
gsl::vector functionGradient
 The gradient value. More...
 
- Protected Attributes inherited from ipo_function::detail::FunctionBase
size_t const size
 Size of vector arguments to supply to subclass functions. More...
 

Detailed Description

This class estimates a function value, gradient and Hessian at a given vector.

The function must be supplied as an ipo::Function. The vector must be supplied as a gsl::vector::vector. The gradient and Hessian are estimated using forward difference quotients. A forward difference quotient requires a value h and if no value is supplied, then the class uses the square root of the * machine epsilon. This is a reasonably standard value and ensures that the function is evaluated with changes in approximately the lower half of the significant digits of the vector.

The values returned by gradient() and hessian() can be modified but should not be used once the object creating them no longer exists.

See also
DerivativesEstimates

Definition at line 47 of file ForwardDifferenceGradientEstimate.hpp.

Constructor & Destructor Documentation

ForwardDifferenceGradientEstimate::ForwardDifferenceGradientEstimate ( Function function,
double const  h = std::sqrt( std::numeric_limits<double>::       epsilon() ) 
)

Find forward difference quotient estimates.

Parameters
functionThis is the function whose derivatives we estimate
hThe quotient size: default is square root of machine epsilon

Definition at line 28 of file ForwardDifferenceGradientEstimate.cc.

Member Function Documentation

void ForwardDifferenceGradientEstimate::setVector ( gsl::vector const &  vector)
virtual

Member Data Documentation

Function& ipo_function::detail::ForwardDifferenceGradientEstimate::function
protected

The function.

Definition at line 66 of file ForwardDifferenceGradientEstimate.hpp.

double const ipo_function::detail::ForwardDifferenceGradientEstimate::h
protected

The qotient size.

Definition at line 70 of file ForwardDifferenceGradientEstimate.hpp.

Referenced by setVector().


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