ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkAmoebaOptimizer.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 itkAmoebaOptimizer_h
19#define itkAmoebaOptimizer_h
20
22#include "vnl/algo/vnl_amoeba.h"
23#include "ITKOptimizersExport.h"
24#include <memory> // For unique_ptr.
25
26namespace itk
27{
67class ITKOptimizers_EXPORT AmoebaOptimizer : public SingleValuedNonLinearVnlOptimizer
68{
69public:
70 ITK_DISALLOW_COPY_AND_MOVE(AmoebaOptimizer);
71
77 using NumberOfIterationsType = unsigned int;
78
80 itkNewMacro(Self);
81
83 itkOverrideGetNameOfClassMacro(AmoebaOptimizer);
84
88
90 using InternalParametersType = vnl_vector<double>;
91
93 void
95
97 void
98 SetCostFunction(SingleValuedCostFunction * costFunction) override;
99
103 itkSetMacro(MaximumNumberOfIterations, NumberOfIterationsType);
104 itkGetConstMacro(MaximumNumberOfIterations, NumberOfIterationsType);
106
115 itkSetMacro(AutomaticInitialSimplex, bool);
116 itkBooleanMacro(AutomaticInitialSimplex);
117 itkGetConstMacro(AutomaticInitialSimplex, bool);
119
126 itkSetMacro(OptimizeWithRestarts, bool);
127 itkBooleanMacro(OptimizeWithRestarts);
128 itkGetConstMacro(OptimizeWithRestarts, bool);
130
133 void
134 SetInitialSimplexDelta(ParametersType initialSimplexDelta, bool automaticInitialSimplex = false);
135 itkGetConstMacro(InitialSimplexDelta, ParametersType);
137
142 itkSetMacro(ParametersConvergenceTolerance, double);
143 itkGetConstMacro(ParametersConvergenceTolerance, double);
145
150 itkSetMacro(FunctionConvergenceTolerance, double);
151 itkGetConstMacro(FunctionConvergenceTolerance, double);
153
155 std::string
157
160 GetValue() const;
161
163 vnl_amoeba *
165
166protected:
169 void
170 PrintSelf(std::ostream & os, Indent indent) const override;
171
173
174private:
176 void
178
181 CostFunctionType::MeasureType m_FunctionConvergenceTolerance{};
185 std::unique_ptr<vnl_amoeba> m_VnlOptimizer;
186
187 std::ostringstream m_StopConditionDescription{};
188};
189} // end namespace itk
190
191#endif
SmartPointer< const Self > ConstPointer
MeasureType GetValue() const
std::string GetStopConditionDescription() const override
std::unique_ptr< vnl_amoeba > m_VnlOptimizer
ParametersType::ValueType m_ParametersConvergenceTolerance
void SetInitialSimplexDelta(ParametersType initialSimplexDelta, bool automaticInitialSimplex=false)
CostFunctionType::MeasureType m_FunctionConvergenceTolerance
void SetCostFunction(SingleValuedCostFunction *costFunction) override
SingleValuedNonLinearVnlOptimizer Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
unsigned int NumberOfIterationsType
void StartOptimization() override
vnl_amoeba * GetOptimizer() const
NumberOfIterationsType m_MaximumNumberOfIterations
SmartPointer< Self > Pointer
vnl_vector< double > InternalParametersType
Superclass::ParametersType ParametersType
std::ostringstream m_StopConditionDescription
ParametersType m_InitialSimplexDelta
~AmoebaOptimizer() override
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Control indentation during Print() invocation.
Definition itkIndent.h:50
Superclass::ParametersType ParametersType
This class is a base for the CostFunctions returning a single value.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....