ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkLBFGSOptimizerv4.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 itkLBFGSOptimizerv4_h
19 #define itkLBFGSOptimizerv4_h
20 
22 #include "vnl/algo/vnl_lbfgs.h"
23 #include "ITKOptimizersv4Export.h"
24 
25 namespace itk
26 {
33 class ITKOptimizersv4_EXPORT LBFGSOptimizerv4:
34  public LBFGSOptimizerBasev4< vnl_lbfgs >
35 {
36 public:
42 
43  typedef Superclass::MetricType MetricType;
44  typedef Superclass::ParametersType ParametersType;
45  typedef Superclass::ScalesType ScalesType;
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(LBFGSOptimizerv4, Superclass);
52 
54  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
55 
57  virtual void SetMetric(MetricType *metric) ITK_OVERRIDE;
58 
59  void VerboseOn();
60  void VerboseOff();
61 
68  void SetLineSearchAccuracy(double tol);
69 
70  itkGetConstMacro(LineSearchAccuracy, double);
71 
76  void SetDefaultStepLength(double stp);
77 
78  itkGetConstMacro(DefaultStepLength, double);
79 
80 protected:
82  virtual ~LBFGSOptimizerv4();
83  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
84 
86  typedef vnl_vector< double > InternalParametersType;
87 
89  typedef vnl_lbfgs InternalOptimizerType;
90 
91 private:
92  LBFGSOptimizerv4(const Self &) ITK_DELETE_FUNCTION;
93  void operator=(const Self &) ITK_DELETE_FUNCTION;
94 
95  bool m_Verbose;
96  double m_LineSearchAccuracy;
97  double m_DefaultStepLength;
98 };
99 } // end namespace itk
100 #endif
Light weight base class for most itk classes.
LBFGSOptimizerBasev4< vnl_lbfgs > Superclass
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
Superclass::ParametersType ParametersType
Superclass::ScalesType ScalesType
vnl_vector< double > InternalParametersType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::MetricType MetricType
Abstract base for vnl lbfgs algorithm optimizers in ITKv4 registration framework. ...
Wrap of the vnl_lbfgs algorithm for use in ITKv4 registration framework.