20 #ifndef IPO_DETAIL_LINESEARCH_HPP
21 #define IPO_DETAIL_LINESEARCH_HPP
26 #include<ccgsl/blas.hpp>
27 #include"../../ipo_function/detail/ForwardDifferenceGradientEstimate.hpp"
54 double const beta = 0.8,
55 double const epsilon = std::sqrt( std::numeric_limits<double>::epsilon() ),
185 double const beta = 0.8,
186 double const epsilon = std::sqrt( std::numeric_limits<double>::epsilon() ),
187 size_t const maxNoImproveSteps = 10 );
201 gsl::vector
const direction,
203 gsl::vector
const gradientValue = gsl::vector(
nullptr ) );
double beta
A value in (0,1): usually quite big (0.1–0.8).
void setMaxNoImproveSteps(size_t maxNoImproveSteps)
Set the value of maxNoImproveSteps.
double functionScale
Scaling factor for output of function values.
size_t getVectorDigits() const
Get the value of vectorDigits.
double getAlpha() const
Get the value of alpha.
LineSearch(ipo_function::Function &function, 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 the line search function object with a function and some default parameters.
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 ...
std::ostream * outputStream
A stream (default is nullptr) for sending output to.
Backtracking line search.
Parameters & getParameters()
Get parameters by reference.
void setFunctionScale(double const functionScale)
Set the scaling factor for output of function values.
double operator()(gsl::vector &vector, gsl::vector const direction, double const functionValue=-std::numeric_limits< double >::infinity(), gsl::vector const gradientValue=gsl::vector(nullptr))
Carry out the line search.
void setVectorDigits(size_t const vectorDigits)
Set the number of significant digits of entries of vector to show in each step.
void setOutputStream(std::ostream *outputStream)
Set outputStream.
size_t vectorDigits
If this value is set to zero and outputStream is not null then vector arguments are not shown (more u...
This class computes a function at a vector.
void setBeta(double beta)
Set the value of beta.
double epsilon
A value for forward difference gradient estimates.
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.
void setEpsilon(double epsilon)
Set the value of epsilon.
void setAlpha(double alpha)
Set the value of alpha.
double getBeta() const
Get the value of beta.
size_t maxNoImproveSteps
Maximum number of nonimproving steps (default is 10).
std::ostream * getOutputStream() const
Get the current value of outputStream.
double getEpsilon() const
Get the value of epsilon.
size_t getMaxNoImproveSteps() const
Get the value of maxNoImproveSteps.
This namespace holds all the interior-point optimisation classes.