18 #ifndef itkPowellOptimizerv4_h
19 #define itkPowellOptimizerv4_h
59 template <
typename TInternalComputationValueType>
76 using typename Superclass::ParametersType;
77 using typename Superclass::MeasureType;
78 using typename Superclass::ScalesType;
81 itkSetMacro(MaximumIteration,
unsigned int);
82 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
86 itkSetMacro(MaximumLineIteration,
unsigned int);
87 itkGetConstMacro(MaximumLineIteration,
unsigned int);
92 itkSetMacro(StepLength,
double);
93 itkGetConstReferenceMacro(StepLength,
double);
98 itkSetMacro(StepTolerance,
double);
99 itkGetConstReferenceMacro(StepTolerance,
double);
105 itkSetMacro(ValueTolerance,
double);
106 itkGetConstReferenceMacro(ValueTolerance,
double);
110 itkGetConstReferenceMacro(CurrentCost,
MeasureType);
114 return this->GetCurrentCost();
119 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
123 StartOptimization(
bool doOnlyInitialization =
false)
override;
134 itkGetConstReferenceMacro(CatchGetValueException,
bool);
135 itkSetMacro(CatchGetValueException,
bool);
136 itkBooleanMacro(CatchGetValueException);
138 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
139 itkSetMacro(MetricWorstPossibleValue,
double);
142 GetStopConditionDescription()
const override;
149 PrintSelf(std::ostream & os,
Indent indent)
const override;
151 itkSetMacro(CurrentCost,
double);
156 SetLine(
const ParametersType & origin,
const vnl_vector<double> & direction);
162 GetLineValue(
double x)
const;
165 GetLineValue(
double x, ParametersType & tempCoord)
const;
170 SetCurrentLinePoint(
double x,
double fx);
175 Swap(
double * a,
double * b)
const;
180 Shift(
double * a,
double * b,
double * c,
double d)
const;
192 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3);
195 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3, ParametersType & tempCoord);
203 BracketedLineOptimize(
double ax,
207 double functionValueOfb,
213 BracketedLineOptimize(
double ax,
217 double functionValueOfb,
221 ParametersType & tempCoord);
223 itkGetMacro(SpaceDimension,
unsigned int);
227 this->m_SpaceDimension = dim;
228 this->m_LineDirection.set_size(dim);
229 this->m_LineOrigin.set_size(dim);
230 this->m_CurrentPosition.set_size(dim);
234 itkSetMacro(CurrentIteration,
unsigned int);
236 itkGetMacro(Stop,
bool);
237 itkSetMacro(Stop,
bool);
240 unsigned int m_SpaceDimension{ 0 };
243 unsigned int m_CurrentLineIteration{ 0 };
246 unsigned int m_MaximumIteration{ 100 };
247 unsigned int m_MaximumLineIteration{ 100 };
249 bool m_CatchGetValueException{
false };
250 double m_MetricWorstPossibleValue{ 0 };
253 double m_StepLength{ 0 };
254 double m_StepTolerance{ 0 };
257 vnl_vector<double> m_LineDirection{};
259 double m_ValueTolerance{ 0 };
268 bool m_Stop{
false };
272 std::ostringstream m_StopConditionDescription{};
276 #ifndef ITK_MANUAL_INSTANTIATION
277 # include "itkPowellOptimizerv4.hxx"