bpp-core3  3.0.0
bpp::OneDimensionOptimizationTools Class Reference

Tools of one parameter-functions optimizations. More...

#include <Bpp/Numeric/Function/OneDimensionOptimizationTools.h>

Public Member Functions

 OneDimensionOptimizationTools ()
 
virtual ~OneDimensionOptimizationTools ()
 

Static Public Member Functions

static Bracket bracketMinimum (double a, double b, FunctionInterface &function, ParameterList parameters)
 Bracket a minimum. More...
 
static Bracket inwardBracketMinimum (double a, double b, FunctionInterface &function, ParameterList parameters, unsigned int intervalsNum=10)
 Bracket a minimum by a search within the parameter's bounds. More...
 
static unsigned int lineMinimization (std::shared_ptr< DirectionFunction > f1dim, ParameterList &parameters, std::vector< double > &xi, double tolerance, std::shared_ptr< OutputStream > profiler=nullptr, std::shared_ptr< OutputStream > messenger=nullptr, unsigned int verbose=2)
 
static unsigned int lineSearch (std::shared_ptr< DirectionFunction > f1dim, ParameterList &parameters, std::vector< double > &xi, std::vector< double > &gradient, std::shared_ptr< OutputStream > profiler=nullptr, std::shared_ptr< OutputStream > messenger=nullptr, unsigned int verbose=2)
 Search a 'sufficiently low' value for a function in a given direction. More...
 

Static Public Attributes

static double GLIMIT = 100.0
 Maximum magnification allowed for a parabolic-fit step. More...
 

Detailed Description

Tools of one parameter-functions optimizations.

For now, contains only one method to bracket a minimum.

Definition at line 57 of file OneDimensionOptimizationTools.h.

Constructor & Destructor Documentation

◆ OneDimensionOptimizationTools()

bpp::OneDimensionOptimizationTools::OneDimensionOptimizationTools ( )
inline

Definition at line 60 of file OneDimensionOptimizationTools.h.

◆ ~OneDimensionOptimizationTools()

virtual bpp::OneDimensionOptimizationTools::~OneDimensionOptimizationTools ( )
inlinevirtual

Definition at line 61 of file OneDimensionOptimizationTools.h.

Member Function Documentation

◆ bracketMinimum()

Bracket OneDimensionOptimizationTools::bracketMinimum ( double  a,
double  b,
FunctionInterface function,
ParameterList  parameters 
)
static

Bracket a minimum.

Given a function func, and given distinct initial points x1 and x2, this routine searches in the downhill direction (defined by the function as evaluated at the initial points) and returns a Bracket object with new points a.x, b.x and c.x that bracket a minimum of the function. Also returned are the function values at the three points, a.f, b.f and c.f.

Parameters
a,bTwo initial values for the parameter.
functionThe function to bracket.
parametersThe parameter to use as a variable.
Returns
A bracket object.

Definition at line 28 of file OneDimensionOptimizationTools.cpp.

References bpp::Bracket::a, bpp::NumTools::abs(), bpp::Bracket::b, bpp::Bracket::c, bpp::BracketPoint::f, bpp::NumConstants::GOLDEN_RATIO_PHI(), bpp::NumTools::max(), bpp::Bracket::setA(), bpp::Bracket::setB(), bpp::Bracket::setC(), bpp::NumTools::sign(), bpp::NumConstants::VERY_TINY(), and bpp::BracketPoint::x.

Referenced by bpp::GoldenSectionSearch::doInit(), and bpp::BrentOneDimension::doInit().

◆ inwardBracketMinimum()

Bracket OneDimensionOptimizationTools::inwardBracketMinimum ( double  a,
double  b,
FunctionInterface function,
ParameterList  parameters,
unsigned int  intervalsNum = 10 
)
static

Bracket a minimum by a search within the parameter's bounds.

This implementation follows numerical recipes, page 352, inwards bracketing

Parameters
a,bTwo initial values for the parameter.
functionThe function to bracket.
parametersThe parameter to use as a variable.
intervalsNumnumber of segments in which [a;b] is splitted.
Returns
A bracket object.

Definition at line 126 of file OneDimensionOptimizationTools.cpp.

References bpp::Bracket::a, bpp::Bracket::b, bpp::Bracket::c, bpp::BracketPoint::f, and bpp::BracketPoint::x.

Referenced by bpp::BrentOneDimension::doInit().

◆ lineMinimization()

◆ lineSearch()

unsigned int OneDimensionOptimizationTools::lineSearch ( std::shared_ptr< DirectionFunction f1dim,
ParameterList parameters,
std::vector< double > &  xi,
std::vector< double > &  gradient,
std::shared_ptr< OutputStream profiler = nullptr,
std::shared_ptr< OutputStream messenger = nullptr,
unsigned int  verbose = 2 
)
static

Search a 'sufficiently low' value for a function in a given direction.

This function performs a similar computation as the lnsrch function defined at page 385 of

NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING
(ISBN 0-521-43108-5)

without the stpmax argument, since the steps are bounded in another way.

Definition at line 215 of file OneDimensionOptimizationTools.cpp.

References bpp::ParameterList::addParameter(), bpp::AutoParameter::CONSTRAINTS_AUTO, bpp::AutoParameter::CONSTRAINTS_KEEP, bpp::AbstractOptimizer::getNumberOfEvaluations(), bpp::AbstractOptimizer::getStopCondition(), GLIMIT, bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::optimize(), bpp::AbstractOptimizer::setConstraintPolicy(), bpp::AbstractOptimizer::setMessageHandler(), bpp::AbstractOptimizer::setOptimizationProgressCharacter(), bpp::AbstractOptimizer::setProfiler(), bpp::AbstractOptimizer::setVerbose(), and bpp::ParameterList::size().

Referenced by bpp::BfgsMultiDimensions::doStep().

Member Data Documentation

◆ GLIMIT

double OneDimensionOptimizationTools::GLIMIT = 100.0
static

Maximum magnification allowed for a parabolic-fit step.

Definition at line 129 of file OneDimensionOptimizationTools.h.

Referenced by lineSearch().


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