|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
Newton descent method. More...
#include <NewtonDescent.hpp>

Classes | |
| class | Parameters |
| Line search parameters. More... | |
| class | Stopping |
| This class allows us to test suitable stopping conditions. More... | |
Public Types | |
| enum | StoppingCondition { StoppingCondition::gradTol, StoppingCondition::stepTol, StoppingCondition::iterMax, StoppingCondition::noStopping } |
| Enumeration for stopping conditions. More... | |
Public Member Functions | |
| NewtonDescent (ipo_function::Function &function, ipo_function::DerivativesEstimates &de, gsl::matrix const equalityConstraintsMatrix=gsl::matrix(), gsl::vector const equalityConstraintsBounds=gsl::vector()) | |
| The constructor needs a Function and a DerivativesEstimates (which may be identical). More... | |
| double | operator() (gsl::vector &x, double objectiveValue) |
| The function object operator. More... | |
| void | setFunctionScale (double const functionScale) |
| Set the scaling factor for output of function values. More... | |
| StoppingCondition | getLastStoppingCondition () const |
| Get Last stopping condition. More... | |
| Parameters & | getParameters () |
| Get parameters by reference. More... | |
| LineSearch::Parameters & | getLineSearchParameters () |
| Get line search parameters by reference. More... | |
Protected Attributes | |
| StoppingCondition | lastStoppingCondition = StoppingCondition::noStopping |
| Last stopping condition. More... | |
| gsl::matrix const | equalityConstraintsMatrix |
| This must be set in the constructor. More... | |
| ipo_function::Function & | function |
| We need a copy of the function so that we can use LineSearch. More... | |
| ipo_function::DerivativesEstimates & | de |
| The object containing the function and derivatives estimates. More... | |
| LineSearch | lineSearch |
| We need a LineSearch object: backtracking line search. More... | |
| double | functionScale |
| Scaling factor for output of function values. More... | |
| gsl::matrix | A |
| This matrix is used in singular value decompostion and its size is set in constructor if it is needed. More... | |
| gsl::matrix | V |
| This matrix is used in singular value decompostion and its size is set in constructor if it is needed. More... | |
| gsl::vector | S |
| This vector is used in singular value decompostion and its size is set in constructor if it is needed. More... | |
| gsl::vector | work |
| This vector is used in singular value decompostion and its size is set in constructor if it is needed. More... | |
| gsl::vector | b |
| This vector is used in singular value decompostion and its size is set in constructor if it is needed. More... | |
Private Attributes | |
| Parameters | parameters |
Friends | |
| class | Stopping |
Newton descent method.
An object of this class takes a function as its parameter and attempts to use Newton descent to minimise the function. The stopping criterion is: stop when the absolute size of the estimated gradient is no more than the square root of eta. The default value for eta is square root of machine epsilon.
The class uses DerivativesEstimates to estimate gradients and Hessians numerically and is designed to work well when the function has a single local minimum and continuous first and second derivates.
The function can summarise its own progress through the outputStream parameter. Its default value of nullptr prevents output.
Definition at line 50 of file NewtonDescent.hpp.
|
strong |
Enumeration for stopping conditions.
| Enumerator | |
|---|---|
| gradTol |
Gradient tolerance reached. |
| stepTol |
Relative step size tolerance reached. |
| iterMax |
Maximum iterations reached. |
| noStopping |
No stopping condition reached. |
Definition at line 256 of file NewtonDescent.hpp.
| NewtonDescent::NewtonDescent | ( | ipo_function::Function & | function, |
| ipo_function::DerivativesEstimates & | de, | ||
| gsl::matrix const | equalityConstraintsMatrix = gsl::matrix(), |
||
| gsl::vector const | equalityConstraintsBounds = gsl::vector() |
||
| ) |
The constructor needs a Function and a DerivativesEstimates (which may be identical).
It also needs a matrix and bounds for equality constraints if there are any. If a matrix and vector are supplied they must have numbers of columns or entries equal and equal to the length of vector expected by function and de
| function | A copy of the function so that we can use LineSearch |
| de | An object that allows us to estimate function value and first and second derivatives |
| equalityConstraintsMatrix | A matrix for the equality constraints |
| equalityConstraintsBounds | A vector for the equality constraint bounds |
| IPOException | if equalityConstraintsMatrix and equalityConstraintsBounds are inconsistent |
Definition at line 51 of file NewtonDescent.cc.
| NewtonDescent::StoppingCondition NewtonDescent::getLastStoppingCondition | ( | ) | const |
Get Last stopping condition.
Definition at line 295 of file NewtonDescent.cc.
References lastStoppingCondition.
| LineSearch::Parameters & NewtonDescent::getLineSearchParameters | ( | ) |
Get line search parameters by reference.
Definition at line 38 of file NewtonDescent.cc.
References ipo::detail::LineSearch::getParameters(), and lineSearch.
| NewtonDescent::Parameters & NewtonDescent::getParameters | ( | ) |
Get parameters by reference.
Definition at line 35 of file NewtonDescent.cc.
References parameters.
Referenced by ipo::detail::NewtonDescent::Stopping::operator()(), and ipo::Model::optimise().
| double NewtonDescent::operator() | ( | gsl::vector & | x, |
| double | objectiveValue | ||
| ) |
The function object operator.
This operates on a vector x. On return x is replaced with its new value.
| x | The vector |
| objectiveValue | The objective function evaluated at x |
Definition at line 95 of file NewtonDescent.cc.
References A, b, de, equalityConstraintsMatrix, functionScale, ipo::detail::NewtonDescent::Parameters::getOutputStream(), ipo::detail::NewtonDescent::Parameters::getPhaseI(), ipo::detail::NewtonDescent::Parameters::getVectorDigits(), ipo_function::GradientEstimate::gradient(), ipo_function::DerivativesEstimates::hessian(), IPOE, lineSearch, ipo::detail::modelHessian(), parameters, S, ipo::detail::LineSearch::setFunctionScale(), ipo_function::GradientEstimate::setVector(), V, ipo_function::GradientEstimate::value(), and work.
|
inline |
Set the scaling factor for output of function values.
This is used in InteriorPoint to show the value of the original function.
| functionScale | The new value |
Definition at line 251 of file NewtonDescent.hpp.
References functionScale.
|
friend |
Definition at line 279 of file NewtonDescent.hpp.
|
protected |
This matrix is used in singular value decompostion and its size is set in constructor if it is needed.
Definition at line 311 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
This vector is used in singular value decompostion and its size is set in constructor if it is needed.
Definition at line 331 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
The object containing the function and derivatives estimates.
Definition at line 298 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
This must be set in the constructor.
Set to null matrix or to have 0 rows to solve a problem without equality constraints. Otherwise set these equality constraints.
Definition at line 290 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
We need a copy of the function so that we can use LineSearch.
Definition at line 294 of file NewtonDescent.hpp.
|
protected |
Scaling factor for output of function values.
Definition at line 306 of file NewtonDescent.hpp.
Referenced by operator()(), and setFunctionScale().
|
mutableprotected |
Last stopping condition.
Definition at line 284 of file NewtonDescent.hpp.
Referenced by getLastStoppingCondition().
|
protected |
We need a LineSearch object: backtracking line search.
Definition at line 302 of file NewtonDescent.hpp.
Referenced by getLineSearchParameters(), and operator()().
|
private |
Definition at line 220 of file NewtonDescent.hpp.
Referenced by getParameters(), and operator()().
|
protected |
This vector is used in singular value decompostion and its size is set in constructor if it is needed.
Definition at line 321 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
This matrix is used in singular value decompostion and its size is set in constructor if it is needed.
Definition at line 316 of file NewtonDescent.hpp.
Referenced by operator()().
|
protected |
This vector is used in singular value decompostion and its size is set in constructor if it is needed.
Definition at line 326 of file NewtonDescent.hpp.
Referenced by operator()().