go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkRSGDEachParameterApartBaseOptimizer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef itkRSGDEachParameterApartBaseOptimizer_h
20#define itkRSGDEachParameterApartBaseOptimizer_h
21
22#include "itkSingleValuedNonLinearOptimizer.h"
23
24namespace itk
25{
26
37{
38public:
40
44 using Pointer = SmartPointer<Self>;
45 using ConstPointer = SmartPointer<const Self>;
46
48 itkNewMacro(Self);
49
52
55 {
62 };
63
65 itkSetMacro(Maximize, bool);
66 itkGetConstMacro(Maximize, bool);
67 itkBooleanMacro(Maximize);
68 bool
70 {
71 return !m_Maximize;
72 }
73 void
75 {
76 this->SetMaximize(!v);
77 }
78 void
80 {
81 SetMaximize(false);
82 }
83 void
85 {
86 SetMaximize(true);
87 }
88
90 void
92
95 void
97
100 void
102
104 itkSetMacro(MaximumStepLength, double);
105 itkSetMacro(MinimumStepLength, double);
106 itkSetMacro(NumberOfIterations, unsigned long);
107 itkSetMacro(GradientMagnitudeTolerance, double);
108 itkGetConstMacro(MaximumStepLength, double);
109 itkGetConstMacro(MinimumStepLength, double);
110 itkGetConstMacro(NumberOfIterations, unsigned long);
111 itkGetConstMacro(GradientMagnitudeTolerance, double);
112 itkGetConstMacro(CurrentIteration, unsigned long);
113 itkGetConstMacro(StopCondition, StopConditionType);
114 itkGetConstMacro(Value, MeasureType);
115 itkGetConstReferenceMacro(Gradient, DerivativeType);
116
118 itkGetConstReferenceMacro(CurrentStepLengths, DerivativeType);
119
121 itkGetConstMacro(CurrentStepLength, double);
122
124 itkGetConstMacro(GradientMagnitude, double);
125
126protected:
129 void
130 PrintSelf(std::ostream & os, Indent indent) const override;
131
135 virtual void
137
148 virtual void
149 StepAlongGradient(const DerivativeType &, const DerivativeType &)
150 {
151 ExceptionObject ex;
152 ex.SetLocation(__FILE__);
153 ex.SetDescription("This method MUST be overloaded in derived classes");
154 throw ex;
155 }
156
157
158private:
159 DerivativeType m_Gradient;
160 DerivativeType m_PreviousGradient;
161
162 bool m_Stop{ false };
163 bool m_Maximize{ false };
164 MeasureType m_Value{ 0.0 };
166 double m_MaximumStepLength{ 1.0 };
167 double m_MinimumStepLength{ 1e-3 };
168
170 DerivativeType m_CurrentStepLengths;
173
175 unsigned long m_NumberOfIterations{ 100 };
176 unsigned long m_CurrentIteration{ 0 };
177
178 double m_GradientMagnitude{ 0.0 };
179};
180
181} // end namespace itk
182
183#endif // end #ifndef itkRSGDEachParameterApartBaseOptimizer_h
ITK_DISALLOW_COPY_AND_MOVE(RSGDEachParameterApartBaseOptimizer)
~RSGDEachParameterApartBaseOptimizer() override=default
virtual void StepAlongGradient(const DerivativeType &, const DerivativeType &)
void PrintSelf(std::ostream &os, Indent indent) const override


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo