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

Line search parameters. More...

#include <NewtonDescent.hpp>

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

Public Member Functions

 Parameters ()
 Constructor: sets default values. More...
 
void setOutputStream (std::ostream *outputStream)
 Set outputStream. More...
 
std::ostream * getOutputStream () const
 Get the current value of outputStream. More...
 
bool getPhaseI () const
 
void setPhaseI (bool const phaseI)
 This function is designed to be used to help find an initial (phase I) feasible solution. More...
 
void setGradTol (double const gradTol)
 Set the value of gradTol. More...
 
void setStepTol (double const stepTol)
 Set the value of stepTol. More...
 
void setIterMax (size_t const iterMax)
 Set the value of iterMax. More...
 
void setf_typ (double const f_typ)
 Set the value of typical value of function. More...
 
void setx_typ (gsl::vector x_typ)
 Set the value of typical value of argument. More...
 
double getGradTol () const
 Get the value of gradTol. More...
 
double getStepTol () const
 Get the value of stepTol. More...
 
size_t getIterMax () const
 Get the value of iterMax. More...
 
double getf_typ () const
 Get the value of typical value of function. More...
 
gsl::vector getx_typ () const
 Get the value of typical value of argument. More...
 
void setVectorDigits (size_t const vectorDigits)
 Set the number of significant digits of entries of vector to show in each Newton step. More...
 
size_t getVectorDigits () const
 Get the value of vectorDigits. More...
 

Private Attributes

std::ostream * outputStream
 A stream (default is nullptr) for sending output to. More...
 
bool phaseI
 This value Is normally set to false. More...
 
double gradTol
 The Newton descent needs a stopping condition. More...
 
double stepTol
 The Newton descent needs a stopping condition. More...
 
size_t iterMax
 The Newton descent needs a stopping condition. More...
 
double f_typ
 Typical function value: default is 1. More...
 
gsl::vector x_typ
 Typical argument value: default is no unspecified vector (evaluates to false), which is interpreted as a vector of ones of length matching argument supplied. More...
 
size_t vectorDigits
 If this value is set to zero and outputStream is not null then vector arguments are not shown (more useful if the argument is large). More...
 

Detailed Description

Line search parameters.

These control how line search works in detail and whether and where any output is produced.

Definition at line 56 of file NewtonDescent.hpp.

Constructor & Destructor Documentation

NewtonDescent::Parameters::Parameters ( )

Constructor: sets default values.

Definition at line 40 of file NewtonDescent.cc.

References setf_typ(), setGradTol(), setIterMax(), setOutputStream(), setPhaseI(), setStepTol(), setVectorDigits(), and setx_typ().

Member Function Documentation

double ipo::detail::NewtonDescent::Parameters::getf_typ ( ) const
inline

Get the value of typical value of function.

Returns
The value of f_typ

Definition at line 132 of file NewtonDescent.hpp.

References f_typ.

Referenced by ipo::detail::NewtonDescent::Stopping::operator()().

double ipo::detail::NewtonDescent::Parameters::getGradTol ( ) const
inline

Get the value of gradTol.

Returns
The value of gradTol

Definition at line 117 of file NewtonDescent.hpp.

References gradTol.

Referenced by ipo::detail::NewtonDescent::Stopping::operator()().

size_t ipo::detail::NewtonDescent::Parameters::getIterMax ( ) const
inline

Get the value of iterMax.

Returns
The value of iterMax

Definition at line 127 of file NewtonDescent.hpp.

References iterMax.

std::ostream * NewtonDescent::Parameters::getOutputStream ( ) const

Get the current value of outputStream.

Returns
The current value of outputStream

Definition at line 231 of file NewtonDescent.cc.

Referenced by ipo::detail::NewtonDescent::operator()().

bool ipo::detail::NewtonDescent::Parameters::getPhaseI ( ) const
inline
Returns
true or false according as phaseI is true or not

Definition at line 75 of file NewtonDescent.hpp.

References phaseI.

Referenced by ipo::detail::NewtonDescent::operator()().

double ipo::detail::NewtonDescent::Parameters::getStepTol ( ) const
inline

Get the value of stepTol.

Returns
The value of stepTol

Definition at line 122 of file NewtonDescent.hpp.

References stepTol.

size_t ipo::detail::NewtonDescent::Parameters::getVectorDigits ( ) const
inline

Get the value of vectorDigits.

See also
setVectorDigits
Returns
The value of vectorDigits

Definition at line 151 of file NewtonDescent.hpp.

References vectorDigits.

Referenced by ipo::detail::NewtonDescent::operator()().

gsl::vector ipo::detail::NewtonDescent::Parameters::getx_typ ( ) const
inline

Get the value of typical value of argument.

Returns
The value of x_typ

Definition at line 137 of file NewtonDescent.hpp.

References x_typ.

Referenced by ipo::detail::NewtonDescent::Stopping::operator()().

void ipo::detail::NewtonDescent::Parameters::setf_typ ( double const  f_typ)
inline

Set the value of typical value of function.

Parameters
f_typThe new value of f_typ

Definition at line 107 of file NewtonDescent.hpp.

References f_typ.

Referenced by Parameters().

void ipo::detail::NewtonDescent::Parameters::setGradTol ( double const  gradTol)
inline

Set the value of gradTol.

Parameters
gradTolThe new value of gradTol

Definition at line 92 of file NewtonDescent.hpp.

References gradTol.

Referenced by Parameters().

