42 #include "../NumTools.h"
64 double fret = pmd->
fret_;
82 size_t n = params.
size();
84 for (
size_t i = 0; i < n; i++)
88 for (
unsigned int j = 0; j < n; j++)
91 xi_[i][j] = (j == i) ? 1 : 0;
112 for (
size_t i = 0; i < n; i++)
115 for (
size_t j = 0; j < n; j++)
127 throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
128 if (fptt -
fret_ > del)
136 for (
size_t j = 0; j < n; j++)
154 throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
155 for (
size_t j = 0; j < n; j++)
157 xi_[j][ibig] =
xi_[j][n - 1];
158 xi_[j][n - 1] = xit[j];
double callCount_
Count the number of times the isToleranceReached() function has been called.
Partial implementation of the Optimizer interface.
OutputStream * getMessageHandler() const
void printPoint(const ParameterList ¶ms, double value)
Print parameters and corresponding function evaluation to profiler.
double optimize()
Basic implementation.
OptimizationStopCondition * getDefaultStopCondition()
Get the default stop condition of the optimization algorithm.
unsigned int nbEval_
The current number of function evaluations achieved.
const ParameterList & getParameters() const
void setStopCondition(const OptimizationStopCondition &stopCondition)
Set the stop condition of the optimization algorithm.
ParameterList & getParameters_()
OptimizationStopCondition * getStopCondition()
Get the stop condition of the optimization algorithm.
const Function * getFunction() const
Get the current function being optimized.
unsigned int getVerbose() const
Get the verbose level.
void setDefaultStopCondition_(OptimizationStopCondition *osc)
Exception base class. Overload exception constructor (to control the exceptions mechanism)....
This is the function abstract class.
virtual void setParameters(const ParameterList ¶meters)=0
Set the point where the function must be computed.
virtual double f(const ParameterList ¶meters)
Get the value of the function according to a given set of parameters.
The parameter list object.
bool isToleranceReached() const
Tell if the we reached the desired tolerance with a given new set of estimates.
double getCurrentTolerance() const
Get the current tolerance.
Powell's multi-dimensions optimization algorithm for one parameter.
double doStep()
This function is called by the step() method and contains all calculations.
friend class PMDStopCondition
PowellMultiDimensions(Function *function)
double optimize()
Basic implementation.
void doInit(const ParameterList ¶ms)
This function is called by the init() method and contains all calculations.
std::vector< double > Vdouble