ITK  5.2.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  * 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 #ifndef itkExhaustiveOptimizer_h
19 #define itkExhaustiveOptimizer_h
20 
21 #include "itkIntTypes.h"
23 #include "ITKOptimizersExport.h"
24 
25 namespace itk
26 {
83 class ITKOptimizers_EXPORT ExhaustiveOptimizer : public SingleValuedNonLinearOptimizer
84 {
85 public:
86  ITK_DISALLOW_COPY_AND_ASSIGN(ExhaustiveOptimizer);
87 
93 
96  itkNewMacro(Self);
97 
100 
101  void
102  StartOptimization() override;
103 
104  void
105  StartWalking();
106 
107  void
108  ResumeWalking();
109 
110  void
111  StopWalking();
112 
113  itkSetMacro(StepLength, double);
114  itkSetMacro(NumberOfSteps, StepsType);
115  itkGetConstReferenceMacro(StepLength, double);
116  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
117  itkGetConstReferenceMacro(CurrentValue, MeasureType);
118  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
119  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
120  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
121  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
122  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
123  itkGetConstReferenceMacro(MaximumNumberOfIterations, SizeValueType);
124 
126  const std::string
127  GetStopConditionDescription() const override;
128 
129 protected:
131  ~ExhaustiveOptimizer() override = default;
132  void
133  PrintSelf(std::ostream & os, Indent indent) const override;
134 
136  void
137  AdvanceOneStep();
138 
139  void
140  IncrementIndex(ParametersType & param);
141 
142 protected:
143  MeasureType m_CurrentValue;
144 
146 
148 
149  bool m_Stop;
150 
151  unsigned int m_CurrentParameter;
152 
153  double m_StepLength;
154 
155  ParametersType m_CurrentIndex;
156 
158 
159  MeasureType m_MaximumMetricValue;
160 
161  MeasureType m_MinimumMetricValue;
162 
164 
166 
167 private:
168  std::ostringstream m_StopConditionDescription;
169 };
170 } // end namespace itk
171 
172 #endif
itk::ExhaustiveOptimizer::m_MaximumNumberOfIterations
SizeValueType m_MaximumNumberOfIterations
Definition: itkExhaustiveOptimizer.h:157
itk::SingleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearOptimizer.h:35
itk::ExhaustiveOptimizer::m_StepLength
double m_StepLength
Definition: itkExhaustiveOptimizer.h:153
itk::ExhaustiveOptimizer::m_NumberOfSteps
StepsType m_NumberOfSteps
Definition: itkExhaustiveOptimizer.h:145
itk::ExhaustiveOptimizer::m_MaximumMetricValue
MeasureType m_MaximumMetricValue
Definition: itkExhaustiveOptimizer.h:159
itk::ExhaustiveOptimizer::m_StopConditionDescription
std::ostringstream m_StopConditionDescription
Definition: itkExhaustiveOptimizer.h:168
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ExhaustiveOptimizer::m_CurrentValue
MeasureType m_CurrentValue
Definition: itkExhaustiveOptimizer.h:143
itk::ExhaustiveOptimizer::m_CurrentIndex
ParametersType m_CurrentIndex
Definition: itkExhaustiveOptimizer.h:155
itk::ExhaustiveOptimizer
Optimizer that fully samples a grid on the parametric space.
Definition: itkExhaustiveOptimizer.h:83
itkIntTypes.h
itk::ExhaustiveOptimizer::m_MinimumMetricValue
MeasureType m_MinimumMetricValue
Definition: itkExhaustiveOptimizer.h:161
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Array< SizeValueType >
itk::ExhaustiveOptimizer::m_MaximumMetricValuePosition
ParametersType m_MaximumMetricValuePosition
Definition: itkExhaustiveOptimizer.h:165
itk::ExhaustiveOptimizer::m_CurrentIteration
SizeValueType m_CurrentIteration
Definition: itkExhaustiveOptimizer.h:147
itkSingleValuedNonLinearOptimizer.h
itk::ExhaustiveOptimizer::m_Stop
bool m_Stop
Definition: itkExhaustiveOptimizer.h:149
itk::ExhaustiveOptimizer::m_CurrentParameter
unsigned int m_CurrentParameter
Definition: itkExhaustiveOptimizer.h:151
itk::ExhaustiveOptimizer::m_MinimumMetricValuePosition
ParametersType m_MinimumMetricValuePosition
Definition: itkExhaustiveOptimizer.h:163
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83