|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
This class estimates a function value, gradient and Hessian at a given vector. More...
#include <ForwardDifferenceGradientEstimate.hpp>


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 | |
| Function & | function |
| 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... | |
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.
Definition at line 47 of file ForwardDifferenceGradientEstimate.hpp.
| ForwardDifferenceGradientEstimate::ForwardDifferenceGradientEstimate | ( | Function & | function, |
| double const | h = std::sqrt( std::numeric_limits<double>:: epsilon() ) |
||
| ) |
Find forward difference quotient estimates.
| function | This is the function whose derivatives we estimate |
| h | The quotient size: default is square root of machine epsilon |
Definition at line 28 of file ForwardDifferenceGradientEstimate.cc.
|
virtual |
Set the vector to a new value.
| vector | The new vector value |
Implements ipo_function::GradientEstimate.
Reimplemented in ipo_function::detail::ForwardDifferenceDerivativesEstimates.
Definition at line 33 of file ForwardDifferenceGradientEstimate.cc.
References ipo_function::GradientEstimate::functionGradient, ipo_function::GradientEstimate::functionValue, ipo_function::detail::FunctionBase::getSize(), and h.
Referenced by ipo::detail::LineSearch::operator()(), and ipo_function::detail::ForwardDifferenceDerivativesEstimates::setVector().
|
protected |
The function.
Definition at line 66 of file ForwardDifferenceGradientEstimate.hpp.
|
protected |
The qotient size.
Definition at line 70 of file ForwardDifferenceGradientEstimate.hpp.
Referenced by setVector().