18 #ifndef itkPowellOptimizer_h
19 #define itkPowellOptimizer_h
24 #include "ITKOptimizersExport.h"
84 itkSetMacro(Maximize,
bool);
85 itkBooleanMacro(Maximize);
86 itkGetConstReferenceMacro(Maximize,
bool);
90 itkSetMacro(MaximumIteration,
unsigned int);
91 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
95 itkSetMacro(MaximumLineIteration,
unsigned int);
96 itkGetConstMacro(MaximumLineIteration,
unsigned int);
101 itkSetMacro(StepLength,
double);
102 itkGetConstReferenceMacro(StepLength,
double);
107 itkSetMacro(StepTolerance,
double);
108 itkGetConstReferenceMacro(StepTolerance,
double);
114 itkSetMacro(ValueTolerance,
double);
115 itkGetConstReferenceMacro(ValueTolerance,
double);
119 itkGetConstReferenceMacro(CurrentCost, MeasureType);
123 return this->GetCurrentCost();
128 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
131 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
135 StartOptimization()
override;
146 itkGetConstReferenceMacro(CatchGetValueException,
bool);
147 itkSetMacro(CatchGetValueException,
bool);
149 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
150 itkSetMacro(MetricWorstPossibleValue,
double);
153 GetStopConditionDescription()
const override;
160 PrintSelf(std::ostream & os,
Indent indent)
const override;
162 itkSetMacro(CurrentCost,
double);
167 SetLine(
const ParametersType & origin,
const vnl_vector<double> & direction);
173 GetLineValue(
double x)
const;
176 GetLineValue(
double x, ParametersType & tempCoord)
const;
181 SetCurrentLinePoint(
double x,
double fx);
186 Swap(
double * a,
double * b)
const;
191 Shift(
double * a,
double * b,
double * c,
double d)
const;
203 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3);
206 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3, ParametersType & tempCoord);
214 BracketedLineOptimize(
double ax,
218 double functionValueOfb,
224 BracketedLineOptimize(
double ax,
228 double functionValueOfb,
232 ParametersType & tempCoord);
234 itkGetMacro(SpaceDimension,
unsigned int);
238 this->m_SpaceDimension = dim;
239 this->m_LineDirection.set_size(dim);
240 this->m_LineOrigin.set_size(dim);
241 this->m_CurrentPosition.set_size(dim);
245 itkSetMacro(CurrentIteration,
unsigned int);
247 itkGetMacro(Stop,
bool);
248 itkSetMacro(Stop,
bool);
251 unsigned int m_SpaceDimension{};
254 unsigned int m_CurrentIteration{};
255 unsigned int m_CurrentLineIteration{};
258 unsigned int m_MaximumIteration{};
259 unsigned int m_MaximumLineIteration{};
261 bool m_CatchGetValueException{};
262 double m_MetricWorstPossibleValue{};
268 double m_StepLength{};
269 double m_StepTolerance{};
272 vnl_vector<double> m_LineDirection{};
274 double m_ValueTolerance{};
277 MeasureType m_CurrentCost{};
285 std::ostringstream m_StopConditionDescription{};