5 #include "../NumTools.h" 27 double fret = pmd->
fret_;
45 size_t n = params.
size();
47 for (
size_t i = 0; i < n; ++i)
51 for (
unsigned int j = 0; j < n; ++j)
54 xi_[i][j] = (j == i) ? 1 : 0;
75 for (
size_t i = 0; i < n; i++)
78 for (
size_t j = 0; j < n; j++)
90 throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
91 if (fptt -
fret_ > del)
99 for (
size_t j = 0; j < n; ++j)
117 throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
118 for (
size_t j = 0; j < n; ++j)
120 xi_[j][ibig] =
xi_[j][n - 1];
121 xi_[j][n - 1] = xit[j];
bool isToleranceReached() const
Tell if the we reached the desired tolerance with a given new set of estimates.
void doInit(const ParameterList ¶ms)
This function is called by the init() method and contains all calculations.
double optimize() override
Basic implementation.
Powell's multi-dimensions optimization algorithm for one parameter.
double optimize()
Basic implementation.
std::shared_ptr< OptimizationStopCondition > getStopCondition() override
Get the stop condition of the optimization algorithm.
PowellMultiDimensions(std::shared_ptr< FunctionInterface > function)
void setDefaultStopCondition_(std::shared_ptr< OptimizationStopCondition > osc)
ParameterList & getParameters_()
const ParameterList & getParameters() const override
The parameter list object.
unsigned int getVerbose() const override
Get the verbose level.
const OptimizerInterface * optimizer_
double doStep()
This function is called by the step() method and contains all calculations.
std::vector< double > Vdouble
void printPoint(const ParameterList ¶ms, double value)
Print parameters and corresponding function evaluation to profiler.
Exception base class. Overload exception constructor (to control the exceptions mechanism). Destructor is already virtual (from std::exception)
double callCount_
Count the number of times the isToleranceReached() function has been called.
unsigned int nbEval_
The current number of function evaluations achieved.
Partial implementation of the Optimizer interface.
double getCurrentTolerance() const
Get the current tolerance.
const FunctionInterface & function() const override
Get the current function being optimized.
std::shared_ptr< OutputStream > getMessageHandler() const override
std::shared_ptr< const FunctionInterface > getFunction() const override
Get the current function being optimized.
std::shared_ptr< OptimizationStopCondition > getDefaultStopCondition() override
Get the default stop condition of the optimization algorithm.
std::shared_ptr< DirectionFunction > f1dim_
void setStopCondition(std::shared_ptr< OptimizationStopCondition > stopCondition) override
Set the stop condition of the optimization algorithm.