18 #ifndef itkRegularStepGradientDescentBaseOptimizer_h
19 #define itkRegularStepGradientDescentBaseOptimizer_h
23 #include "ITKOptimizersExport.h"
49 extern ITKOptimizers_EXPORT std::ostream &
76 #if !defined(ITK_LEGACY_REMOVE)
79 static constexpr
StopConditionEnum GradientMagnitudeTolerance = StopConditionEnum::GradientMagnitudeTolerance;
80 static constexpr
StopConditionEnum StepTooSmall = StopConditionEnum::StepTooSmall;
81 static constexpr
StopConditionEnum ImageNotAvailable = StopConditionEnum::ImageNotAvailable;
82 static constexpr
StopConditionEnum CostFunctionError = StopConditionEnum::CostFunctionError;
83 static constexpr
StopConditionEnum MaximumNumberOfIterations = StopConditionEnum::MaximumNumberOfIterations;
87 itkSetMacro(Maximize,
bool);
88 itkGetConstReferenceMacro(Maximize,
bool);
89 itkBooleanMacro(Maximize);
98 this->SetMaximize(!v);
114 StartOptimization()
override;
119 ResumeOptimization();
127 itkSetMacro(MaximumStepLength,
double);
128 itkSetMacro(MinimumStepLength,
double);
129 itkSetMacro(RelaxationFactor,
double);
131 itkSetMacro(GradientMagnitudeTolerance,
double);
132 itkGetConstReferenceMacro(CurrentStepLength,
double);
133 itkGetConstReferenceMacro(MaximumStepLength,
double);
134 itkGetConstReferenceMacro(MinimumStepLength,
double);
135 itkGetConstReferenceMacro(RelaxationFactor,
double);
136 itkGetConstReferenceMacro(NumberOfIterations,
SizeValueType);
137 itkGetConstReferenceMacro(GradientMagnitudeTolerance,
double);
138 itkGetConstMacro(CurrentIteration,
unsigned int);
140 itkGetConstReferenceMacro(Value, MeasureType);
141 itkGetConstReferenceMacro(Gradient, DerivativeType);
146 GetStopConditionDescription()
const override;
152 PrintSelf(std::ostream & os,
Indent indent)
const override;
170 ex.SetLocation(__FILE__);
171 ex.SetDescription(
"This method MUST be overloaded in derived classes");
180 bool m_Stop{
false };
183 double m_GradientMagnitudeTolerance{};
184 double m_MaximumStepLength{};
185 double m_MinimumStepLength{};
186 double m_CurrentStepLength{};
187 double m_RelaxationFactor{};
191 std::ostringstream m_StopConditionDescription{};