|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
This class has two purposes. More...
#include <Sum.hpp>


Public Member Functions | |
| Sum (size_t const size=0) | |
| Specify a constructor argument if you want to be able to check the size of the argument in a Model Objective or Constraint and do not need this size to vary. More... | |
| double | operator() (gsl::vector const &vector) |
| The function operator: computes the sum of the vector entries. More... | |
| gsl::vector | gradient (gsl::vector const &vector) |
| The function operator: returns the gradient: a vector of 1s. More... | |
| gsl::matrix | hessian (gsl::vector const &vector) |
| The function operator: returns the Hessian: a matrix of 0s. 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 |
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... | |
This class has two purposes.
First it provides a plausibly useful Function dependent on a size parameter. Second, it provides an example of how a Function might efficiently be constructed. The class computes the sum of the entries in a vector together with the first and second derivatives.
| Sum::Sum | ( | size_t const | size = 0 | ) |
|
virtual |
The function operator: returns the gradient: a vector of 1s.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 46 of file Sum.cc.
References ipo_function::GradientEstimate::functionGradient, and ipo_function::detail::FunctionBase::getSize().
|
virtual |
The function operator: returns the Hessian: a matrix of 0s.
| vector | A vector argument |
Reimplemented from ipo_function::Function.
Definition at line 58 of file Sum.cc.
References ipo_function::DerivativesEstimates::functionHessian, and ipo_function::detail::FunctionBase::getSize().
|
virtual |
The function operator: computes the sum of the vector entries.
| vector | A vector argument |
Implements ipo_function::Function.
|
virtual |
Set a vector and compute function value, gradient and Hessian efficiently.
| vector | A vector argument |
Implements ipo_function::GradientEstimate.
Definition at line 70 of file Sum.cc.
References ipo_function::GradientEstimate::functionGradient, ipo_function::DerivativesEstimates::functionHessian, ipo_function::GradientEstimate::functionValue, and ipo_function::detail::FunctionBase::getSize().