bpp-core3
3.0.0
|
Broyden–Fletcher–Goldfarb–Shanno (BFGS) optimization method. More...
#include <Bpp/Numeric/Function/BfgsMultiDimensions.h>
Public Member Functions | |
BfgsMultiDimensions (DerivableFirstOrder *function) | |
virtual | ~BfgsMultiDimensions () |
BfgsMultiDimensions * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
void | getGradient (std::vector< double > &gradient) const |
void | updateParameters (bool yn) |
Tell if we shall update all parameters after one optimization step. More... | |
bool | updateParameters () const |
Tell if we shall update all parameters after one optimization step. More... | |
void | setOptimizationProgressCharacter (const std::string &c) |
Set the character to be displayed during optimization. More... | |
const std::string & | getOptimizationProgressCharacter () const |
From AbstractOptimizer. | |
const DerivableFirstOrder * | getFunction () const |
Get the current function being optimized. More... | |
DerivableFirstOrder * | getFunction () |
Get the current function being optimized. More... | |
void | doInit (const ParameterList ¶ms) |
This function is called by the init() method and contains all calculations. More... | |
double | doStep () |
This function is called by the step() method and contains all calculations. More... | |
The Optimizer interface. | |
void | init (const ParameterList ¶ms) |
Basic implementation. More... | |
double | step () |
Basic implementation. More... | |
double | optimize () |
Basic implementation. More... | |
bool | isInitialized () const |
const ParameterList & | getParameters () const |
double | getParameterValue (const std::string &name) const |
void | setFunction (Function *function) |
Set the function to optimize. More... | |
bool | hasFunction () const |
Tell if a funciton is associatied to this optimizer. More... | |
double | getFunctionValue () const |
Get the current function value. More... | |
void | setMessageHandler (OutputStream *mh) |
Set the message handler for this optimizer. More... | |
OutputStream * | getMessageHandler () const |
void | setProfiler (OutputStream *profiler) |
Set the profiler for this optimizer. More... | |
OutputStream * | getProfiler () const |
unsigned int | getNumberOfEvaluations () const |
Get the number of function evaluations performed since the call of the init function. More... | |
void | setStopCondition (const OptimizationStopCondition &stopCondition) |
Set the stop condition of the optimization algorithm. More... | |
OptimizationStopCondition * | getStopCondition () |
Get the stop condition of the optimization algorithm. More... | |
const OptimizationStopCondition * | getStopCondition () const |
Get the stop condition of the optimization algorithm. More... | |
OptimizationStopCondition * | getDefaultStopCondition () |
Get the default stop condition of the optimization algorithm. More... | |
const OptimizationStopCondition * | getDefaultStopCondition () const |
Get the default stop condition of the optimization algorithm. More... | |
bool | isToleranceReached () const |
Tell if the tolerance level is reached. More... | |
bool | isMaximumNumberOfEvaluationsReached () const |
Tell if the maximum number of function evaluations is reached. More... | |
void | setMaximumNumberOfEvaluations (unsigned int max) |
Set the maximum number of function evaluation to perform during optimization. More... | |
void | setVerbose (unsigned int v) |
Set the verbose level. More... | |
unsigned int | getVerbose () const |
Get the verbose level. More... | |
void | setConstraintPolicy (const std::string &constraintPolicy) |
Set the constraint policy for this optimizer. More... | |
std::string | getConstraintPolicy () const |
Get the constraint policy for this optimizer. More... | |
void | addOptimizationListener (OptimizationListener *listener) |
Register a listener to this class. More... | |
Protected Member Functions | |
DerivableFirstOrder * | getFunction_ () |
ParameterList & | getParameters_ () |
Parameter & | getParameter_ (size_t i) |
void | setDefaultStopCondition_ (OptimizationStopCondition *osc) |
Inner utilitary functions | |
void | autoParameter () |
Build a list of AutoParameter instead of Parameter. More... | |
void | ignoreConstraints () |
Remove the constraints of all the arguments. More... | |
void | profile (double v) |
Print to the profile if there is one. More... | |
void | profile (unsigned int v) |
Print to the profile if there is one. More... | |
void | profile (const std::string &s) |
Print to the profile if there is one. More... | |
void | profileln (double v) |
Print to the profile if there is one and end line. More... | |
void | profileln (unsigned int v) |
Print to the profile if there is one and end line. More... | |
void | profileln (const std::string &s) |
Print to the profile if there is one and end line. More... | |
void | printPoint (const ParameterList ¶ms, double value) |
Print parameters and corresponding function evaluation to profiler. More... | |
void | printMessage (const std::string &message) |
Give a message to print to the message handler. More... | |
void | fireOptimizationInitializationPerformed (const OptimizationEvent &event) |
Notify all listeners that optimizer initialization was performed. More... | |
void | fireOptimizationStepPerformed (const OptimizationEvent &event) |
Notify all listeners that an optimization step was performed. More... | |
bool | listenerModifiesParameters () const |
Protected Attributes | |
double | slope_ |
Vdouble | Up_ |
Vdouble | Lo_ |
Vdouble | p_ |
Vdouble | gradient_ |
Vdouble | xi_ |
Vdouble | dg_ |
Vdouble | hdg_ |
VVdouble | hessian_ |
DirectionFunction | f1dim_ |
unsigned int | nbEvalMax_ |
The maximum number of function evaluations allowed. More... | |
unsigned int | nbEval_ |
The current number of function evaluations achieved. More... | |
double | currentValue_ |
The current value of the function. More... | |
bool | tolIsReached_ |
Tell if the tolerance level has been reached. More... | |
Private Member Functions | |
void | setDirection () |
Private Attributes | |
Function * | function_ |
The function to optimize. More... | |
ParameterList | parameters_ |
The parameters that will be optimized. More... | |
OutputStream * | messageHandler_ |
The message handler. More... | |
OutputStream * | profiler_ |
The profiler. More... | |
std::string | constraintPolicy_ |
The constraint policy. More... | |
OptimizationStopCondition * | stopCondition_ |
The stoping condition to use while optimizing. More... | |
OptimizationStopCondition * | defaultStopCondition_ |
The default stoping condition to use while optimizing. More... | |
unsigned int | verbose_ |
State of the verbose mode: > 0 = enabled. More... | |
bool | isInitialized_ |
Check if the optimizer have been feeded with initial parameters values. More... | |
time_t | startTime_ |
std::vector< OptimizationListener * > | listeners_ |
bool | updateParameters_ |
std::string | stepChar_ |
Broyden–Fletcher–Goldfarb–Shanno (BFGS) optimization method.
with a modification on the bounds taken from: An active set limited memory BFGS algorithm for large-scale bound constrained optimization, Yunhai Xiao & Dong-Hui Li. Math Meth Oper Res (2008) 67:443454
Definition at line 60 of file BfgsMultiDimensions.h.
BfgsMultiDimensions::BfgsMultiDimensions | ( | DerivableFirstOrder * | function | ) |
Definition at line 49 of file BfgsMultiDimensions.cpp.
References bpp::AbstractOptimizer::getDefaultStopCondition(), bpp::AbstractOptimizer::setDefaultStopCondition_(), bpp::AbstractOptimizer::setOptimizationProgressCharacter(), and bpp::AbstractOptimizer::setStopCondition().
Referenced by clone().
|
inlinevirtual |
Definition at line 78 of file BfgsMultiDimensions.h.
|
inlinevirtualinherited |
Register a listener to this class.
All registered listeners will be informed when an optimization event occur. See the documentation of the class to know what kind of events are supported.
listener | A listener to be registered with. |
Implements bpp::Optimizer.
Definition at line 225 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::listeners_.
|
protectedinherited |
Build a list of AutoParameter instead of Parameter.
Definition at line 306 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::messageHandler_, bpp::AbstractOptimizer::parameters_, bpp::AutoParameter::setMessageHandler(), bpp::ParameterList::setParameter(), and bpp::ParameterList::size().
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::operator=().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Optimizer.
Definition at line 80 of file BfgsMultiDimensions.h.
References BfgsMultiDimensions().
|
virtual |
This function is called by the init() method and contains all calculations.
params | The parameters to use for initialization. |
Implements bpp::AbstractOptimizer.
Definition at line 70 of file BfgsMultiDimensions.cpp.
References dg_, bpp::DerivableFirstOrder::enableFirstOrderDerivatives(), getFunction_(), getGradient(), bpp::AbstractOptimizer::getParameters(), gradient_, hdg_, hessian_, Lo_, p_, bpp::Function::setParameters(), bpp::ParameterList::size(), bpp::NumConstants::TINY(), Up_, bpp::NumConstants::VERY_BIG(), and xi_.
|
virtual |
This function is called by the step() method and contains all calculations.
Implements bpp::AbstractOptimizer.
Definition at line 128 of file BfgsMultiDimensions.cpp.
References bpp::AbstractOptimizer::currentValue_, dg_, bpp::DerivableFirstOrder::enableFirstOrderDerivatives(), bpp::Function::f(), f1dim_, getFunction(), getGradient(), bpp::AbstractOptimizer::getParameters(), bpp::AbstractOptimizer::getParameters_(), bpp::AbstractOptimizer::getVerbose(), gradient_, hdg_, hessian_, bpp::OneDimensionOptimizationTools::lineSearch(), bpp::AbstractOptimizer::nbEval_, p_, bpp::AbstractOptimizer::printMessage(), setDirection(), bpp::ParameterList::size(), bpp::AbstractOptimizer::tolIsReached_, and xi_.
|
protectedinherited |
Notify all listeners that optimizer initialization was performed.
This method should be called by the init method.
event | An OptimizationEvent object. |
Definition at line 328 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::init().
|
protectedinherited |
Notify all listeners that an optimization step was performed.
This method should be called by the step method.
event | An OptimizationEvent object. |
Definition at line 338 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::step().
|
inlinevirtualinherited |
Get the constraint policy for this optimizer.
Implements bpp::Optimizer.
Definition at line 224 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::constraintPolicy_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::SimpleMultiDimensions::doInit(), and bpp::SimpleNewtonMultiDimensions::doInit().
|
inlinevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 216 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
Referenced by BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), bpp::DownhillSimplexMethod::DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlinevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 217 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
|
inlinevirtual |
Get the current function being optimized.
Reimplemented from bpp::AbstractOptimizer.
Definition at line 92 of file BfgsMultiDimensions.h.
References bpp::AbstractOptimizer::getFunction().
|
inlinevirtual |
Get the current function being optimized.
Reimplemented from bpp::AbstractOptimizer.
Definition at line 88 of file BfgsMultiDimensions.h.
References bpp::AbstractOptimizer::getFunction().
Referenced by doStep(), and getGradient().
|
inlineprotected |
Definition at line 104 of file BfgsMultiDimensions.h.
References bpp::AbstractOptimizer::getFunction_().
Referenced by doInit().
|
inlinevirtualinherited |
Get the current function value.
NullPointerException | If no function is associated with this optimizer. |
Implements bpp::Optimizer.
Reimplemented in bpp::GoldenSectionSearch.
Definition at line 198 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::currentValue_, and bpp::AbstractOptimizer::function_.
void BfgsMultiDimensions::getGradient | ( | std::vector< double > & | gradient | ) | const |
Definition at line 260 of file BfgsMultiDimensions.cpp.
References bpp::DerivableFirstOrder::getFirstOrderDerivative(), getFunction(), and bpp::AbstractOptimizer::getParameters().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 205 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), and bpp::PowellMultiDimensions::doStep().
|
inlinevirtualinherited |
Get the number of function evaluations performed since the call of the init function.
Implements bpp::Optimizer.
Definition at line 209 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEval_.
Referenced by bpp::SimpleMultiDimensions::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineinherited |
Definition at line 263 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stepChar_.
|
inlineprotectedinherited |
Definition at line 376 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::BrentOneDimension::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), and bpp::NewtonBacktrackOneDimension::doStep().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 188 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::MetaOptimizer::doInit(), doInit(), bpp::BrentOneDimension::doInit(), bpp::DownhillSimplexMethod::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::NewtonBacktrackOneDimension::doInit(), bpp::NewtonOneDimension::doInit(), bpp::PowellMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), doStep(), bpp::BrentOneDimension::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::MetaOptimizer::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::NewtonOneDimension::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), getGradient(), bpp::ConjugateGradientMultiDimensions::getGradient(), bpp::DownhillSimplexMethod::getPSum(), bpp::BrentOneDimension::optimize(), bpp::PowellMultiDimensions::optimize(), setDirection(), and bpp::DownhillSimplexMethod::tryExtrapolation().
|
inlineprotectedinherited |
Definition at line 375 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::MetaOptimizer::doInit(), doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::DownhillSimplexMethod::doStep(), bpp::MetaOptimizer::doStep(), bpp::NewtonOneDimension::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), and bpp::SimpleNewtonMultiDimensions::doStep().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 189 of file AbstractOptimizer.h.
References bpp::ParameterList::getParameterValue(), and bpp::AbstractOptimizer::parameters_.
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 207 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::SimpleMultiDimensions::doInit(), and bpp::SimpleNewtonMultiDimensions::doInit().
|
inlinevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 214 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::NewtonBacktrackOneDimension::doInit(), bpp::NewtonOneDimension::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::BrentOneDimension::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::MetaOptimizer::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), bpp::OneDimensionOptimizationTools::lineSearch(), bpp::MetaOptimizer::MetaOptimizer(), and bpp::SimpleMultiDimensions::setFunction().
|
inlinevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 215 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
|
inlinevirtualinherited |
Get the verbose level.
Implements bpp::Optimizer.
Definition at line 222 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::verbose_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::BrentOneDimension::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::MetaOptimizer::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), and bpp::SimpleNewtonMultiDimensions::doStep().
|
inlinevirtualinherited |
Tell if a funciton is associatied to this optimizer.
Implements bpp::Optimizer.
Definition at line 197 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
Referenced by bpp::GoldenSectionSearch::getFunctionValue().
|
protectedinherited |
Remove the constraints of all the arguments.
Definition at line 318 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::operator=().
|
virtualinherited |
Basic implementation.
Store all parameters, call the doInit method, print to profiler, initialize timer and notify all listeners.
Implements bpp::Optimizer.
Definition at line 158 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::constraintPolicy_, bpp::AutoParameter::CONSTRAINTS_AUTO, bpp::AutoParameter::CONSTRAINTS_IGNORE, bpp::AbstractOptimizer::currentValue_, bpp::AbstractOptimizer::doInit(), bpp::AbstractOptimizer::fireOptimizationInitializationPerformed(), bpp::AbstractOptimizer::function_, bpp::Function::getValue(), bpp::AbstractOptimizer::ignoreConstraints(), bpp::OptimizationStopCondition::init(), bpp::AbstractOptimizer::isInitialized_, bpp::AbstractOptimizer::nbEval_, bpp::AbstractOptimizer::parameters_, bpp::AbstractOptimizer::printPoint(), bpp::AbstractOptimizer::profile(), bpp::AbstractOptimizer::profileln(), bpp::ParameterList::size(), bpp::AbstractOptimizer::startTime_, bpp::AbstractOptimizer::stopCondition_, and bpp::AbstractOptimizer::tolIsReached_.
Referenced by bpp::SimpleMultiDimensions::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 187 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::isInitialized_.
|
inlinevirtualinherited |
Tell if the maximum number of function evaluations is reached.
Implements bpp::Optimizer.
Definition at line 219 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEval_, and bpp::AbstractOptimizer::nbEvalMax_.
|
inlinevirtualinherited |
Tell if the tolerance level is reached.
Implements bpp::Optimizer.
Definition at line 218 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::tolIsReached_.
|
protectedinherited |
Definition at line 348 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::step().
|
virtualinherited |
Basic implementation.
Call the step method untill tolerance is reached.
Implements bpp::Optimizer.
Reimplemented in bpp::PowellMultiDimensions, bpp::DownhillSimplexMethod, and bpp::BrentOneDimension.
Definition at line 216 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::currentValue_, bpp::ApplicationTools::displayUnlimitedGauge(), bpp::AbstractOptimizer::isInitialized_, bpp::AbstractOptimizer::nbEval_, bpp::AbstractOptimizer::nbEvalMax_, bpp::AbstractOptimizer::step(), bpp::AbstractOptimizer::tolIsReached_, and bpp::AbstractOptimizer::verbose_.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineSearch(), bpp::BrentOneDimension::optimize(), bpp::DownhillSimplexMethod::optimize(), and bpp::PowellMultiDimensions::optimize().
|
protectedinherited |
Give a message to print to the message handler.
message | The message to print. |
Definition at line 298 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::BrentOneDimension::doInit(), bpp::GoldenSectionSearch::doInit(), doStep(), and bpp::NewtonOneDimension::doStep().
|
protectedinherited |
Print parameters and corresponding function evaluation to profiler.
params | The parameters to print. |
value | The function evaluation. |
Definition at line 279 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::nbEval_, bpp::AbstractOptimizer::profile(), bpp::AbstractOptimizer::profileln(), bpp::ParameterList::size(), bpp::AbstractOptimizer::startTime_, and bpp::TextTools::toString().
Referenced by bpp::PowellMultiDimensions::doStep(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
Print to the profile if there is one.
s | The string to print to the profile. |
Definition at line 263 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
protectedinherited |
Print to the profile if there is one.
v | The double value to print. |
Definition at line 232 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::printPoint().
|
protectedinherited |
Print to the profile if there is one.
v | The unsigned int value to print. |
Definition at line 248 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
protectedinherited |
Print to the profile if there is one and end line.
s | The string to print to the profile. |
Definition at line 271 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
protectedinherited |
Print to the profile if there is one and end line.
v | The double value to print. |
Definition at line 240 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::printPoint().
|
protectedinherited |
Print to the profile if there is one and end line.
v | The unsigned int value to print. |
Definition at line 255 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
inlinevirtualinherited |
Set the constraint policy for this optimizer.
constraintPolicy | The constraint policy. |
Implements bpp::Optimizer.
Definition at line 223 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::constraintPolicy_.
Referenced by bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineprotectedinherited |
Definition at line 378 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
Referenced by BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), bpp::DownhillSimplexMethod::DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
private |
Sets the direction for linesearch in case of bounds To be used after gradient_ & pi_ are computed
Definition at line 270 of file BfgsMultiDimensions.cpp.
References bpp::AbstractOptimizer::getParameters(), gradient_, hessian_, Lo_, p_, bpp::ParameterList::size(), bpp::NumConstants::TINY(), Up_, and xi_.
Referenced by doStep().
|
inlinevirtualinherited |
Set the function to optimize.
function | The function to optimize. |
Implements bpp::Optimizer.
Reimplemented in bpp::SimpleNewtonMultiDimensions, bpp::SimpleMultiDimensions, and bpp::MetaOptimizer.
Definition at line 190 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_, bpp::OptimizationStopCondition::init(), and bpp::AbstractOptimizer::stopCondition_.
Referenced by bpp::MetaOptimizer::setFunction(), bpp::SimpleMultiDimensions::setFunction(), and bpp::SimpleNewtonMultiDimensions::setFunction().
|
inlinevirtualinherited |
Set the maximum number of function evaluation to perform during optimization.
max | The maximum number of evaluations to perform. |
Implements bpp::Optimizer.
Definition at line 220 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEvalMax_.
Referenced by bpp::BrentOneDimension::BrentOneDimension(), bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), and bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension().
|
inlinevirtualinherited |
Set the message handler for this optimizer.
The message handler keeps all messages that the optimizer may send. The default handler is set to standard output, but you can pass any ostream object (cerr, ofstream, etc.).
A NULL pointer disables message output.
mh | The message handler to use. |
Implements bpp::Optimizer.
Definition at line 204 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineinherited |
Set the character to be displayed during optimization.
c | A character. |
Definition at line 259 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stepChar_.
Referenced by BfgsMultiDimensions(), bpp::OneDimensionOptimizationTools::lineMinimization(), bpp::OneDimensionOptimizationTools::lineSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlinevirtualinherited |
Set the profiler for this optimizer.
The profiler keeps all the intermediate values taken by the parameters. The default profiler is set to standard output, but you can pass any ostream object (cerr, ofstream, etc.).
A NULL pointer disables message output.
profiler | The profiler to use. |
Implements bpp::Optimizer.
Definition at line 206 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlinevirtualinherited |
Set the stop condition of the optimization algorithm.
stopCondition | The stop condition to use while optimizing. |
Implements bpp::Optimizer.
Definition at line 210 of file AbstractOptimizer.h.
References bpp::OptimizationStopCondition::clone(), and bpp::AbstractOptimizer::stopCondition_.
Referenced by BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), bpp::DownhillSimplexMethod::DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlinevirtualinherited |
Set the verbose level.
0 = off 1 = on 2 = more verbose 3 = even more, etc.
In most cases, only the 0 and 1 levels are implemented.
v | verbose level. |
Implements bpp::Optimizer.
Definition at line 221 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::verbose_.
Referenced by bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
virtualinherited |
Basic implementation.
Check if the optimizer is initialized, check if parameters need update because of listeners, call the doStep method, print the current point to the profiler, notify all listeners and return the current value of the function.
Implements bpp::Optimizer.
Definition at line 196 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::currentValue_, bpp::AbstractOptimizer::doStep(), bpp::Function::f(), bpp::AbstractOptimizer::fireOptimizationStepPerformed(), bpp::AbstractOptimizer::function_, bpp::Parametrizable::getParameters(), bpp::OptimizationStopCondition::isToleranceReached(), bpp::AbstractOptimizer::listenerModifiesParameters(), bpp::ParameterList::matchParametersValues(), bpp::AbstractOptimizer::parameters_, bpp::AbstractOptimizer::printPoint(), bpp::AbstractOptimizer::stopCondition_, bpp::AbstractOptimizer::tolIsReached_, and bpp::AbstractOptimizer::updateParameters_.
Referenced by bpp::AbstractOptimizer::optimize().
|
inlineinherited |
Tell if we shall update all parameters after one optimization step.
This is required only for functions that have non-independent parameters, which means that setting one parameter value may modify one or several other parameters. Depending on the optimizer, this may have no effect.
Definition at line 252 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::updateParameters_.
Referenced by bpp::MetaOptimizer::doInit().
|
inlineinherited |
Tell if we shall update all parameters after one optimization step.
This is required only for functions that have non-independent parameters, which means that setting one parameter value may modify one or several other parameters. Depending on the optimizer, this may have no effect.
yn | true/false |
Definition at line 241 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::updateParameters_.
|
privateinherited |
The constraint policy.
Must be one the following:
Definition at line 94 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getConstraintPolicy(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::setConstraintPolicy().
|
protectedinherited |
The current value of the function.
Definition at line 140 of file AbstractOptimizer.h.
Referenced by bpp::NewtonOneDimension::doInit(), doStep(), bpp::NewtonOneDimension::doStep(), bpp::AbstractOptimizer::getFunctionValue(), bpp::GoldenSectionSearch::getFunctionValue(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::optimize(), bpp::BrentOneDimension::optimize(), and bpp::AbstractOptimizer::step().
|
privateinherited |
The default stoping condition to use while optimizing.
Definition at line 104 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getDefaultStopCondition(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::setDefaultStopCondition_(), and bpp::AbstractOptimizer::~AbstractOptimizer().
|
protected |
Definition at line 70 of file BfgsMultiDimensions.h.
|
mutableprotected |
Definition at line 73 of file BfgsMultiDimensions.h.
Referenced by doStep().
|
privateinherited |
The function to optimize.
Definition at line 67 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getFunction_(), bpp::AbstractOptimizer::getFunctionValue(), bpp::AbstractOptimizer::hasFunction(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::setFunction(), and bpp::AbstractOptimizer::step().
|
protected |
Definition at line 70 of file BfgsMultiDimensions.h.
Referenced by doInit(), doStep(), and setDirection().
|
protected |
Definition at line 70 of file BfgsMultiDimensions.h.
|
mutableprotected |
Definition at line 71 of file BfgsMultiDimensions.h.
Referenced by doInit(), doStep(), and setDirection().
|
privateinherited |
Check if the optimizer have been feeded with initial parameters values.
Definition at line 116 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::isInitialized(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::optimize().
|
privateinherited |
Definition at line 120 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::addOptimizationListener(), bpp::AbstractOptimizer::fireOptimizationInitializationPerformed(), bpp::AbstractOptimizer::fireOptimizationStepPerformed(), bpp::AbstractOptimizer::listenerModifiesParameters(), and bpp::AbstractOptimizer::operator=().
|
protected |
Definition at line 68 of file BfgsMultiDimensions.h.
Referenced by doInit(), and setDirection().
|
privateinherited |
The message handler.
Definition at line 77 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::getMessageHandler(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::printMessage(), and bpp::AbstractOptimizer::setMessageHandler().
|
protectedinherited |
The current number of function evaluations achieved.
Definition at line 135 of file AbstractOptimizer.h.
Referenced by bpp::DownhillSimplexMethod::doInit(), doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::DownhillSimplexMethod::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::MetaOptimizer::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::AbstractOptimizer::getNumberOfEvaluations(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::isMaximumNumberOfEvaluationsReached(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), bpp::AbstractOptimizer::printPoint(), and bpp::DownhillSimplexMethod::tryExtrapolation().
|
protectedinherited |
The maximum number of function evaluations allowed.
Definition at line 130 of file AbstractOptimizer.h.
Referenced by bpp::SimpleMultiDimensions::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::DownhillSimplexMethod::DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::AbstractOptimizer::isMaximumNumberOfEvaluationsReached(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::setMaximumNumberOfEvaluations().
|
mutableprotected |
Definition at line 70 of file BfgsMultiDimensions.h.
Referenced by doInit(), doStep(), and setDirection().
|
privateinherited |
The parameters that will be optimized.
Definition at line 72 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::getParameter_(), bpp::AbstractOptimizer::getParameters(), bpp::AbstractOptimizer::getParameters_(), bpp::AbstractOptimizer::getParameterValue(), bpp::AbstractOptimizer::ignoreConstraints(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::step().
|
privateinherited |
The profiler.
Definition at line 82 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getProfiler(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::profile(), bpp::AbstractOptimizer::profileln(), and bpp::AbstractOptimizer::setProfiler().
|
protected |
Definition at line 65 of file BfgsMultiDimensions.h.
|
privateinherited |
Definition at line 118 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::printPoint().
|
privateinherited |
Definition at line 124 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::setOptimizationProgressCharacter().
|
privateinherited |
The stoping condition to use while optimizing.
Definition at line 99 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getStopCondition(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::setFunction(), bpp::AbstractOptimizer::setStopCondition(), bpp::AbstractOptimizer::step(), and bpp::AbstractOptimizer::~AbstractOptimizer().
|
protectedinherited |
Tell if the tolerance level has been reached.
This field is initilaised by the init() method, maintained by the step() method and used in the optimize() method.
Definition at line 148 of file AbstractOptimizer.h.
Referenced by doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::MetaOptimizer::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::NewtonOneDimension::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::isToleranceReached(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::step().
|
protected |
Definition at line 68 of file BfgsMultiDimensions.h.
Referenced by doInit(), and setDirection().
|
privateinherited |
Definition at line 122 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::step(), and bpp::AbstractOptimizer::updateParameters().
|
privateinherited |
State of the verbose mode: > 0 = enabled.
This may not be used by the Optimizer.
Definition at line 111 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getVerbose(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::setVerbose().
|
protected |
Definition at line 70 of file BfgsMultiDimensions.h.
Referenced by doInit(), doStep(), and setDirection().