18#ifndef itkPowellOptimizerv4_h
19#define itkPowellOptimizerv4_h
59template <
typename TInternalComputationValueType>
76 using typename Superclass::ParametersType;
77 using typename Superclass::MeasureType;
78 using typename Superclass::ScalesType;
81 itkSetMacro(MaximumIteration,
unsigned int);
82 itkGetConstReferenceMacro(MaximumIteration,
unsigned int);
86 itkSetMacro(MaximumLineIteration,
unsigned int);
87 itkGetConstMacro(MaximumLineIteration,
unsigned int);
92 itkSetMacro(StepLength,
double);
93 itkGetConstReferenceMacro(StepLength,
double);
98 itkSetMacro(StepTolerance,
double);
99 itkGetConstReferenceMacro(StepTolerance,
double);
105 itkSetMacro(ValueTolerance,
double);
106 itkGetConstReferenceMacro(ValueTolerance,
double);
114 return this->GetCurrentCost();
119 itkGetConstReferenceMacro(CurrentLineIteration,
unsigned int);
134 itkGetConstReferenceMacro(CatchGetValueException,
bool);
135 itkSetMacro(CatchGetValueException,
bool);
136 itkBooleanMacro(CatchGetValueException);
138 itkGetConstReferenceMacro(MetricWorstPossibleValue,
double);
139 itkSetMacro(MetricWorstPossibleValue,
double);
151 itkSetMacro(CurrentCost,
double);
175 Swap(
double * a,
double * b)
const;
180 Shift(
double * a,
double * b,
double * c,
double d)
const;
192 LineBracket(
double * x1,
double * x2,
double * x3,
double * f1,
double * f2,
double * f3);
207 double functionValueOfb,
217 double functionValueOfb,
223 itkGetMacro(SpaceDimension,
unsigned int);
227 this->m_SpaceDimension = dim;
228 this->m_LineDirection.set_size(dim);
229 this->m_LineOrigin.set_size(dim);
230 this->m_CurrentPosition.set_size(dim);
234 itkSetMacro(CurrentIteration,
unsigned int);
236 itkGetMacro(Stop,
bool);
237 itkSetMacro(Stop,
bool);
240 unsigned int m_SpaceDimension{ 0 };
243 unsigned int m_CurrentLineIteration{ 0 };
246 unsigned int m_MaximumIteration{ 100 };
247 unsigned int m_MaximumLineIteration{ 100 };
249 bool m_CatchGetValueException{
false };
250 double m_MetricWorstPossibleValue{ 0 };
253 double m_StepLength{ 0 };
254 double m_StepTolerance{ 0 };
257 vnl_vector<double> m_LineDirection{};
259 double m_ValueTolerance{ 0 };
268 bool m_Stop{
false };
272 std::ostringstream m_StopConditionDescription{};
276#ifndef ITK_MANUAL_INSTANTIATION
277# include "itkPowellOptimizerv4.hxx"
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Abstract base for object-to-object optimizers.
typename MetricType::MeasureType MeasureType
Implements Powell optimization using Brent line search.
virtual void LineBracket(double *x1, double *x2, double *x3, double *f1, double *f2, double *f3, ParametersType &tempCoord)
void StartOptimization(bool doOnlyInitialization=false) override
std::string GetStopConditionDescription() const override
virtual void BracketedLineOptimize(double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal)
PowellOptimizerv4(const PowellOptimizerv4 &)
virtual void BracketedLineOptimize(double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal, ParametersType &tempCoord)
double GetLineValue(double x, ParametersType &tempCoord) const
void SetLine(const ParametersType &origin, const vnl_vector< double > &direction)
double GetLineValue(double x) const
void Swap(double *a, double *b) const
void Shift(double *a, double *b, double *c, double d) const
const MeasureType & GetValue() const override
void SetCurrentLinePoint(double x, double fx)
void SetSpaceDimension(unsigned int dim)
virtual void LineBracket(double *x1, double *x2, double *x3, double *f1, double *f2, double *f3)
~PowellOptimizerv4() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....