bpp-core
2.2.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 (Function *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) throw (Exception) |
This function is called by the init() method and contains all calculations. More... | |
double | doStep () throw (Exception) |
This function is called by the step() method and contains all calculations. More... | |
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 |
The Optimizer interface. | |
double | optimize () throw (Exception) |
Multidimensional minimization of the function function_ by the downhill simplex method of Nelder and Mead. More... | |
The Optimizer interface. | |
void | init (const ParameterList ¶ms) throw (Exception) |
Basic implementation. More... | |
double | step () throw (Exception) |
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... | |
const Function * | getFunction () const |
Get the current function being optimized. More... | |
Function * | getFunction () |
Get the current function being optimized. More... | |
bool | hasFunction () const |
Tell if a funciton is associatied to this optimizer. More... | |
double | getFunctionValue () const throw (NullPointerException) |
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 | |
ParameterList & | getParameters_ () |
Parameter & | getParameter_ (size_t i) |
Function * | getFunction_ () |
void | setDefaultStopCondition_ (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_ |
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 63 of file DownhillSimplexMethod.h.
DownhillSimplexMethod::DownhillSimplexMethod | ( | Function * | function | ) |
Build a new Downhill Simplex optimizer.
function | A pointer toward an object implementing the Optimizable interface. |
Definition at line 58 of file DownhillSimplexMethod.cpp.
References DSMStopCondition, bpp::AbstractOptimizer::getDefaultStopCondition(), bpp::AbstractOptimizer::nbEvalMax_, bpp::AbstractOptimizer::setDefaultStopCondition_(), and bpp::AbstractOptimizer::setStopCondition().
Referenced by clone().
|
inlinevirtual |
Definition at line 116 of file DownhillSimplexMethod.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 227 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::listeners_.
|
protectedinherited |
Build a list of AutoParameter instead of Parameter.
Definition at line 291 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(), and bpp::AbstractOptimizer::operator=().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Optimizer.
Definition at line 123 of file DownhillSimplexMethod.h.
References DownhillSimplexMethod().
|
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 69 of file DownhillSimplexMethod.cpp.
|
virtual |
This function is called by the step() method and contains all calculations.
Implements bpp::AbstractOptimizer.
Definition at line 103 of file DownhillSimplexMethod.cpp.
References bpp::Function::f(), bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getParameters_(), getPSum(), iHighest_, iLowest_, iNextHighest_, bpp::AbstractOptimizer::nbEval_, pSum_, simplex_, tryExtrapolation(), and y_.
|
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 313 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
|
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 323 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 226 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::constraintPolicy_.
|
inlinevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 218 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().
|
inlinevirtualinherited |
Get the default stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 219 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::defaultStopCondition_.
|
inlinevirtualinherited |
Get the current function being optimized.
Implements bpp::Optimizer.
Reimplemented in bpp::BfgsMultiDimensions, bpp::ConjugateGradientMultiDimensions, and bpp::NewtonOneDimension.
Definition at line 197 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), doStep(), bpp::MetaOptimizer::doStep(), bpp::NewtonOneDimension::getFunction(), bpp::ConjugateGradientMultiDimensions::getFunction(), bpp::BfgsMultiDimensions::getFunction(), bpp::PowellMultiDimensions::optimize(), bpp::BrentOneDimension::optimize(), optimize(), and tryExtrapolation().
|
inlinevirtualinherited |
Get the current function being optimized.
Implements bpp::Optimizer.
Reimplemented in bpp::BfgsMultiDimensions, bpp::ConjugateGradientMultiDimensions, and bpp::NewtonOneDimension.
Definition at line 198 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
|
inlineprotectedinherited |
Definition at line 380 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
Referenced by bpp::NewtonOneDimension::getFunction_(), bpp::ConjugateGradientMultiDimensions::getFunction_(), bpp::BfgsMultiDimensions::getFunction_(), and bpp::NewtonBacktrackOneDimension::getFunction_().
|
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 200 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::currentValue_, and bpp::AbstractOptimizer::function_.
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 207 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::PowellMultiDimensions::doStep().
|
inlinevirtualinherited |
Get the number of function evaluations performed since the call of the init function.
Implements bpp::Optimizer.
Definition at line 211 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 265 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stepChar_.
|
inlineprotectedinherited |
Definition at line 379 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), and bpp::BrentOneDimension::doStep().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 190 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by 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(), 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 378 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::parameters_.
Referenced by bpp::NewtonOneDimension::doStep(), bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), doStep(), and bpp::MetaOptimizer::doStep().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 191 of file AbstractOptimizer.h.
References bpp::ParameterList::getParameterValue(), and bpp::AbstractOptimizer::parameters_.
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 209 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::profiler_.
|
protected |
Update the pSum_ variable.
Definition at line 188 of file DownhillSimplexMethod.cpp.
References bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getParameters(), and simplex_.
Referenced by doStep().
|
inlinevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 216 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
Referenced by 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().
|
inlinevirtualinherited |
Get the stop condition of the optimization algorithm.
Implements bpp::Optimizer.
Definition at line 217 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stopCondition_.
|
inlinevirtualinherited |
Get the verbose level.
Implements bpp::Optimizer.
Definition at line 224 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::verbose_.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), and bpp::MetaOptimizer::doStep().
|
inlinevirtualinherited |
Tell if a funciton is associatied to this optimizer.
Implements bpp::Optimizer.
Definition at line 199 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_.
Referenced by bpp::GoldenSectionSearch::getFunctionValue().
|
protectedinherited |
Remove the constraints of all the arguments.
Definition at line 303 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractOptimizer::AbstractOptimizer(), 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 153 of file AbstractOptimizer.cpp.
References bpp::AutoParameter::CONSTRAINTS_AUTO, and bpp::AutoParameter::CONSTRAINTS_IGNORE.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlinevirtualinherited |
Implements bpp::Optimizer.
Definition at line 189 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 221 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 220 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::tolIsReached_.
|
protectedinherited |
Definition at line 333 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::listeners_.
Referenced by 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 178 of file DownhillSimplexMethod.cpp.
References bpp::Function::f(), bpp::AbstractOptimizer::getFunction(), iLowest_, bpp::AbstractOptimizer::optimize(), and simplex_.
|
protectedinherited |
Give a message to print to the message handler.
message | The message to print. |
Definition at line 284 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::NewtonOneDimension::doStep(), and bpp::BfgsMultiDimensions::doStep().
|
protectedinherited |
Print parameters and corresponding function evaluation to profiler.
params | The parameters to print. |
value | The function evaluation. |
Definition at line 265 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(), and bpp::AbstractOptimizer::step().
|
protectedinherited |
Print to the profile if there is one.
v | The double value to print. |
Definition at line 224 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by bpp::AbstractOptimizer::printPoint().
|
protectedinherited |
Print to the profile if there is one.
v | The unsigned int value to print. |
Definition at line 238 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 251 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 231 of file AbstractOptimizer.cpp.
References bpp::AbstractOptimizer::profiler_.
Referenced by 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 244 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 258 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 225 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::constraintPolicy_.
Referenced by bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineprotectedinherited |
Definition at line 381 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().
|
inlinevirtualinherited |
Set the function to optimize.
function | The function to optimize. |
Implements bpp::Optimizer.
Reimplemented in bpp::MetaOptimizer, bpp::SimpleMultiDimensions, and bpp::SimpleNewtonMultiDimensions.
Definition at line 192 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::function_, bpp::OptimizationStopCondition::init(), and bpp::AbstractOptimizer::stopCondition_.
Referenced by bpp::SimpleNewtonMultiDimensions::setFunction(), bpp::SimpleMultiDimensions::setFunction(), and bpp::MetaOptimizer::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 222 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::nbEvalMax_.
Referenced by bpp::BrentOneDimension::BrentOneDimension(), 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 206 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::messageHandler_.
Referenced by bpp::OneDimensionOptimizationTools::lineMinimization(), and bpp::OneDimensionOptimizationTools::lineSearch().
|
inlineinherited |
Set the character to be displayed during optimization.
c | A character. |
Definition at line 261 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::stepChar_.
Referenced by bpp::BfgsMultiDimensions::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 208 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::profiler_.
Referenced by 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 212 of file AbstractOptimizer.h.
References bpp::OptimizationStopCondition::clone(), and bpp::AbstractOptimizer::stopCondition_.
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().
|
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 223 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::verbose_.
Referenced by 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 188 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().
|
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 210 of file DownhillSimplexMethod.cpp.
References bpp::Function::f(), bpp::DownhillSimplexMethod::Simplex::getDimension(), bpp::AbstractOptimizer::getFunction(), bpp::AbstractOptimizer::getParameters(), iHighest_, bpp::AbstractOptimizer::nbEval_, pSum_, simplex_, and y_.
Referenced by doStep().
|
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 243 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::updateParameters_.
|
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 254 of file AbstractOptimizer.h.
References bpp::AbstractOptimizer::updateParameters_.
|
friend |
Definition at line 82 of file DownhillSimplexMethod.h.
Referenced by DownhillSimplexMethod().
|
protectedinherited |
The current value of the function.
Definition at line 141 of file AbstractOptimizer.h.
Referenced by bpp::NewtonOneDimension::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::GoldenSectionSearch::getFunctionValue(), bpp::AbstractOptimizer::getFunctionValue(), bpp::BrentOneDimension::optimize(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::step().
|
protected |
Definition at line 105 of file DownhillSimplexMethod.h.
Referenced by doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and tryExtrapolation().
|
protected |
Definition at line 105 of file DownhillSimplexMethod.h.
Referenced by doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and optimize().
|
protected |
Definition at line 105 of file DownhillSimplexMethod.h.
Referenced by doStep().
|
protectedinherited |
The current number of function evaluations achieved.
Definition at line 136 of file AbstractOptimizer.h.
Referenced by 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::isMaximumNumberOfEvaluationsReached(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), bpp::AbstractOptimizer::printPoint(), and tryExtrapolation().
|
protectedinherited |
The maximum number of function evaluations allowed.
Definition at line 131 of file AbstractOptimizer.h.
Referenced by DownhillSimplexMethod(), bpp::GoldenSectionSearch::GoldenSectionSearch(), bpp::AbstractOptimizer::isMaximumNumberOfEvaluationsReached(), bpp::NewtonOneDimension::NewtonOneDimension(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::setMaximumNumberOfEvaluations().
|
protected |
Definition at line 104 of file DownhillSimplexMethod.h.
Referenced by doStep(), and tryExtrapolation().
|
protected |
Definition at line 102 of file DownhillSimplexMethod.h.
Referenced by doStep(), getPSum(), optimize(), and tryExtrapolation().
|
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 149 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::isToleranceReached(), bpp::AbstractOptimizer::operator=(), bpp::AbstractOptimizer::optimize(), and bpp::AbstractOptimizer::step().
|
protected |
Definition at line 103 of file DownhillSimplexMethod.h.
Referenced by doStep(), bpp::DownhillSimplexMethod::DSMStopCondition::getCurrentTolerance(), and tryExtrapolation().