ITK  4.13.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:
42 
44  itkNewMacro(Self);
45 
48 
50  typedef vnl_vector< double > InternalParametersType;
51 
53  typedef vnl_levenberg_marquardt InternalOptimizerType;
54 
56  vnl_levenberg_marquardt * GetOptimizer() const;
57 
59  virtual void StartOptimization(void) ITK_OVERRIDE;
60 
62  virtual void SetCostFunction(MultipleValuedCostFunction *costFunction) ITK_OVERRIDE;
63 
64  void SetNumberOfIterations(unsigned int iterations);
65 
66  void SetValueTolerance(double tol);
67 
68  void SetGradientTolerance(double tol);
69 
70  void SetEpsilonFunction(double epsilon);
71 
73  MeasureType GetValue() const;
74 
75  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
76 
77 protected:
79  virtual ~LevenbergMarquardtOptimizer() ITK_OVERRIDE;
80 
82 
83 private:
84  ITK_DISALLOW_COPY_AND_ASSIGN(LevenbergMarquardtOptimizer);
85 
86  bool m_OptimizerInitialized;
87  InternalOptimizerType *m_VnlOptimizer;
88  unsigned int m_NumberOfIterations;
89  double m_ValueTolerance;
90  double m_GradientTolerance;
91  double m_EpsilonFunction;
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.
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Wrap of the vnl_levenberg_marquardt algorithm.
MultipleValuedNonLinearVnlOptimizer Superclass