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 virtual void StartOptimization(
bool doOnlyInitialization =
false) ITK_OVERRIDE;
122 void StopOptimization()
125 itkGetConstReferenceMacro(CatchGetValueException,
bool);
126 itkSetMacro(CatchGetValueException,
bool);
128 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
129 itkSetMacro(MetricWorstPossibleValue,
double);
131 virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
135 PowellOptimizerv4(const PowellOptimizerv4 &);
136 virtual ~PowellOptimizerv4() ITK_OVERRIDE;
137 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_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);
196 void SetSpaceDimension(
unsigned int dim)
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);
247 #ifndef ITK_MANUAL_INSTANTIATION
248 #include "itkPowellOptimizerv4.hxx"
Light weight base class for most itk classes.
Implements Powell optimization using Brent line search.
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
bool m_CatchGetValueException
MetricType::MeasureType MeasureType
Superclass::MeasureType MeasureType
virtual const MeasureType & GetValue() const override
vnl_vector< double > m_LineDirection
MeasureType m_CurrentCost
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
double m_MetricWorstPossibleValue
Superclass::ScalesType ScalesType
std::ostringstream m_StopConditionDescription
unsigned int m_SpaceDimension
unsigned int m_MaximumLineIteration
ParametersType m_CurrentPosition
ParametersType m_LineOrigin
Control indentation during Print() invocation.
Abstract base for object-to-object optimizers.
unsigned int m_MaximumIteration
Superclass::ParametersType ParametersType
unsigned int m_CurrentLineIteration