43 #include "../NumTools.h" 60 double fret = pmd->
fret_;
78 size_t n = params.size();
80 for (
size_t i = 0; i < n; i++)
84 for(
unsigned int j = 0; j < n; j++)
87 xi_[i][j] = (j == i) ? 1 : 0;
92 fret_ = getFunction()->f(getParameters());
93 pt_ = getParameters();
102 unsigned int ibig = 0;
108 for(
unsigned int i = 0; i < n; i++)
111 for(
unsigned int j = 0; j < n; j++)
121 if (
fret_ >
fp_)
throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
122 if (fptt -
fret_ > del)
130 for (
unsigned int j = 0; j < n; j++)
147 if (
fret_ >
fp_)
throw Exception(
"DEBUG: PowellMultiDimensions::doStep(). Line minimization failed!");
148 for (
unsigned int j = 0; j < n; j++)
150 xi_[j][ibig] =
xi_[j][n - 1];
151 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.
virtual void setParameters(const ParameterList ¶meters)=0
Set the point where the function must be computed.
PowellMultiDimensions(Function *function)
virtual double f(const ParameterList ¶meters)
Get the value of the function according to a given set of parameters.
OptimizationStopCondition * getStopCondition()
Get the stop condition of the optimization algorithm.
Powell's multi-dimensions optimization algorithm for one parameter.
unsigned int getVerbose() const
Get the verbose level.
This class allows to perform a correspondence analysis.
double optimize()
Basic implementation.
double optimize()
Basic implementation.
This is the function abstract class.
ParameterList & getParameters_()
The parameter list object.
void setDefaultStopCondition_(OptimizationStopCondition *osc)
double doStep()
This function is called by the step() method and contains all calculations.
const Function * getFunction() const
Get the current function being optimized.
const ParameterList & getParameters() const
std::vector< double > Vdouble
friend class PMDStopCondition
void printPoint(const ParameterList ¶ms, double value)
Print parameters and corresponding function evaluation to profiler.
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.
void setStopCondition(const OptimizationStopCondition &stopCondition)
Set the stop condition of the optimization algorithm.
double getCurrentTolerance() const
Get the current tolerance.
OutputStream * getMessageHandler() const
OptimizationStopCondition * getDefaultStopCondition()
Get the default stop condition of the optimization algorithm.