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

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

#include <ForwardDifferenceDerivativesEstimates.hpp>

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

Public Member Functions

 ForwardDifferenceDerivativesEstimates (Function &function, double const h=std::sqrt(std::numeric_limits< double >::epsilon()), double const h2=std::sqrt(std::sqrt(std::numeric_limits< double >::epsilon())))
 Find forward difference quotient estimates. More...
 
 ~ForwardDifferenceDerivativesEstimates ()=default
 Default destructor. More...
 
 ForwardDifferenceDerivativesEstimates (ForwardDifferenceDerivativesEstimates const &)=delete
 No copy constructor. More...
 
ForwardDifferenceDerivativesEstimatesoperator= (ForwardDifferenceDerivativesEstimates const &)=delete
 No copy operator. More...
 
 ForwardDifferenceDerivativesEstimates (ForwardDifferenceDerivativesEstimates &&de)
 Move constructor. More...
 
ForwardDifferenceDerivativesEstimatesoperator= (ForwardDifferenceDerivativesEstimates &&de)
 Move operator. More...
 
virtual void setVector (gsl::vector const &vector)
 Set the vector to a new value. More...
 
- Public Member Functions inherited from ipo_function::DerivativesEstimates
 DerivativesEstimates (size_t const size=0)
 Constructor. More...
 
virtual gsl::matrix hessian () const
 
- 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...
 
- Public Member Functions inherited from ipo_function::detail::ForwardDifferenceGradientEstimate
 ForwardDifferenceGradientEstimate (Function &function, double const h=std::sqrt(std::numeric_limits< double >::epsilon()))
 Find forward difference quotient estimates. More...
 

Protected Attributes

double const h2
 The quotient size for hessian estimates: default is fourth root of machine epsilon. More...
 
- Protected Attributes inherited from ipo_function::DerivativesEstimates
gsl::matrix functionHessian
 The Hessian value. 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...
 
- Protected Attributes inherited from ipo_function::detail::ForwardDifferenceGradientEstimate
Functionfunction
 The function. More...
 
double const h
 The qotient size. More...
 

Detailed Description

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

The function must be supplied as a 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.

Definition at line 46 of file ForwardDifferenceDerivativesEstimates.hpp.

Constructor & Destructor Documentation

ForwardDifferenceDerivativesEstimates::ForwardDifferenceDerivativesEstimates ( Function function,
double const  h = std::sqrt( std::numeric_limits<double>:: epsilon() ),
double const  h2 = std:: sqrt( 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
h2The quotient size for hessian estimates: default is fourth root of machine epsilon

Definition at line 29 of file ForwardDifferenceDerivativesEstimates.cc.

ipo_function::detail::ForwardDifferenceDerivativesEstimates::~ForwardDifferenceDerivativesEstimates ( )
default

Default destructor.

ipo_function::detail::ForwardDifferenceDerivativesEstimates::ForwardDifferenceDerivativesEstimates ( ForwardDifferenceDerivativesEstimates const &  )
delete

No copy constructor.

ipo_function::detail::ForwardDifferenceDerivativesEstimates::ForwardDifferenceDerivativesEstimates ( ForwardDifferenceDerivativesEstimates &&  de)

Move constructor.

Parameters
deAnother DerivativesEstimate

Member Function Documentation

ForwardDifferenceDerivativesEstimates& ipo_function::detail::ForwardDifferenceDerivativesEstimates::operator= ( ForwardDifferenceDerivativesEstimates const &  )
delete

No copy operator.

ForwardDifferenceDerivativesEstimates& ipo_function::detail::ForwardDifferenceDerivativesEstimates::operator= ( ForwardDifferenceDerivativesEstimates &&  de)

Move operator.

Parameters
deAnother DerivativesEstimate
void ForwardDifferenceDerivativesEstimates::setVector ( gsl::vector const &  vector)
virtual

Member Data Documentation

double const ipo_function::detail::ForwardDifferenceDerivativesEstimates::h2
protected

The quotient size for hessian estimates: default is fourth root of machine epsilon.

Definition at line 99 of file ForwardDifferenceDerivativesEstimates.hpp.

Referenced by setVector().


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