Interior-point-optimisation  1.0-1
Interior-pointoptimisationlibrary
ipo::detail::NewtonDescent Class Reference

Newton descent method. More...

#include <NewtonDescent.hpp>

Collaboration diagram for ipo::detail::NewtonDescent:
Collaboration graph

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...
 
ParametersgetParameters ()
 Get parameters by reference. More...
 
LineSearch::ParametersgetLineSearchParameters ()
 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::Functionfunction
 We need a copy of the function so that we can use LineSearch. More...
 
ipo_function::DerivativesEstimatesde
 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
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

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

Parameters
functionA copy of the function so that we can use LineSearch
deAn object that allows us to estimate function value and first and second derivatives
equalityConstraintsMatrixA matrix for the equality constraints
equalityConstraintsBoundsA vector for the equality constraint bounds
Exceptions
IPOExceptionif equalityConstraintsMatrix and equalityConstraintsBounds are inconsistent

Definition at line 51 of file NewtonDescent.cc.

Member Function Documentation

NewtonDescent::StoppingCondition NewtonDescent::getLastStoppingCondition ( ) const

Get Last stopping condition.

Returns
Stopping condition of last call to operator()()

Definition at line 295 of file NewtonDescent.cc.

References lastStoppingCondition.

LineSearch::Parameters & NewtonDescent::getLineSearchParameters ( )

Get line search parameters by reference.

Returns
parameters

Definition at line 38 of file NewtonDescent.cc.

References ipo::detail::LineSearch::getParameters(), and lineSearch.

NewtonDescent::Parameters & NewtonDescent::getParameters ( )

Get parameters by reference.

Returns
parameters

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 
)
void ipo::detail::NewtonDescent::setFunctionScale ( double const  functionScale)
inline

Set the scaling factor for output of function values.

This is used in InteriorPoint to show the value of the original function.

Parameters
functionScaleThe new value

Definition at line 251 of file NewtonDescent.hpp.

References functionScale.

Friends And Related Function Documentation

friend class Stopping
friend

Definition at line 279 of file NewtonDescent.hpp.

Member Data Documentation

gsl::matrix ipo::detail::NewtonDescent::A
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()().

gsl::vector ipo::detail::NewtonDescent::b
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()().

ipo_function::DerivativesEstimates& ipo::detail::NewtonDescent::de
protected

The object containing the function and derivatives estimates.

Definition at line 298 of file NewtonDescent.hpp.

Referenced by operator()().

gsl::matrix const ipo::detail::NewtonDescent::equalityConstraintsMatrix
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()().

ipo_function::Function& ipo::detail::NewtonDescent::function
protected

We need a copy of the function so that we can use LineSearch.

Definition at line 294 of file NewtonDescent.hpp.

double ipo::detail::NewtonDescent::functionScale
protected

Scaling factor for output of function values.

Definition at line 306 of file NewtonDescent.hpp.

Referenced by operator()(), and setFunctionScale().

StoppingCondition ipo::detail::NewtonDescent::lastStoppingCondition = StoppingCondition::noStopping
mutableprotected

Last stopping condition.

Definition at line 284 of file NewtonDescent.hpp.

Referenced by getLastStoppingCondition().

LineSearch ipo::detail::NewtonDescent::lineSearch
protected

We need a LineSearch object: backtracking line search.

Definition at line 302 of file NewtonDescent.hpp.

Referenced by getLineSearchParameters(), and operator()().

Parameters ipo::detail::NewtonDescent::parameters
private

Definition at line 220 of file NewtonDescent.hpp.

Referenced by getParameters(), and operator()().

gsl::vector ipo::detail::NewtonDescent::S
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()().

gsl::matrix ipo::detail::NewtonDescent::V
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()().

gsl::vector ipo::detail::NewtonDescent::work
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()().


The documentation for this class was generated from the following files: