18 #ifndef itkPowellOptimizer_h
19 #define itkPowellOptimizer_h
24 #include "ITKOptimizersExport.h"
85 itkSetMacro(Maximize,
bool);
86 itkBooleanMacro(Maximize);
87 itkGetConstReferenceMacro(Maximize,
bool);
91 itkSetMacro(MaximumIteration,
unsigned int);
92 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
96 itkSetMacro(MaximumLineIteration,
unsigned int);
97 itkGetConstMacro(MaximumLineIteration,
unsigned int);
102 itkSetMacro(StepLength,
double);
103 itkGetConstReferenceMacro(StepLength,
double);
108 itkSetMacro(StepTolerance,
double);
109 itkGetConstReferenceMacro(StepTolerance,
double);
115 itkSetMacro(ValueTolerance,
double);
116 itkGetConstReferenceMacro(ValueTolerance,
double);
120 itkGetConstReferenceMacro(CurrentCost, MeasureType);
121 MeasureType
GetValue()
const {
return this->GetCurrentCost(); }
125 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
128 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
131 void StartOptimization()
override;
139 itkGetConstReferenceMacro(CatchGetValueException,
bool);
140 itkSetMacro(CatchGetValueException,
bool);
142 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
143 itkSetMacro(MetricWorstPossibleValue,
double);
145 const std::string GetStopConditionDescription()
const override;
151 void PrintSelf(std::ostream & os,
Indent indent)
const override;
153 itkSetMacro(CurrentCost,
double);
157 void SetLine(
const ParametersType & origin,
158 const vnl_vector< double > & direction);
163 double GetLineValue(
double x)
const;
165 double GetLineValue(
double x, ParametersType & tempCoord)
const;
169 void SetCurrentLinePoint(
double x,
double fx);
173 void Swap(
double *a,
double *b)
const;
177 void Shift(
double *a,
double *b,
double *c,
double d)
const;
188 virtual void LineBracket(
double *ax,
double *bx,
double *cx,
189 double *fa,
double *fb,
double *fc);
191 virtual void LineBracket(
double *ax,
double *bx,
double *cx,
192 double *fa,
double *fb,
double *fc,
193 ParametersType & tempCoord);
200 virtual void BracketedLineOptimize(
double ax,
double bx,
double cx,
201 double fa,
double fb,
double fc,
202 double *extX,
double *extVal);
204 virtual void BracketedLineOptimize(
double ax,
double bx,
double cx,
205 double fa,
double fb,
double fc,
206 double *extX,
double *extVal,
207 ParametersType & tempCoord);
209 itkGetMacro(SpaceDimension,
unsigned int);
212 this->m_SpaceDimension = dim;
213 this->m_LineDirection.set_size(dim);
214 this->m_LineOrigin.set_size(dim);
215 this->m_CurrentPosition.set_size(dim);
219 itkSetMacro(CurrentIteration,
unsigned int);
221 itkGetMacro(Stop,
bool);
222 itkSetMacro(Stop,
bool);
unsigned int m_MaximumIteration
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
MeasureType m_CurrentCost
MeasureType GetValue() const
This class is a base for the Optimization methods that optimize a single valued function.
Superclass::ParametersType ParametersType
unsigned int m_MaximumLineIteration
unsigned int m_SpaceDimension
std::ostringstream m_StopConditionDescription
bool m_CatchGetValueException
unsigned int m_CurrentLineIteration
vnl_vector< double > m_LineDirection
Implements Powell optimization using Brent line search.
double m_MetricWorstPossibleValue
ParametersType m_LineOrigin
void SetSpaceDimension(unsigned int dim)
Control indentation during Print() invocation.
unsigned int m_CurrentIteration