18 #ifndef itkPowellOptimizer_h
19 #define itkPowellOptimizer_h
24 #include "ITKOptimizersExport.h"
86 itkSetMacro(Maximize,
bool);
87 itkBooleanMacro(Maximize);
88 itkGetConstReferenceMacro(Maximize,
bool);
92 itkSetMacro(MaximumIteration,
unsigned int);
93 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
97 itkSetMacro(MaximumLineIteration,
unsigned int);
98 itkGetConstMacro(MaximumLineIteration,
unsigned int);
103 itkSetMacro(StepLength,
double);
104 itkGetConstReferenceMacro(StepLength,
double);
109 itkSetMacro(StepTolerance,
double);
110 itkGetConstReferenceMacro(StepTolerance,
double);
116 itkSetMacro(ValueTolerance,
double);
117 itkGetConstReferenceMacro(ValueTolerance,
double);
121 itkGetConstReferenceMacro(CurrentCost, MeasureType);
122 MeasureType
GetValue()
const {
return this->GetCurrentCost(); }
126 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
129 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
132 virtual void StartOptimization() ITK_OVERRIDE;
137 void StopOptimization()
140 itkGetConstReferenceMacro(CatchGetValueException,
bool);
141 itkSetMacro(CatchGetValueException,
bool);
143 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
144 itkSetMacro(MetricWorstPossibleValue,
double);
146 virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
150 PowellOptimizer(const PowellOptimizer &);
151 virtual ~PowellOptimizer();
152 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
154 itkSetMacro(CurrentCost,
double);
158 void SetLine(const ParametersType & origin,
159 const vnl_vector<
double > & direction);
164 double GetLineValue(
double x) const;
166 double GetLineValue(
double x, ParametersType & tempCoord) const;
170 void SetCurrentLinePoint(
double x,
double fx);
174 void Swap(
double *a,
double *b) const;
178 void Shift(
double *a,
double *b,
double *c,
double d) const;
189 virtual
void LineBracket(
double *ax,
double *bx,
double *cx,
190 double *fa,
double *fb,
double *fc);
192 virtual
void LineBracket(
double *ax,
double *bx,
double *cx,
193 double *fa,
double *fb,
double *fc,
194 ParametersType & tempCoord);
201 virtual
void BracketedLineOptimize(
double ax,
double bx,
double cx,
202 double fa,
double fb,
double fc,
203 double *extX,
double *extVal);
205 virtual
void BracketedLineOptimize(
double ax,
double bx,
double cx,
206 double fa,
double fb,
double fc,
207 double *extX,
double *extVal,
208 ParametersType & tempCoord);
210 itkGetMacro(SpaceDimension,
unsigned int);
211 void SetSpaceDimension(
unsigned int dim)
213 this->m_SpaceDimension = dim;
214 this->m_LineDirection.set_size(dim);
215 this->m_LineOrigin.set_size(dim);
216 this->m_CurrentPosition.set_size(dim);
220 itkSetMacro(CurrentIteration,
unsigned int);
222 itkGetMacro(Stop,
bool);
223 itkSetMacro(Stop,
bool);
unsigned int m_MaximumIteration
SmartPointer< const Self > ConstPointer
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.
unsigned int m_MaximumLineIteration
CostFunctionType::Pointer CostFunctionPointer
unsigned int m_SpaceDimension
SingleValuedCostFunction CostFunctionType
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
SmartPointer< Self > Pointer
SingleValuedNonLinearOptimizer::ParametersType ParametersType
ParametersType m_LineOrigin
SingleValuedNonLinearOptimizer Superclass
Control indentation during Print() invocation.
unsigned int m_CurrentIteration