ITK  6.0.0
Insight Toolkit
itkOnePlusOneEvolutionaryOptimizer.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 itkOnePlusOneEvolutionaryOptimizer_h
19#define itkOnePlusOneEvolutionaryOptimizer_h
20
23#include "ITKOptimizersExport.h"
24#include <string>
25
26namespace itk
27{
72{
73public:
79
81 itkNewMacro(Self);
82
84 itkOverrideGetNameOfClassMacro(OnePlusOneEvolutionaryOptimizer);
85
89
92
94 itkSetMacro(Maximize, bool);
95 itkBooleanMacro(Maximize);
96 itkGetConstReferenceMacro(Maximize, bool);
99 bool
101 {
102 return !m_Maximize;
103 }
104 void
106 {
107 this->SetMaximize(!v);
108 }
109 void
111 {
112 SetMaximize(false);
113 }
114 void
116 {
117 SetMaximize(true);
118 }
119
121 itkSetMacro(MaximumIteration, unsigned int);
122 itkGetConstReferenceMacro(MaximumIteration, unsigned int);
126 itkSetMacro(GrowthFactor, double);
127 itkGetConstReferenceMacro(GrowthFactor, double);
131 itkSetMacro(ShrinkFactor, double);
132 itkGetConstReferenceMacro(ShrinkFactor, double);
136 itkSetMacro(InitialRadius, double);
137 itkGetConstReferenceMacro(InitialRadius, double);
142 itkSetMacro(Epsilon, double);
143 itkGetConstReferenceMacro(Epsilon, double);
147 itkGetConstReferenceMacro(FrobeniusNorm, double);
148
149 void
151
158 void
159 Initialize(double initialRadius, double grow = -1, double shrink = -1);
160
162 itkGetConstReferenceMacro(CurrentCost, MeasureType);
164 GetValue() const
165 {
166 return this->GetCurrentCost();
167 }
171 itkGetConstReferenceMacro(CurrentIteration, unsigned int);
172
174 itkGetConstReferenceMacro(Initialized, bool);
175
179 void
181
185 void
187 {
188 m_Stop = true;
189 }
190
191 itkGetConstReferenceMacro(CatchGetValueException, bool);
192 itkSetMacro(CatchGetValueException, bool);
193
194 itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
195 itkSetMacro(MetricWorstPossibleValue, double);
196
197 const std::string
199
200protected:
204 void
205 PrintSelf(std::ostream & os, Indent indent) const override;
206
207private:
210
212 unsigned int m_MaximumIteration{};
213
215 unsigned int m_CurrentIteration{};
216
217 bool m_CatchGetValueException{};
218 double m_MetricWorstPossibleValue{};
219
221 bool m_Maximize{};
222
225 double m_Epsilon{};
226
228 double m_InitialRadius{};
229
231 double m_GrowthFactor{};
232
234 double m_ShrinkFactor{};
235
237 bool m_Initialized{};
238
240 MeasureType m_CurrentCost{};
241
246 bool m_Stop{};
247
249 std::ostringstream m_StopConditionDescription{};
250
253 double m_FrobeniusNorm{};
254}; // end of class
255} // end of namespace itk
256
257#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
const std::string GetStopConditionDescription() const override
void Initialize(double initialRadius, double grow=-1, double shrink=-1)
void SetNormalVariateGenerator(NormalVariateGeneratorType *generator)
void PrintSelf(std::ostream &os, Indent indent) const override
~OnePlusOneEvolutionaryOptimizer() override=default
OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer &)
This class is a base for the CostFunctions returning a single value.
This class is a base for the Optimization methods that optimize a single valued function.
Defines common interfaces for random variate generators.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....