ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkExhaustiveOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
79 class ITKOptimizers_EXPORT ExhaustiveOptimizer:
81 {
82 public:
88 
91  itkNewMacro(Self);
92 
95 
96  virtual void StartOptimization(void) ITK_OVERRIDE;
97 
98  void StartWalking();
99 
100  void ResumeWalking();
101 
102  void StopWalking();
103 
104  itkSetMacro(StepLength, double);
105  itkSetMacro(NumberOfSteps, StepsType);
106  itkGetConstReferenceMacro(StepLength, double);
107  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
108  itkGetConstReferenceMacro(CurrentValue, MeasureType);
109  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
110  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
111  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
112  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
113  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
114  itkGetConstReferenceMacro(MaximumNumberOfIterations, SizeValueType);
115 
117  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
118 
119 protected:
121  virtual ~ExhaustiveOptimizer() {}
122  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
123 
125  void AdvanceOneStep();
126 
127  void IncrementIndex(ParametersType & param);
128 
129 protected:
130  MeasureType m_CurrentValue;
131 
133 
135 
136  bool m_Stop;
137 
138  unsigned int m_CurrentParameter;
139 
140  double m_StepLength;
141 
142  ParametersType m_CurrentIndex;
143 
145 
146  MeasureType m_MaximumMetricValue;
147 
148  MeasureType m_MinimumMetricValue;
149 
151 
153 
154 private:
155  //purposely not implemented
156  ExhaustiveOptimizer(const Self &);
157  void operator=(const Self &);
158 
159  std::ostringstream m_StopConditionDescription;
160 };
161 } // end namespace itk
162 
163 #endif
Light weight base class for most itk classes.
This class is a base for the Optimization methods that optimize a single valued function.
Array< SizeValueType > StepsType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Optimizer that fully samples a grid on the parametric space.
std::ostringstream m_StopConditionDescription
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
SingleValuedNonLinearOptimizer Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ParametersType m_MaximumMetricValuePosition
ParametersType m_MinimumMetricValuePosition