void ipo::detail::NewtonDescent::Parameters::setIterMax ( size_t const  iterMax)
inline

Set the value of iterMax.

Parameters
iterMaxThe new value of iterMax

Definition at line 102 of file NewtonDescent.hpp.

References iterMax.

Referenced by Parameters().

void NewtonDescent::Parameters::setOutputStream ( std::ostream *  outputStream)

Set outputStream.

Set this to point to an output stream to record progress.

Parameters
outputStreamThe new value

Definition at line 226 of file NewtonDescent.cc.

Referenced by Parameters().

void ipo::detail::NewtonDescent::Parameters::setPhaseI ( bool const  phaseI)
inline

This function is designed to be used to help find an initial (phase I) feasible solution.

Normally phaseI is set to false. But, in phase I of interior-point, the optimisation can stop as soon as a solution is found that is feasible in the original model. Set phaseI to true to achieve this.

In practice, this parameter is not set explicitly by the end developer, but is set internally in PhaseIModel.

Parameters
phaseISet true or false

Definition at line 87 of file NewtonDescent.hpp.

References phaseI.

Referenced by ipo::detail::PhaseIModel::findFeasibleSolution(), and Parameters().

void ipo::detail::NewtonDescent::Parameters::setStepTol ( double const  stepTol)
inline

Set the value of stepTol.

Parameters
stepTolThe new value of stepTol

Definition at line 97 of file NewtonDescent.hpp.

References stepTol.

Referenced by Parameters().

void ipo::detail::NewtonDescent::Parameters::setVectorDigits ( size_t const  vectorDigits)
inline

Set the number of significant digits of entries of vector to show in each Newton step.

If this is set to zero or outputStream is null then no vector output is shown.

Parameters
vectorDigitsThe new value for vector significant digits

Definition at line 144 of file NewtonDescent.hpp.

References vectorDigits.

Referenced by Parameters().

void ipo::detail::NewtonDescent::Parameters::setx_typ ( gsl::vector  x_typ)
inline

Set the value of typical value of argument.

Parameters
x_typThe new value of x_typ

Definition at line 112 of file NewtonDescent.hpp.

References x_typ.

Referenced by Parameters().

Member Data Documentation

double ipo::detail::NewtonDescent::Parameters::f_typ
private

Typical function value: default is 1.

This value is used together with gradTol so that we can compute the relative gradient plausibly even when the gradient is close to zero.

Definition at line 204 of file NewtonDescent.hpp.

Referenced by getf_typ(), and setf_typ().

double ipo::detail::NewtonDescent::Parameters::gradTol
private

The Newton descent needs a stopping condition.

This value is used in one of three. If any are satistfied then the algorithm stops. See Dennis and Schnabel, Numerical Mehods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, Chapter 7 for further details.

The algorithm stops if the absolute value of the maximum element of the relative gradient is at most this value (gradient tolerance).

Definition at line 176 of file NewtonDescent.hpp.

Referenced by getGradTol(), and setGradTol().

size_t ipo::detail::NewtonDescent::Parameters::iterMax
private

The Newton descent needs a stopping condition.

This value is used in one of three. If any are satistfied then the algorithm stops. See Dennis and Schnabel, Numerical Mehods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, Chapter 7 for further details.

The maximum number of search steps: default is 10000. This is the most problematic of the three stopping conditions because if it is met the Newton Search has stopped outside the specified numerical tolerance.

Definition at line 198 of file NewtonDescent.hpp.

Referenced by getIterMax(), and setIterMax().

std::ostream* ipo::detail::NewtonDescent::Parameters::outputStream
private

A stream (default is nullptr) for sending output to.

If this is set then the value of the objective function at each step of the Newton descent algorithm is shown, together with the vector at which the objective obtains this value if vectorDigits is set to a positive value.

Definition at line 159 of file NewtonDescent.hpp.

bool ipo::detail::NewtonDescent::Parameters::phaseI
private

This value Is normally set to false.

But it can be set to true so that Newton descent stops when the final component of the vector is negative. This is useful in phase 1 of an interior point optimisation because the optimum solution may be unbounded but we only require a feasible solution.

Definition at line 166 of file NewtonDescent.hpp.

Referenced by getPhaseI(), and setPhaseI().

double ipo::detail::NewtonDescent::Parameters::stepTol
private

The Newton descent needs a stopping condition.

This value is used in one of three. If any are satistfied then the algorithm stops. See Dennis and Schnabel, Numerical Mehods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, Chapter 7 for further details.

The algorithm stops if the relative step size gets less than this value (step tolerance). The step size is the maximum size of a change in the objective argument from one step to the next.

Definition at line 187 of file NewtonDescent.hpp.

Referenced by getStepTol(), and setStepTol().

size_t ipo::detail::NewtonDescent::Parameters::vectorDigits
private

If this value is set to zero and outputStream is not null then vector arguments are not shown (more useful if the argument is large).

Otherwise this value determines the number of significant digits that are shown with each vector entry.

Definition at line 217 of file NewtonDescent.hpp.

Referenced by getVectorDigits(), and setVectorDigits().

gsl::vector ipo::detail::NewtonDescent::Parameters::x_typ
private

Typical argument value: default is no unspecified vector (evaluates to false), which is interpreted as a vector of ones of length matching argument supplied.

This value is used together with stepTol so that we can compute the relative step size plausibly even when the objective argument is close to zero.

Definition at line 211 of file NewtonDescent.hpp.

Referenced by getx_typ(), and setx_typ().


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