18 #ifndef itkPowellOptimizerv4_h
19 #define itkPowellOptimizerv4_h
58 template<
typename TInternalComputationValueType>
80 itkSetMacro(MaximumIteration,
unsigned int);
81 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
85 itkSetMacro(MaximumLineIteration,
unsigned int);
86 itkGetConstMacro(MaximumLineIteration,
unsigned int);
91 itkSetMacro(StepLength,
double);
92 itkGetConstReferenceMacro(StepLength,
double);
97 itkSetMacro(StepTolerance,
double);
98 itkGetConstReferenceMacro(StepTolerance,
double);
104 itkSetMacro(ValueTolerance,
double);
105 itkGetConstReferenceMacro(ValueTolerance,
double);
109 itkGetConstReferenceMacro(CurrentCost,
MeasureType);
114 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
117 void StartOptimization(
bool doOnlyInitialization =
false)
override;
125 itkGetConstReferenceMacro(CatchGetValueException,
bool);
126 itkSetMacro(CatchGetValueException,
bool);
128 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
129 itkSetMacro(MetricWorstPossibleValue,
double);
131 const std::string GetStopConditionDescription()
const override;
137 void PrintSelf(std::ostream & os,
Indent indent)
const override;
139 itkSetMacro(CurrentCost,
double);
143 void SetLine(
const ParametersType & origin,
144 const vnl_vector< double > & direction);
149 double GetLineValue(
double x)
const;
151 double GetLineValue(
double x, ParametersType & tempCoord)
const;
155 void SetCurrentLinePoint(
double x,
double fx);
159 void Swap(
double *a,
double *b)
const;
163 void Shift(
double *a,
double *b,
double *c,
double d)
const;
174 virtual void LineBracket(
double *ax,
double *bx,
double *cx,
175 double *fa,
double *fb,
double *fc);
177 virtual void LineBracket(
double *ax,
double *bx,
double *cx,
178 double *fa,
double *fb,
double *fc,
179 ParametersType & tempCoord);
186 virtual void BracketedLineOptimize(
double ax,
double bx,
double cx,
187 double fa,
double fb,
double fc,
188 double *extX,
double *extVal);
190 virtual void BracketedLineOptimize(
double ax,
double bx,
double cx,
191 double fa,
double fb,
double fc,
192 double *extX,
double *extVal,
193 ParametersType & tempCoord);
195 itkGetMacro(SpaceDimension,
unsigned int);
198 this->m_SpaceDimension = dim;
199 this->m_LineDirection.set_size(dim);
200 this->m_LineOrigin.set_size(dim);
201 this->m_CurrentPosition.set_size(dim);
205 itkSetMacro(CurrentIteration,
unsigned int);
207 itkGetMacro(Stop,
bool);
208 itkSetMacro(Stop,
bool);
211 unsigned int m_SpaceDimension{0};
214 unsigned int m_CurrentLineIteration{0};
217 unsigned int m_MaximumIteration{100};
218 unsigned int m_MaximumLineIteration{100};
220 bool m_CatchGetValueException{
false};
221 double m_MetricWorstPossibleValue{0};
224 double m_StepLength{0};
225 double m_StepTolerance{0};
230 double m_ValueTolerance{0};
247 #ifndef ITK_MANUAL_INSTANTIATION
248 #include "itkPowellOptimizerv4.hxx"
Light weight base class for most itk classes.
Implements Powell optimization using Brent line search.
typename MetricType::MeasureType MeasureType
const MeasureType & GetValue() const override
vnl_vector< double > m_LineDirection
MeasureType m_CurrentCost
void SetSpaceDimension(unsigned int dim)
std::ostringstream m_StopConditionDescription
ParametersType m_CurrentPosition
ParametersType m_LineOrigin
Control indentation during Print() invocation.
Abstract base for object-to-object optimizers.