ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLevenbergMarquardtOptimizer.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 itkLevenbergMarquardtOptimizer_h
19 #define itkLevenbergMarquardtOptimizer_h
20 
22 #include "vnl/algo/vnl_levenberg_marquardt.h"
23 #include "ITKOptimizersExport.h"
24 
25 namespace itk
26 {
33 class ITKOptimizers_EXPORT LevenbergMarquardtOptimizer:
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_ASSIGN(LevenbergMarquardtOptimizer);
38 
44 
46  itkNewMacro(Self);
47 
50 
52  using InternalParametersType = vnl_vector< double >;
53 
55  using InternalOptimizerType = vnl_levenberg_marquardt;
56 
58  vnl_levenberg_marquardt * GetOptimizer() const;
59 
61  void StartOptimization() override;
62 
64  void SetCostFunction(MultipleValuedCostFunction *costFunction) override;
65 
66  void SetNumberOfIterations(unsigned int iterations);
67 
68  void SetValueTolerance(double tol);
69 
70  void SetGradientTolerance(double tol);
71 
72  void SetEpsilonFunction(double epsilon);
73 
75  MeasureType GetValue() const;
76 
77  const std::string GetStopConditionDescription() const override;
78 
79 protected:
81  ~LevenbergMarquardtOptimizer() override;
82 
83  using CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType;
84 
85 private:
88  unsigned int m_NumberOfIterations;
92 };
93 } // end namespace itk
94 
95 #endif
Light weight base class for most itk classes.
This class is a base for the Optimization methods that optimize a multi-valued function.
This class is a base for the CostFunctions returning a multiple values.
Wrap of the vnl_levenberg_marquardt algorithm.
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType