bpp-core3
3.0.0
|
This implements the Downhill Simplex method in multidimensions. More...
#include <Bpp/Numeric/Function/DownhillSimplexMethod.h>
Classes | |
class | DSMStopCondition |
class | Simplex |
Public Member Functions | |
DownhillSimplexMethod (std::shared_ptr< FunctionInterface > function) | |
Build a new Downhill Simplex optimizer. More... | |
virtual | ~DownhillSimplexMethod () |
DownhillSimplexMethod * | clone () const |
Create a copy of this object and send a pointer to it. 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... | |
void | updateParameters (bool yn) override |
Tell if we shall update all parameters after one optimization step. More... | |
bool | updateParameters () const override |
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 |
The Optimizer interface. | |
double | optimize () |
Multidimensional minimization of the function function_ by the downhill simplex method of Nelder and Mead. More... | |
The Optimizer interface. | |
void | init (const ParameterList ¶ms) override |
Basic implementation. More... | |
double | step () override |
Basic implementation. More... | |
bool | isInitialized () const override |
const ParameterList & | getParameters () const override |
double | getParameterValue (const std::string &name) const override |
void | setFunction (std::shared_ptr< FunctionInterface > function) override |
Set the function to optimize. More... | |
const FunctionInterface & | function () const override |
Get the current function being optimized. More... | |
FunctionInterface & | function () override |
Get the current function being optimized. More... | |
std::shared_ptr< const FunctionInterface > | getFunction () const override |
Get the current function being optimized. More... | |
std::shared_ptr< FunctionInterface > | getFunction () override |
Get the current function being optimized. More... | |
bool | hasFunction () const override |
Tell if a funciton is associatied to this optimizer. More... | |
double | getFunctionValue () const override |
Get the current function value. More... | |
void | setMessageHandler (std::shared_ptr< OutputStream > mh) override |
Set the message handler for this optimizer. More... | |
std::shared_ptr< OutputStream > | getMessageHandler () const override |
void | setProfiler (std::shared_ptr< OutputStream > profiler) override |
Set the profiler for this optimizer. More... | |
std::shared_ptr< OutputStream > | getProfiler () const override |
unsigned int | getNumberOfEvaluations () const override |
Get the number of function evaluations performed since the call of the init function. More... | |
void | setStopCondition (std::shared_ptr< OptimizationStopCondition > stopCondition) override |
Set the stop condition of the optimization algorithm. More... | |
std::shared_ptr< OptimizationStopCondition > | getStopCondition () override |
Get the stop condition of the optimization algorithm. More... | |
std::shared_ptr< const OptimizationStopCondition > | getStopCondition () const override |
Get the stop condition of the optimization algorithm. More... | |
std::shared_ptr< OptimizationStopCondition > | getDefaultStopCondition () override |
Get the default stop condition of the optimization algorithm. More... | |
std::shared_ptr< const OptimizationStopCondition > | getDefaultStopCondition () const override |
Get the default stop condition of the optimization algorithm. More... | |
bool | isToleranceReached () const override |
Tell if the tolerance level is reached. More... | |
bool | isMaximumNumberOfEvaluationsReached () const override |
Tell if the maximum number of function evaluations is reached. More... | |
void | setMaximumNumberOfEvaluations (unsigned int max) override |
Set the maximum number of function evaluation to perform during optimization. More... | |
void | setVerbose (unsigned int v) override |
Set the verbose level. More... | |
unsigned int | getVerbose () const override |
Get the verbose level. More... | |
void | setConstraintPolicy (const std::string &constraintPolicy) override |
Set the constraint policy for this optimizer. More... | |
std::string | getConstraintPolicy () const override |
Get the constraint policy for this optimizer. More... | |
void | addOptimizationListener (std::shared_ptr< OptimizationListener > listener) override |
Register a listener to this class. More... | |
Protected Member Functions | |
ParameterList & | getParameters_ () |
Parameter & | getParameter_ (size_t i) |
std::shared_ptr< FunctionInterface > | getFunction_ () |
void | setDefaultStopCondition_ (std::shared_ptr< OptimizationStopCondition > osc) |
Specific inner methods | |
ParameterList | getPSum () |
Update the pSum_ variable. More... | |
double | tryExtrapolation (double fac) |
Extrapolates by a factor fac through the face of the simplex from the high point. Try the new point and replaces the high point if it is better. More... | |
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 | |
Simplex | simplex_ |
Vdouble | y_ |
ParameterList | pSum_ |
unsigned int | iHighest_ |
unsigned int | iNextHighest_ |
unsigned int | iLowest_ |
std::shared_ptr< FunctionInterface > | function_ |
The function to optimize. More... | |
ParameterList | parameters_ |
The parameters that will be optimized. More... | |
std::shared_ptr< OutputStream > | messageHandler_ |
The message handler. More... | |
std::shared_ptr< OutputStream > | profiler_ |
The profiler. More... | |
std::string | constraintPolicy_ |
The constraint policy. More... | |
std::shared_ptr< OptimizationStopCondition > | stopCondition_ |
The stoping condition to use while optimizing. More... | |
std::shared_ptr< 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< std::shared_ptr< OptimizationListener > > | listeners_ |
bool | updateParameters_ |
std::string | stepChar_ |
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... | |
Friends | |
class | DSMStopCondition |
This implements the Downhill Simplex method in multidimensions.
A description of the algorithm can be found in:
NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)
or there: http://en.wikipedia.org/wiki/Nelder-Mead_method.
Definition at line 28 of file DownhillSimplexMethod.h.
DownhillSimplexMethod::DownhillSimplexMethod | ( | std::shared_ptr< FunctionInterface > | function | ) |
Build a new Downhill Simplex optimizer.
function | A pointer toward an object implementing the Optimizable interface. |
Definition at line 23 of file DownhillSimplexMethod.cpp.
References bpp::AbstractOptimizer::getDefaultStopCondition(), bpp::AbstractOptimizer::nbEvalMax_, bpp::AbstractOptimizer::setDefaultStopCondition_(), and bpp::AbstractOptimizer::setStopCondition().
Referenced by clone().
|
inlinevirtual |
Definition at line 82 of file DownhillSimplexMethod.h.
|
inlineoverridevirtualinherited |
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::OptimizerInterface.
Definition at line 235 of file AbstractOptimizer.h.
|
protectedinherited |
Build a list of AutoParameter instead of Parameter.
Definition at line 273 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::getOptimizationProgressCharacter(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::operator=().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::OptimizerInterface.
Definition at line 84 of file DownhillSimplexMethod.h.
References doInit(), doStep(), DownhillSimplexMethod(), getPSum(), optimize(), and tryExtrapolation().
|
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 34 of file DownhillSimplexMethod.cpp.
References bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getParameters(), getPSum(), bpp::AbstractOptimizer::nbEval_, pSum_, bpp::DownhillSimplexMethod::Simplex::resize(), simplex_, bpp::ParameterList::size(), and y_.
Referenced by clone().
|
virtual |
This function is called by the step() method and contains all calculations.
Implements bpp::AbstractOptimizer.
Definition at line 68 of file DownhillSimplexMethod.cpp.
References bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getParameters_(), getPSum(), iHighest_, iLowest_, iNextHighest_, bpp::AbstractOptimizer::nbEval_, pSum_, simplex_, tryExtrapolation(), and y_.
Referenced by clone().
|
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 295 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), and 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 305 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), and bpp::AbstractOptimizer::step().
|
inlineoverridevirtualinherited |
Get the current function being optimized.
NullPointerException | if no function is associated with the optimizer. |
Implements bpp::OptimizerInterface.
Definition at line 162 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
|
inlineoverridevirtualinherited |
Get the current function being optimized.
NullPointerException | if no function is associated with the optimizer. |
Implements bpp::OptimizerInterface.
Definition at line 174 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
|
inlineoverridevirtualinherited |
Get the constraint policy for this optimizer.
Implements bpp::OptimizerInterface.
Definition at line 233 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::constraintPolicy_.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), and bpp::MetaOptimizer::doInit().
|
inlineoverridevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::OptimizerInterface.
Definition at line 217 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
Referenced by bpp::BfgsMultiDimensions::BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlineoverridevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::OptimizerInterface.
Definition at line 219 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
|
inlineoverridevirtualinherited |
Get the current function being optimized.
Implements bpp::OptimizerInterface.
Definition at line 186 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
Referenced by bpp::NewtonOneDimension::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::PowellMultiDimensions::doInit(), bpp::NewtonBacktrackOneDimension::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), doInit(), bpp::MetaOptimizer::doInit(), bpp::NewtonOneDimension::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), doStep(), bpp::MetaOptimizer::doStep(), bpp::PowellMultiDimensions::optimize(), bpp::BrentOneDimension::optimize(), optimize(), and tryExtrapolation().
|
inlineoverridevirtualinherited |
Get the current function being optimized.
Implements bpp::OptimizerInterface.
Definition at line 188 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
|
inlineprotectedinherited |
Definition at line 389 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
|
inlineoverridevirtualinherited |
Get the current function value.
NullPointerException | If no function is associated with this optimizer. |
Implements bpp::OptimizerInterface.
Reimplemented in bpp::GoldenSectionSearch.
Definition at line 192 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::currentValue_.
|
inlineoverridevirtualinherited |
Implements bpp::OptimizerInterface.
Definition at line 200 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::MetaOptimizer::doInit(), and bpp::PowellMultiDimensions::doStep().
|
inlineoverridevirtualinherited |
Get the number of function evaluations performed since the call of the init function.
Implements bpp::OptimizerInterface.
Definition at line 206 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEval_.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineinherited |
Definition at line 273 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::doInit(), bpp::AbstractOptimizer::doStep(), bpp::AbstractOptimizer::fireOptimizationInitializationPerformed(), bpp::AbstractOptimizer::fireOptimizationStepPerformed(), bpp::AbstractOptimizer::ignoreConstraints(), bpp::AbstractOptimizer::listenerModifiesParameters(), bpp::AbstractOptimizer::printMessage(), bpp::AbstractOptimizer::printPoint(), bpp::AbstractOptimizer::profile(), bpp::AbstractOptimizer::profileln(), and bpp::AbstractOptimizer::stepChar_.
|
inlineprotectedinherited |
Definition at line 387 of file AbstractOptimizer.h.
Referenced by bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), and bpp::BrentOneDimension::doStep().
|
inlineoverridevirtualinherited |
Implements bpp::OptimizerInterface.
Definition at line 149 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::NewtonOneDimension::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::BfgsMultiDimensions::doInit(), bpp::NewtonBacktrackOneDimension::doInit(), bpp::PowellMultiDimensions::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), doInit(), bpp::MetaOptimizer::doInit(), bpp::NewtonOneDimension::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::MetaOptimizer::doStep(), bpp::ConjugateGradientMultiDimensions::getGradient(), bpp::BfgsMultiDimensions::getGradient(), getPSum(), bpp::PowellMultiDimensions::optimize(), bpp::BrentOneDimension::optimize(), bpp::BfgsMultiDimensions::setDirection(), and tryExtrapolation().
|
inlineprotectedinherited |
Definition at line 385 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::MetaOptimizer::doInit(), bpp::NewtonOneDimension::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), doStep(), and bpp::MetaOptimizer::doStep().
|
inlineoverridevirtualinherited |
Implements bpp::OptimizerInterface.
Definition at line 151 of file AbstractOptimizer.h.
References bpp::ParameterList::getParameterValue().
|
inlineoverridevirtualinherited |
Implements bpp::OptimizerInterface.
Definition at line 204 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), and bpp::MetaOptimizer::doInit().
|
protected |
Update the pSum_ variable.
Definition at line 155 of file DownhillSimplexMethod.cpp.
References bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getParameters(), and simplex_.
|
inlineoverridevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::OptimizerInterface.
Definition at line 213 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
Referenced by bpp::NewtonOneDimension::doInit(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::NewtonBacktrackOneDimension::doInit(), bpp::MetaOptimizer::doInit(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::MetaOptimizer::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), bpp::OneDimensionOptimizationTools::lineSearch(), bpp::MetaOptimizer::MetaOptimizer(), and bpp::SimpleMultiDimensions::setFunction().
|
inlineoverridevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::OptimizerInterface.
Definition at line 215 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
|
inlineoverridevirtualinherited |
Get the verbose level.
Implements bpp::OptimizerInterface.
Definition at line 229 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::verbose_.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), bpp::MetaOptimizer::doInit(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), and bpp::MetaOptimizer::doStep().
|
inlineoverridevirtualinherited |
Tell if a funciton is associatied to this optimizer.
Implements bpp::OptimizerInterface.
Definition at line 190 of file AbstractOptimizer.h.
Referenced by bpp::GoldenSectionSearch::getFunctionValue().
|
protectedinherited |
Remove the constraints of all the arguments.
Definition at line 285 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getOptimizationProgressCharacter(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::operator=().
|
overridevirtualinherited |
Basic implementation.
Store all parameters, call the doInit method, print to profiler, initialize timer and notify all listeners.
Implements bpp::OptimizerInterface.
Definition at line 125 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::AbstractOptimizer::ignoreConstraints(), 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::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), bpp::OneDimensionOptimizationTools::lineSearch(), and bpp::AbstractOptimizer::~AbstractOptimizer().
|
inlineoverridevirtualinherited |
Implements bpp::OptimizerInterface.
Definition at line 147 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::isInitialized_.
|
inlineoverridevirtualinherited |
Tell if the maximum number of function evaluations is reached.
Implements bpp::OptimizerInterface.
Definition at line 223 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEvalMax_.
|
inlineoverridevirtualinherited |
Tell if the tolerance level is reached.
Implements bpp::OptimizerInterface.
Definition at line 221 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::tolIsReached_.
|
protectedinherited |
Definition at line 315 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), and bpp::AbstractOptimizer::step().
|
virtual |
Multidimensional minimization of the function function_ by the downhill simplex method of Nelder and Mead.
Reimplemented from bpp::AbstractOptimizer.
Definition at line 145 of file DownhillSimplexMethod.cpp.
References bpp::AbstractOptimizer::getFunction(), iLowest_, bpp::AbstractOptimizer::optimize(), and simplex_.
Referenced by clone().
|
protectedinherited |
Give a message to print to the message handler.
message | The message to print. |
Definition at line 265 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), bpp::NewtonOneDimension::doStep(), bpp::BfgsMultiDimensions::doStep(), and bpp::AbstractOptimizer::getOptimizationProgressCharacter().
|
protectedinherited |
Print parameters and corresponding function evaluation to profiler.
params | The parameters to print. |
value | The function evaluation. |
Definition at line 246 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::getOptimizationProgressCharacter(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
Print to the profile if there is one.
v | The double value to print. |
Definition at line 199 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), 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 215 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
protectedinherited |
Print to the profile if there is one.
s | The string to print to the profile. |
Definition at line 230 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 207 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), 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 222 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 238 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
|
inlineoverridevirtualinherited |
Set the constraint policy for this optimizer.
constraintPolicy | The constraint policy. |
Implements bpp::OptimizerInterface.
Definition at line 231 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineprotectedinherited |
Definition at line 391 of file AbstractOptimizer.h.
Referenced by bpp::BfgsMultiDimensions::BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlineoverridevirtualinherited |
Set the function to optimize.
function | The function to optimize. |
Implements bpp::OptimizerInterface.
Reimplemented in bpp::MetaOptimizer, bpp::SimpleMultiDimensions, and bpp::SimpleNewtonMultiDimensions.
Definition at line 156 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::setFunction(), bpp::SimpleMultiDimensions::setFunction(), and bpp::MetaOptimizer::setFunction().
|
inlineoverridevirtualinherited |
Set the maximum number of function evaluation to perform during optimization.
max | The maximum number of evaluations to perform. |
Implements bpp::OptimizerInterface.
Definition at line 225 of file AbstractOptimizer.h.
Referenced by bpp::BrentOneDimension::BrentOneDimension(), bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), and bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension().
|
inlineoverridevirtualinherited |
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::OptimizerInterface.
Definition at line 198 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineinherited |
Set the character to be displayed during optimization.
c | A character. |
Definition at line 269 of file AbstractOptimizer.h.
Referenced by bpp::BfgsMultiDimensions::BfgsMultiDimensions(), bpp::OneDimensionOptimizationTools::lineMinimization(), bpp::OneDimensionOptimizationTools::lineSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlineoverridevirtualinherited |
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::OptimizerInterface.
Definition at line 202 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineoverridevirtualinherited |
Set the stop condition of the optimization algorithm.
stopCondition | The stop condition to use while optimizing. |
Implements bpp::OptimizerInterface.
Definition at line 208 of file AbstractOptimizer.h.
Referenced by bpp::BfgsMultiDimensions::BfgsMultiDimensions(), bpp::BrentOneDimension::BrentOneDimension(), bpp::ConjugateGradientMultiDimensions::ConjugateGradientMultiDimensions(), DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::MetaOptimizer::MetaOptimizer(), bpp::NewtonBacktrackOneDimension::NewtonBacktrackOneDimension(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::PowellMultiDimensions::PowellMultiDimensions(), bpp::SimpleMultiDimensions::SimpleMultiDimensions(), and bpp::SimpleNewtonMultiDimensions::SimpleNewtonMultiDimensions().
|
inlineoverridevirtualinherited |
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::OptimizerInterface.
Definition at line 227 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
overridevirtualinherited |
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::OptimizerInterface.
Definition at line 163 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::currentValue_, bpp::AbstractOptimizer::doStep(), bpp::AbstractOptimizer::fireOptimizationStepPerformed(), bpp::AbstractOptimizer::function_, 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(), and bpp::AbstractOptimizer::~AbstractOptimizer().
|
protected |
Extrapolates by a factor fac through the face of the simplex from the high point. Try the new point and replaces the high point if it is better.
fac | Extrapolation factor. |
Definition at line 177 of file DownhillSimplexMethod.cpp.
References bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getParameters(), iHighest_, bpp::AbstractOptimizer::nbEval_, pSum_, simplex_, and y_.
|
inlineoverridevirtualinherited |
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 |
Implements bpp::OptimizerInterface.
Definition at line 251 of file AbstractOptimizer.h.
|
inlineoverridevirtualinherited |
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.
Implements bpp::OptimizerInterface.
Definition at line 262 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::updateParameters_.
Referenced by bpp::MetaOptimizer::doInit().
|
friend |
Definition at line 47 of file DownhillSimplexMethod.h.
|
protectedinherited |
The constraint policy.
Must be one the following:
Definition at line 56 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getConstraintPolicy(), bpp::AbstractOptimizer::init(), and bpp::AbstractOptimizer::operator=().
|
protectedinherited |
The current value of the function.
Definition at line 102 of file AbstractOptimizer.h.
Referenced by bpp::NewtonOneDimension::doInit(), bpp::NewtonOneDimension::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::GoldenSectionSearch::getFunctionValue(), bpp::AbstractOptimizer::getFunctionValue(), bpp::AbstractOptimizer::init(), bpp::BrentOneDimension::optimize(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
The default stoping condition to use while optimizing.
Definition at line 66 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getDefaultStopCondition(), and bpp::AbstractOptimizer::operator=().
|
protectedinherited |
The function to optimize.
Definition at line 29 of file AbstractOptimizer.h.
Referenced by bpp::NewtonOneDimension::firstOrderDerivableFunction(), bpp::ConjugateGradientMultiDimensions::firstOrderDerivableFunction(), bpp::BfgsMultiDimensions::firstOrderDerivableFunction(), bpp::NewtonBacktrackOneDimension::firstOrderDerivableFunction(), bpp::AbstractOptimizer::function(), bpp::NewtonOneDimension::getFirstOrderDerivableFunction(), bpp::ConjugateGradientMultiDimensions::getFirstOrderDerivableFunction(), bpp::BfgsMultiDimensions::getFirstOrderDerivableFunction(), bpp::NewtonBacktrackOneDimension::getFirstOrderDerivableFunction(), bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getFunction_(), bpp::NewtonOneDimension::getSecondOrderDerivableFunction(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), bpp::NewtonOneDimension::secondOrderDerivableFunction(), and bpp::AbstractOptimizer::step().
|
protected |
Definition at line 72 of file DownhillSimplexMethod.h.
Referenced by doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and tryExtrapolation().
|
protected |
Definition at line 72 of file DownhillSimplexMethod.h.
Referenced by doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and optimize().
|
protected |
Definition at line 72 of file DownhillSimplexMethod.h.
Referenced by doStep().
|
protectedinherited |
Check if the optimizer have been feeded with initial parameters values.
Definition at line 78 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::isInitialized(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::optimize().
|
protectedinherited |
|
protectedinherited |
The message handler.
Definition at line 39 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::getMessageHandler(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::printMessage().
|
protectedinherited |
The current number of function evaluations achieved.
Definition at line 97 of file AbstractOptimizer.h.
Referenced by doInit(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::GoldenSectionSearch::doStep(), doStep(), bpp::MetaOptimizer::doStep(), bpp::AbstractOptimizer::getNumberOfEvaluations(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), bpp::AbstractOptimizer::printPoint(), and tryExtrapolation().
|
protectedinherited |
The maximum number of function evaluations allowed.
Definition at line 92 of file AbstractOptimizer.h.
Referenced by bpp::SimpleNewtonMultiDimensions::doInit(), bpp::SimpleMultiDimensions::doInit(), DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::AbstractOptimizer::isMaximumNumberOfEvaluationsReached(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::optimize().
|
protectedinherited |
The parameters that will be optimized.
Definition at line 34 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::autoParameter(), bpp::AbstractOptimizer::getParameters(), bpp::AbstractOptimizer::getParameters_(), bpp::AbstractOptimizer::ignoreConstraints(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
The profiler.
Definition at line 44 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getProfiler(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::profile(), and bpp::AbstractOptimizer::profileln().
|
protected |
Definition at line 71 of file DownhillSimplexMethod.h.
Referenced by doInit(), doStep(), and tryExtrapolation().
|
protected |
Definition at line 69 of file DownhillSimplexMethod.h.
Referenced by doInit(), doStep(), getPSum(), optimize(), and tryExtrapolation().
|
protectedinherited |
Definition at line 80 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::printPoint().
|
protectedinherited |
Definition at line 86 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getOptimizationProgressCharacter(), and bpp::AbstractOptimizer::operator=().
|
protectedinherited |
The stoping condition to use while optimizing.
Definition at line 61 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), bpp::AbstractOptimizer::getStopCondition(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::step().
|
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 110 of file AbstractOptimizer.h.
Referenced by bpp::NewtonOneDimension::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::MetaOptimizer::doStep(), bpp::AbstractOptimizer::init(), bpp::AbstractOptimizer::isToleranceReached(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
Definition at line 84 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::step(), and bpp::AbstractOptimizer::updateParameters().
|
protectedinherited |
State of the verbose mode: > 0 = enabled.
This may not be used by the Optimizer.
Definition at line 73 of file AbstractOptimizer.h.
Referenced by bpp::AbstractOptimizer::getVerbose(), bpp::AbstractOptimizer::operator=(), and bpp::AbstractOptimizer::optimize().
|
protected |
Definition at line 70 of file DownhillSimplexMethod.h.
Referenced by doInit(), doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and tryExtrapolation().