18#ifndef itkPowellOptimizer_h
19#define itkPowellOptimizer_h
24#include "ITKOptimizersExport.h"
84 itkSetMacro(Maximize,
bool);
85 itkBooleanMacro(Maximize);
86 itkGetConstReferenceMacro(Maximize,
bool);
90 itkSetMacro(MaximumIteration,
unsigned int);
91 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
95 itkSetMacro(MaximumLineIteration,
unsigned int);
96 itkGetConstMacro(MaximumLineIteration,
unsigned int);
101 itkSetMacro(StepLength,
double);
102 itkGetConstReferenceMacro(StepLength,
double);
107 itkSetMacro(StepTolerance,
double);
108 itkGetConstReferenceMacro(StepTolerance,
double);
114 itkSetMacro(ValueTolerance,
double);
115 itkGetConstReferenceMacro(ValueTolerance,
double);
123 return this->GetCurrentCost();
128 itkGetConstReferenceMacro(CurrentIteration,
unsigned int);
131 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
146 itkGetConstReferenceMacro(CatchGetValueException,
bool);
147 itkSetMacro(CatchGetValueException,
bool);
149 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
150 itkSetMacro(MetricWorstPossibleValue,
double);
162 itkSetMacro(CurrentCost,
double);
186 Swap(
double * a,
double * b)
const;
191 Shift(
double * a,
double * b,
double * c,
double d)
const;
203 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3);
218 double functionValueOfb,
228 double functionValueOfb,
234 itkGetMacro(SpaceDimension,
unsigned int);
238 this->m_SpaceDimension = dim;
239 this->m_LineDirection.set_size(dim);
240 this->m_LineOrigin.set_size(dim);
241 this->m_CurrentPosition.set_size(dim);
245 itkSetMacro(CurrentIteration,
unsigned int);
247 itkGetMacro(Stop,
bool);
248 itkSetMacro(Stop,
bool);
251 unsigned int m_SpaceDimension{};
254 unsigned int m_CurrentIteration{};
255 unsigned int m_CurrentLineIteration{};
258 unsigned int m_MaximumIteration{};
259 unsigned int m_MaximumLineIteration{};
261 bool m_CatchGetValueException{};
262 double m_MetricWorstPossibleValue{};
268 double m_StepLength{};
269 double m_StepTolerance{};
272 vnl_vector<double> m_LineDirection{};
274 double m_ValueTolerance{};
285 std::ostringstream m_StopConditionDescription{};
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Implements Powell optimization using Brent line search.
void SetSpaceDimension(unsigned int dim)
std::string GetStopConditionDescription() const override
virtual void LineBracket(double *x1, double *x2, double *x3, double *f1, double *f2, double *f3)
virtual void LineBracket(double *x1, double *x2, double *x3, double *f1, double *f2, double *f3, ParametersType &tempCoord)
void SetLine(const ParametersType &origin, const vnl_vector< double > &direction)
void StartOptimization() override
PowellOptimizer(const PowellOptimizer &)
virtual void BracketedLineOptimize(double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal)
double GetLineValue(double x, ParametersType &tempCoord) const
double GetLineValue(double x) const
void SetCurrentLinePoint(double x, double fx)
void Swap(double *a, double *b) const
void PrintSelf(std::ostream &os, Indent indent) const override
void Shift(double *a, double *b, double *c, double d) const
MeasureType GetValue() const
~PowellOptimizer() override
virtual void BracketedLineOptimize(double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal, ParametersType &tempCoord)
This class is a base for the CostFunctions returning a single value.
This class is a base for the Optimization methods that optimize a single valued function.
CostFunctionType::MeasureType MeasureType
Superclass::ParametersType ParametersType
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....