ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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{
63
65{
66public:
72
74 itkNewMacro(Self);
75
77 itkOverrideGetNameOfClassMacro(OnePlusOneEvolutionaryOptimizer);
78
82
85
87 itkSetMacro(Maximize, bool);
88 itkBooleanMacro(Maximize);
89 itkGetConstReferenceMacro(Maximize, bool);
91
92 bool
94 {
95 return !m_Maximize;
96 }
97 void
99 {
100 this->SetMaximize(!v);
101 }
102 void
104 {
105 SetMaximize(false);
106 }
107 void
109 {
110 SetMaximize(true);
111 }
112
114 itkSetMacro(MaximumIteration, unsigned int);
115 itkGetConstReferenceMacro(MaximumIteration, unsigned int);
117
119 itkSetMacro(GrowthFactor, double);
120 itkGetConstReferenceMacro(GrowthFactor, double);
122
124 itkSetMacro(ShrinkFactor, double);
125 itkGetConstReferenceMacro(ShrinkFactor, double);
127
129 itkSetMacro(InitialRadius, double);
130 itkGetConstReferenceMacro(InitialRadius, double);
132
135 itkSetMacro(Epsilon, double);
136 itkGetConstReferenceMacro(Epsilon, double);
138
140 itkGetConstReferenceMacro(FrobeniusNorm, double);
141
142 void
144
151 void
152 Initialize(double initialRadius, double grow = -1, double shrink = -1);
153
155 itkGetConstReferenceMacro(CurrentCost, MeasureType);
157 GetValue() const
158 {
159 return this->GetCurrentCost();
160 }
161
162
164 itkGetConstReferenceMacro(CurrentIteration, unsigned int);
165
167 itkGetConstReferenceMacro(Initialized, bool);
168
172 void
174
178 void
180 {
181 m_Stop = true;
182 }
183
184 itkGetConstReferenceMacro(CatchGetValueException, bool);
185 itkSetMacro(CatchGetValueException, bool);
186
187 itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
188 itkSetMacro(MetricWorstPossibleValue, double);
189
190 std::string
192
193protected:
197 void
198 PrintSelf(std::ostream & os, Indent indent) const override;
199
200private:
203
205 unsigned int m_MaximumIteration{};
206
208 unsigned int m_CurrentIteration{};
209
212
215
218 double m_Epsilon{};
219
222
225
228
231
234
239 bool m_Stop{};
240
242 std::ostringstream m_StopConditionDescription{};
243
247}; // end of class
248} // end of namespace itk
249
250#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
NormalVariateGeneratorType::Pointer m_RandomGenerator
void Initialize(double initialRadius, double grow=-1, double shrink=-1)
void SetNormalVariateGenerator(NormalVariateGeneratorType *generator)
void PrintSelf(std::ostream &os, Indent indent) const override
Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType
~OnePlusOneEvolutionaryOptimizer() override=default
std::string GetStopConditionDescription() const override
virtual const MeasureType & GetCurrentCost() const
virtual void SetMaximize(bool _arg)
OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer &)
This class is a base for the CostFunctions returning a single value.
Implements transparent reference counting.
Defines common interfaces for random variate generators.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....