|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
Function for Phase I (feasibility) of interior-point optimisation. More...
#include <PhaseIFunctionAndDerivatives.hpp>


Public Member Functions | |
| PhaseIFunctionAndDerivatives (Function &function, double const b, bool const upperBound) | |
| Construct from a function and bound. More... | |
| double | operator() (gsl::vector const &vector) |
The function operator: computes or according as is an upper or lower bound. More... | |
| gsl::vector | gradient (gsl::vector const &vector) |
| The function operator: returns the gradient. More... | |
| gsl::matrix | hessian (gsl::vector const &vector) |
| The function operator: returns the Hessian. More... | |
| void | setVector (gsl::vector const &vector) |
| Set a vector and compute function value, gradient and Hessian efficiently. More... | |
Public Member Functions inherited from ipo_function::Function | |
| Function (size_t const size=0) | |
| Constructor. More... | |
| virtual std::tuple < gsl::vector, gsl::matrix > | derivatives (gsl::vector const &vector) |
| Compute or estimate derivative values. More... | |
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::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 |
Private Attributes | |
| Function & | function |
| The function. More... | |
| double const | b |
| The bound. More... | |
| bool const | upperBound |
| A boolean value: true or false according as b is an upper bound or lower. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ipo_function::Function | |
| double | h = std::sqrt( std::numeric_limits<double>::epsilon() ) |
| Value used for default gradient estimates. More... | |
| double | h2 = std::sqrt( h ) |
| Value used for default Hessian estimates. 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::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... | |
Function for Phase I (feasibility) of interior-point optimisation.
Take a Function object and upper or lower bound and construct a function whose argument takes one extra element at the end. If the original function is
, the extra element is
and the bound is
, the function is
or
according as
is an upper or lower bound.
This class also computes derivatives.
Definition at line 38 of file PhaseIFunctionAndDerivatives.hpp.
| PhaseIFunctionAndDerivatives::PhaseIFunctionAndDerivatives | ( | Function & | function, |
| double const | b, | ||
| bool const | upperBound | ||
| ) |
Construct from a function and bound.
| function | The function |
| b | The bound |
| upperBound | true or false according as b is an upper bound or lower |
Definition at line 28 of file PhaseIFunctionAndDerivatives.cc.
References ipo_function::detail::FunctionBase::getSize().
|
virtual |
The function operator: returns the gradient.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 58 of file PhaseIFunctionAndDerivatives.cc.
References ipo_function::GradientEstimate::functionGradient, ipo_function::detail::FunctionBase::getSize(), and upperBound.
|
virtual |
The function operator: returns the Hessian.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 87 of file PhaseIFunctionAndDerivatives.cc.
References ipo_function::DerivativesEstimates::functionHessian, ipo_function::detail::FunctionBase::getSize(), ipo_function::Function::h, upperBound, and ipo_function::GradientEstimate::value().
|
virtual |
The function operator: computes
or
according as
is an upper or lower bound.
| vector | A vector argument |
Implements ipo_function::Function.
Definition at line 39 of file PhaseIFunctionAndDerivatives.cc.
References b, ipo_function::detail::FunctionBase::getSize(), and upperBound.
|
virtual |
Set a vector and compute function value, gradient and Hessian efficiently.
| vector | A vector argument |
Implements ipo_function::GradientEstimate.
Definition at line 129 of file PhaseIFunctionAndDerivatives.cc.
References b, function, ipo_function::GradientEstimate::functionGradient, ipo_function::DerivativesEstimates::functionHessian, ipo_function::GradientEstimate::functionValue, ipo_function::detail::FunctionBase::getSize(), ipo_function::GradientEstimate::gradient(), ipo_function::Function::h, ipo_function::DerivativesEstimates::hessian(), and upperBound.
|
private |
The bound.
Definition at line 83 of file PhaseIFunctionAndDerivatives.hpp.
Referenced by operator()(), and setVector().
|
private |
The function.
Definition at line 79 of file PhaseIFunctionAndDerivatives.hpp.
Referenced by setVector().
|
private |
A boolean value: true or false according as b is an upper bound or lower.
Definition at line 88 of file PhaseIFunctionAndDerivatives.hpp.
Referenced by gradient(), hessian(), operator()(), and setVector().