ITK  6.0.0
Insight Toolkit
itkExhaustiveOptimizer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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#ifndef itkExhaustiveOptimizer_h
19#define itkExhaustiveOptimizer_h
20
21#include "itkIntTypes.h"
23#include "ITKOptimizersExport.h"
24
25namespace itk
26{
88class ITKOptimizers_EXPORT ExhaustiveOptimizer : public SingleValuedNonLinearOptimizer
89{
90public:
91 ITK_DISALLOW_COPY_AND_MOVE(ExhaustiveOptimizer);
92
98
101 itkNewMacro(Self);
102
104 itkOverrideGetNameOfClassMacro(ExhaustiveOptimizer);
105
107 void
109
110 void
112
114 void
116
118 void
120
121 itkSetMacro(StepLength, double);
122 itkSetMacro(NumberOfSteps, StepsType);
123 itkGetConstReferenceMacro(StepLength, double);
124 itkGetConstReferenceMacro(NumberOfSteps, StepsType);
125 itkGetConstReferenceMacro(CurrentValue, MeasureType);
126 itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
127 itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
128 itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
129 itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
130 itkGetConstReferenceMacro(CurrentIndex, ParametersType);
131 itkGetConstReferenceMacro(MaximumNumberOfIterations, SizeValueType);
132
134 std::string
136
137protected:
139 ~ExhaustiveOptimizer() override = default;
140 void
141 PrintSelf(std::ostream & os, Indent indent) const override;
142
144 void
146
147 void
149
150protected:
151 MeasureType m_CurrentValue{ 0 };
152
153 StepsType m_NumberOfSteps{};
154
155 SizeValueType m_CurrentIteration{ 0 };
156
157 bool m_Stop{ false };
158
159 unsigned int m_CurrentParameter{ 0 };
160
161 double m_StepLength{ 1.0 };
162
163 ParametersType m_CurrentIndex{};
164
165 SizeValueType m_MaximumNumberOfIterations{ 1 };
166
168
170
171 ParametersType m_MinimumMetricValuePosition{};
172
173 ParametersType m_MaximumMetricValuePosition{};
174
175private:
176 std::ostringstream m_StopConditionDescription{};
177};
178} // end namespace itk
179
180#endif
Optimizer that fully samples a grid on the parametric space.
std::string GetStopConditionDescription() const override
void IncrementIndex(ParametersType &newPosition)
void StartOptimization() override
void PrintSelf(std::ostream &os, Indent indent) const override
~ExhaustiveOptimizer() override=default
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
static constexpr T max(const T &)
This class is a base for the Optimization methods that optimize a single valued function.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition: itkIntTypes.h:86