|
Interior-point-optimisation
1.0-1
Interior-pointoptimisationlibrary
|
Line search parameters. More...
#include <LineSearch.hpp>

Public Member Functions | |
| Parameters (double const alpha=1e-3, double const beta=0.8, double const epsilon=std::sqrt(std::numeric_limits< double >::epsilon()), size_t const maxNoImproveSteps=10) | |
| Set up some default parameters. More... | |
| void | setAlpha (double alpha) |
| Set the value of alpha. More... | |
| void | setBeta (double beta) |
| Set the value of beta. More... | |
| void | setEpsilon (double epsilon) |
| Set the value of epsilon. More... | |
| void | setMaxNoImproveSteps (size_t maxNoImproveSteps) |
| Set the value of maxNoImproveSteps. More... | |
| double | getAlpha () const |
| Get the value of alpha. More... | |
| double | getBeta () const |
| Get the value of beta. More... | |
| double | getEpsilon () const |
| Get the value of epsilon. More... | |
| size_t | getMaxNoImproveSteps () const |
| Get the value of maxNoImproveSteps. More... | |
| void | setVectorDigits (size_t const vectorDigits) |
| Set the number of significant digits of entries of vector to show in each step. More... | |
| size_t | getVectorDigits () const |
| Get the value of vectorDigits. More... | |
| void | setOutputStream (std::ostream *outputStream) |
| Set outputStream. More... | |
| std::ostream * | getOutputStream () const |
| Get the current value of outputStream. More... | |
Private Attributes | |
| double | alpha |
| A value in (0,0.5): usually quite small 0.0001–0.3 (default 1e-3 though 1e-4 is suggested in Dennis and Schnabel Numerical Mehods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, Chapter 6). More... | |
| double | beta |
| A value in (0,1): usually quite big (0.1–0.8). More... | |
| double | epsilon |
| A value for forward difference gradient estimates. More... | |
| size_t | maxNoImproveSteps |
| Maximum number of nonimproving steps (default is 10). 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... | |
| std::ostream * | outputStream |
| A stream (default is nullptr) for sending output to. More... | |
Line search parameters.
These control how line search works in detail and whether and where any output is produced.
Definition at line 42 of file LineSearch.hpp.
| LineSearch::Parameters::Parameters | ( | double const | alpha = 1e-3, |
| double const | beta = 0.8, |
||
| double const | epsilon = std::sqrt( std::numeric_limits<double>::epsilon() ), |
||
| size_t const | maxNoImproveSteps = 10 |
||
| ) |
Set up some default parameters.
| alpha | A value in (0,0.5) |
| beta | A value in (0,1) |
| epsilon | A value to be used if the gradient is not supplied in the function operator call |
| maxNoImproveSteps | The maximum number of backtracing steps to accept with no consecutive improvements |
Definition at line 28 of file LineSearch.cc.
References setAlpha(), setBeta(), setEpsilon(), setMaxNoImproveSteps(), setOutputStream(), and setVectorDigits().
| double LineSearch::Parameters::getAlpha | ( | ) | const |
Get the value of alpha.
Definition at line 67 of file LineSearch.cc.
Referenced by ipo::detail::LineSearch::operator()().
| double LineSearch::Parameters::getBeta | ( | ) | const |
Get the value of beta.
Definition at line 72 of file LineSearch.cc.
Referenced by ipo::detail::LineSearch::operator()().
| double LineSearch::Parameters::getEpsilon | ( | ) | const |
Get the value of epsilon.
Definition at line 77 of file LineSearch.cc.
Referenced by ipo::detail::LineSearch::operator()().
| size_t LineSearch::Parameters::getMaxNoImproveSteps | ( | ) | const |
Get the value of maxNoImproveSteps.
Definition at line 218 of file LineSearch.cc.
Referenced by ipo::detail::LineSearch::operator()().
|
inline |
Get the current value of outputStream.
Definition at line 121 of file LineSearch.hpp.
References outputStream.
Referenced by ipo::detail::LineSearch::operator()().
|
inline |
Get the value of vectorDigits.
Definition at line 110 of file LineSearch.hpp.
References vectorDigits.
Referenced by ipo::detail::LineSearch::operator()().
| void LineSearch::Parameters::setAlpha | ( | double | alpha | ) |
Set the value of alpha.
| alpha | The new value |
Definition at line 47 of file LineSearch.cc.
References alpha.
Referenced by Parameters().
| void LineSearch::Parameters::setBeta | ( | double | beta | ) |
Set the value of beta.
| beta | The new value |
Definition at line 54 of file LineSearch.cc.
Referenced by Parameters().
| void LineSearch::Parameters::setEpsilon | ( | double | epsilon | ) |
Set the value of epsilon.
| epsilon | The new value |
Definition at line 61 of file LineSearch.cc.
Referenced by Parameters().
| void LineSearch::Parameters::setMaxNoImproveSteps | ( | size_t | maxNoImproveSteps | ) |
Set the value of maxNoImproveSteps.
| maxNoImproveSteps | The new value |
Definition at line 213 of file LineSearch.cc.
Referenced by Parameters().
|
inline |
Set outputStream.
Set this to point to an output stream to record progress.
| outputStream | The new value |
Definition at line 115 of file LineSearch.hpp.
References outputStream.
Referenced by Parameters().
|
inline |
Set the number of significant digits of entries of vector to show in each step.
If this is set to zero or outputStream is null then no vector output is shown.
| vectorDigits | The new value for vector significant digits |
Definition at line 103 of file LineSearch.hpp.
References vectorDigits.
Referenced by Parameters().
|
private |
A value in (0,0.5): usually quite small 0.0001–0.3 (default 1e-3 though 1e-4 is suggested in Dennis and Schnabel Numerical Mehods for Unconstrained Optimization and Nonlinear Equations, SIAM, 1996, Chapter 6).
For further details, see Boyd and Vandenberghe, Convex Optimization, Cambridge University Press, 2004.
Definition at line 132 of file LineSearch.hpp.
Referenced by setAlpha().
|
private |
A value in (0,1): usually quite big (0.1–0.8).
The default is 0.8, which corresponds to a crude search.
For further details, see Boyd and Vandenberghe, Convex Optimization, Cambridge University Press, 2004.
Definition at line 140 of file LineSearch.hpp.
|
private |
A value for forward difference gradient estimates.
This is only used if the gradient() or hessian() function is not supplied. Then the linesearch needs to estimate a gradient and uses epsilon. The default value is machine epsilon. Typically this should not be changed and ideally gradient approximations should be avoided.
Definition at line 148 of file LineSearch.hpp.
|
private |
Maximum number of nonimproving steps (default is 10).
Definition at line 152 of file LineSearch.hpp.
|
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 backtracking line search algorithm is shown, together with the vector at which the objective obtains this value if vectorDigits is set to a positive value.
Note that NaN (nan or not-a-number) values may appear on the output because the initial Newton step may be large enough to produce an infeasible vector. The line search continues to reduce the step size until it finds a feasible one.
Definition at line 169 of file LineSearch.hpp.
Referenced by getOutputStream(), and setOutputStream().
|
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 158 of file LineSearch.hpp.
Referenced by getVectorDigits(), and setVectorDigits().