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


Public Member Functions | |
| PhaseIBoundedVariableFunctionAndDerivatives (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.
This represents a variable with an upper or lower bound b. The function takes as an argument a vector of size 2 whose first element represents the variable
and whose second represents the variable
used in phase I. If the variable has bound
, the function is
or
according as
is an upper or lower bound.
The variable
is not supplied, but should be assigned in a Constraint object. The extra cost of creating a vector of size 2 to supply as an argument to setVector() should normally be low in comparison to the cost of copying large vectors and matrices. And, if we passed a vector of all the variables of a PhaseIModel object as argument to setVector, we would have to copy a large vector and matrix. Hence, this class is designed for a reasonable compromise. It gives better efficiency for larger problems.
This class also computes derivatives.
Definition at line 47 of file PhaseIBoundedVariableFunctionAndDerivatives.hpp.
| PhaseIBoundedVariableFunctionAndDerivatives::PhaseIBoundedVariableFunctionAndDerivatives | ( | double const | b, |
| bool const | upperBound | ||
| ) |
Construct from a function and bound.
| b | The bound |
| upperBound | true or false according as b is an upper bound or lower |
Definition at line 29 of file PhaseIBoundedVariableFunctionAndDerivatives.cc.
|
virtual |
The function operator: returns the gradient.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 55 of file PhaseIBoundedVariableFunctionAndDerivatives.cc.
References ipo_function::GradientEstimate::functionGradient.
|
virtual |
The function operator: returns the Hessian.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 60 of file PhaseIBoundedVariableFunctionAndDerivatives.cc.
References ipo_function::DerivativesEstimates::functionHessian.
|
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 43 of file PhaseIBoundedVariableFunctionAndDerivatives.cc.
References b, 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 65 of file PhaseIBoundedVariableFunctionAndDerivatives.cc.
References b, ipo_function::GradientEstimate::functionValue, and upperBound.
|
private |
The bound.
Definition at line 92 of file PhaseIBoundedVariableFunctionAndDerivatives.hpp.
Referenced by operator()(), and setVector().
|
private |
The function.
Definition at line 88 of file PhaseIBoundedVariableFunctionAndDerivatives.hpp.
|
private |
A boolean value: true or false according as b is an upper bound or lower.
Definition at line 97 of file PhaseIBoundedVariableFunctionAndDerivatives.hpp.
Referenced by operator()(), and setVector().