ITK  5.2.0
Insight Toolkit
itkLBFGSOptimizerv4.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 itkLBFGSOptimizerv4_h
19 #define itkLBFGSOptimizerv4_h
20 
22 #include "vnl/algo/vnl_lbfgs.h"
23 #include "ITKOptimizersv4Export.h"
24 
25 namespace itk
26 {
86 
87 class ITKOptimizersv4_EXPORT LBFGSOptimizerv4 : public LBFGSOptimizerBasev4<vnl_lbfgs>
88 {
89 public:
90  ITK_DISALLOW_COPY_AND_MOVE(LBFGSOptimizerv4);
91 
97 
98  using MetricType = Superclass::MetricType;
99  using ParametersType = Superclass::ParametersType;
100  using ScalesType = Superclass::ScalesType;
101 
103  itkNewMacro(Self);
104 
106  itkTypeMacro(LBFGSOptimizerv4, Superclass);
107 
109  void
110  StartOptimization(bool doOnlyInitialization = false) override;
111 
113  void
114  SetMetric(MetricType * metric) override;
115 
116  void
117  VerboseOn();
118  void
119  VerboseOff();
120 
127  void
128  SetLineSearchAccuracy(double f);
129 
130  itkGetConstMacro(LineSearchAccuracy, double);
131 
136  void
137  SetDefaultStepLength(double f);
138 
139  itkGetConstMacro(DefaultStepLength, double);
140 
141 protected:
143  ~LBFGSOptimizerv4() override;
144  void
145  PrintSelf(std::ostream & os, Indent indent) const override;
146 
148  using InternalParametersType = vnl_vector<double>;
149 
151  using InternalOptimizerType = vnl_lbfgs;
152 
153 private:
154  bool m_Verbose{ false };
155  double m_LineSearchAccuracy{ 0.9 };
156  double m_DefaultStepLength{ 1.0 };
157 };
158 } // end namespace itk
159 #endif
itk::LBFGSOptimizerv4::ScalesType
Superclass::ScalesType ScalesType
Definition: itkLBFGSOptimizerv4.h:100
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LBFGSOptimizerv4::InternalOptimizerType
vnl_lbfgs InternalOptimizerType
Definition: itkLBFGSOptimizerv4.h:151
itk::LBFGSOptimizerv4::MetricType
Superclass::MetricType MetricType
Definition: itkLBFGSOptimizerv4.h:98
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LBFGSOptimizerv4
Wrap of the vnl_lbfgs algorithm for use in ITKv4 registration framework. The vnl_lbfgs is a wrapper f...
Definition: itkLBFGSOptimizerv4.h:87
itk::LBFGSOptimizerv4::ParametersType
Superclass::ParametersType ParametersType
Definition: itkLBFGSOptimizerv4.h:99
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkLBFGSOptimizerBasev4.h
itk::LBFGSOptimizerv4::InternalParametersType
vnl_vector< double > InternalParametersType
Definition: itkLBFGSOptimizerv4.h:148
itk::LBFGSOptimizerBasev4
Abstract base for vnl lbfgs algorithm optimizers in ITKv4 registration framework.
Definition: itkLBFGSOptimizerBasev4.h:76