bpp-core3
3.0.0
|
This is the basal interface for all optimization methods. More...
#include <Bpp/Numeric/Function/Optimizer.h>
Public Member Functions | |
Optimizer () | |
virtual | ~Optimizer () |
Optimizer * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
virtual void | init (const ParameterList ¶ms)=0 |
Set the initial values of the parameters. More... | |
virtual bool | isInitialized () const =0 |
virtual double | step ()=0 |
Perform an optimization step. More... | |
virtual const ParameterList & | getParameters () const =0 |
virtual double | getParameterValue (const std::string &name) const =0 |
virtual double | getFunctionValue () const =0 |
Get the current function value. More... | |
virtual double | optimize ()=0 |
Perform as many optimization steps untill the stop condition is met. More... | |
virtual void | setFunction (Function *function)=0 |
Set the function to optimize. More... | |
virtual const Function * | getFunction () const =0 |
Get the current function being optimized. More... | |
virtual Function * | getFunction ()=0 |
Get the current function being optimized. More... | |
virtual bool | hasFunction () const =0 |
Tell if a funciton is associatied to this optimizer. More... | |
virtual void | setMessageHandler (OutputStream *mh)=0 |
Set the message handler for this optimizer. More... | |
virtual OutputStream * | getMessageHandler () const =0 |
virtual void | setProfiler (OutputStream *profiler)=0 |
Set the profiler for this optimizer. More... | |
virtual OutputStream * | getProfiler () const =0 |
virtual unsigned int | getNumberOfEvaluations () const =0 |
Get the number of function evaluations performed since the call of the init function. More... | |
virtual void | setStopCondition (const OptimizationStopCondition &stopCondition)=0 |
Set the stop condition of the optimization algorithm. More... | |
virtual OptimizationStopCondition * | getStopCondition ()=0 |
Get the stop condition of the optimization algorithm. More... | |
virtual const OptimizationStopCondition * | getStopCondition () const =0 |
Get the stop condition of the optimization algorithm. More... | |
virtual OptimizationStopCondition * | getDefaultStopCondition ()=0 |
Get the default stop condition of the optimization algorithm. More... | |
virtual const OptimizationStopCondition * | getDefaultStopCondition () const =0 |
Get the default stop condition of the optimization algorithm. More... | |
virtual bool | isToleranceReached () const =0 |
Tell if the tolerance level is reached. More... | |
virtual bool | isMaximumNumberOfEvaluationsReached () const =0 |
Tell if the maximum number of function evaluations is reached. More... | |
virtual void | setMaximumNumberOfEvaluations (unsigned int max)=0 |
Set the maximum number of function evaluation to perform during optimization. More... | |
virtual void | setVerbose (unsigned int v)=0 |
Set the verbose level. More... | |
virtual unsigned int | getVerbose () const =0 |
Get the verbose level. More... | |
virtual void | setConstraintPolicy (const std::string &constraintPolicy)=0 |
Set the constraint policy for this optimizer. More... | |
virtual std::string | getConstraintPolicy () const =0 |
Get the constraint policy for this optimizer. More... | |
virtual void | addOptimizationListener (OptimizationListener *listener)=0 |
Register a listener to this class. More... | |
This is the basal interface for all optimization methods.
An optimizer deals with Function objects. Optimizer objects are event-driven: they notify listeners when a step is performed.
Definition at line 117 of file Optimizer.h.
|
inline |
Definition at line 121 of file Optimizer.h.
|
inlinevirtual |
Definition at line 122 of file Optimizer.h.
|
pure virtual |
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. |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Implemented in bpp::SimpleNewtonMultiDimensions, bpp::SimpleMultiDimensions, bpp::PowellMultiDimensions, bpp::NewtonOneDimension, bpp::NewtonBacktrackOneDimension, bpp::MetaOptimizer, bpp::GoldenSectionSearch, bpp::DownhillSimplexMethod, bpp::ConjugateGradientMultiDimensions, bpp::BrentOneDimension, and bpp::BfgsMultiDimensions.
|
pure virtual |
Get the constraint policy for this optimizer.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the default stop condition of the optimization algorithm.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the default stop condition of the optimization algorithm.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the current function being optimized.
Implemented in bpp::NewtonOneDimension, bpp::ConjugateGradientMultiDimensions, bpp::BfgsMultiDimensions, and bpp::AbstractOptimizer.
Referenced by bpp::ParametersStopCondition::init(), and bpp::FunctionStopCondition::init().
|
pure virtual |
Get the current function being optimized.
Implemented in bpp::NewtonOneDimension, bpp::ConjugateGradientMultiDimensions, bpp::BfgsMultiDimensions, and bpp::AbstractOptimizer.
|
pure virtual |
Get the current function value.
NullPointerException | If no function is associated with this optimizer. |
Implemented in bpp::GoldenSectionSearch, and bpp::AbstractOptimizer.
Referenced by bpp::FunctionStopCondition::init(), and bpp::FunctionStopCondition::isToleranceReached().
|
pure virtual |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the number of function evaluations performed since the call of the init function.
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep().
|
pure virtual |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep(), bpp::ParametersStopCondition::init(), and bpp::ParametersStopCondition::isToleranceReached().
|
pure virtual |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the stop condition of the optimization algorithm.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Get the stop condition of the optimization algorithm.
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep().
|
pure virtual |
|
pure virtual |
Tell if a funciton is associatied to this optimizer.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Set the initial values of the parameters.
params | The initial values of parameters. |
Exception | If a problem occured during initialization. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep().
|
pure virtual |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Tell if the maximum number of function evaluations is reached.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Tell if the tolerance level is reached.
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
Perform as many optimization steps untill the stop condition is met.
Exception | If a problem occured during optimization or if the optimizer has not been initialized. |
Implemented in bpp::PowellMultiDimensions, bpp::DownhillSimplexMethod, bpp::BrentOneDimension, and bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep().
|
pure virtual |
Set the constraint policy for this optimizer.
constraintPolicy | The constraint policy. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doInit().
|
pure virtual |
Set the function to optimize.
function | The function to optimize. |
Implemented in bpp::SimpleNewtonMultiDimensions, bpp::SimpleMultiDimensions, bpp::MetaOptimizer, and bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::setFunction().
|
pure virtual |
Set the maximum number of function evaluation to perform during optimization.
max | The maximum number of evaluations to perform. |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
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. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doInit().
|
pure virtual |
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. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doInit().
|
pure virtual |
Set the stop condition of the optimization algorithm.
stopCondition | The stop condition to use while optimizing. |
Implemented in bpp::AbstractOptimizer.
|
pure virtual |
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. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doInit().
|
pure virtual |
Perform an optimization step.
Exception | If a problem occured during optimization or if the optimizer has not been initialized. |
Implemented in bpp::AbstractOptimizer.
Referenced by bpp::MetaOptimizer::doStep().