ITK  5.3.0
Insight Toolkit
itkConjugateGradientOptimizer.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  * 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 itkConjugateGradientOptimizer_h
19 #define itkConjugateGradientOptimizer_h
20 
21 #include "itkIntTypes.h"
23 #include "vnl/algo/vnl_conjugate_gradient.h"
24 #include "ITKOptimizersExport.h"
25 
26 namespace itk
27 {
35 
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientOptimizer);
39 
45 
47  itkNewMacro(Self);
48 
51 
53  using InternalParametersType = vnl_vector<double>;
54 
56  using InternalOptimizerType = vnl_conjugate_gradient;
57 
59  vnl_conjugate_gradient *
60  GetOptimizer();
61 
63  void
64  StartOptimization() override;
65 
67  void
68  SetCostFunction(SingleValuedCostFunction * costFunction) override;
69 
72  GetNumberOfIterations() const;
73 
75  GetCurrentIteration() const;
76 
79  GetValue() const;
80 
81 protected:
83  ~ConjugateGradientOptimizer() override;
84 
85  using CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType;
86 
87 private:
91 };
92 } // end namespace itk
93 
94 #endif
itk::ConjugateGradientOptimizer::m_OptimizerInitialized
bool m_OptimizerInitialized
Definition: itkConjugateGradientOptimizer.h:89
itk::SingleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearOptimizer.h:35
itk::SmartPointer< Self >
itk::ConjugateGradientOptimizer
Wrap of the vnl_conjugate_gradient.
Definition: itkConjugateGradientOptimizer.h:34
itk::ConjugateGradientOptimizer::InternalOptimizerType
vnl_conjugate_gradient InternalOptimizerType
Definition: itkConjugateGradientOptimizer.h:56
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ConjugateGradientOptimizer::CostFunctionAdaptorType
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Definition: itkConjugateGradientOptimizer.h:85
itk::SingleValuedCostFunction
This class is a base for the CostFunctions returning a single value.
Definition: itkSingleValuedCostFunction.h:34
itk::ConjugateGradientOptimizer::m_VnlOptimizer
InternalOptimizerType * m_VnlOptimizer
Definition: itkConjugateGradientOptimizer.h:90
itkIntTypes.h
itkSingleValuedNonLinearVnlOptimizer.h
itk::ConjugateGradientOptimizer::InternalParametersType
vnl_vector< double > InternalParametersType
Definition: itkConjugateGradientOptimizer.h:53
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::SingleValuedNonLinearOptimizer::MeasureType
CostFunctionType::MeasureType MeasureType
Definition: itkSingleValuedNonLinearOptimizer.h:62
itk::SingleValuedNonLinearVnlOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearVnlOptimizer.h:37
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83