ITK  6.0.0
Insight Toolkit
itkLevenbergMarquardtOptimizer.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 itkLevenbergMarquardtOptimizer_h
19#define itkLevenbergMarquardtOptimizer_h
20
22#include "vnl/algo/vnl_levenberg_marquardt.h"
23#include "ITKOptimizersExport.h"
24#include <memory> // For unique_ptr.
25
26namespace itk
27{
39{
40public:
41 ITK_DISALLOW_COPY_AND_MOVE(LevenbergMarquardtOptimizer);
42
48
50 itkNewMacro(Self);
51
53 itkOverrideGetNameOfClassMacro(LevenbergMarquardtOptimizer);
54
56 using InternalParametersType = vnl_vector<double>;
57
59 using InternalOptimizerType = vnl_levenberg_marquardt;
60
62 vnl_levenberg_marquardt *
63 GetOptimizer() const;
64
66 void
68
70 void
72
73 void
74 SetNumberOfIterations(unsigned int iterations);
75
76 void
77 SetValueTolerance(double tol);
78
79 void
81
82 void
83 SetEpsilonFunction(double epsilon);
84
87 GetValue() const;
88
89 std::string
91
92protected:
95
96 using CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType;
97
98private:
99 bool m_OptimizerInitialized{};
100 std::unique_ptr<InternalOptimizerType> m_VnlOptimizer;
101 unsigned int m_NumberOfIterations{};
102 double m_ValueTolerance{};
103 double m_GradientTolerance{};
104 double m_EpsilonFunction{};
105};
106} // end namespace itk
107
108#endif
Wrap of the vnl_levenberg_marquardt algorithm.
vnl_levenberg_marquardt * GetOptimizer() const
void SetNumberOfIterations(unsigned int iterations)
void SetEpsilonFunction(double epsilon)
std::string GetStopConditionDescription() const override
void SetCostFunction(MultipleValuedCostFunction *costFunction) override
MeasureType GetValue() const
std::unique_ptr< InternalOptimizerType > m_VnlOptimizer
void SetValueTolerance(double tol)
void SetGradientTolerance(double tol)
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Light weight base class for most itk classes.
This class is a base for the CostFunctions returning a multiple values.
This class is a base for the Optimization methods that optimize a multi-valued function.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....