ITK  4.13.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 {
85 class ITKOptimizersv4_EXPORT LBFGSOptimizerv4:
86  public LBFGSOptimizerBasev4< vnl_lbfgs >
87 {
88 public:
94 
95  typedef Superclass::MetricType MetricType;
96  typedef Superclass::ParametersType ParametersType;
97  typedef Superclass::ScalesType ScalesType;
98 
100  itkNewMacro(Self);
101 
103  itkTypeMacro(LBFGSOptimizerv4, Superclass);
104 
106  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
107 
109  virtual void SetMetric(MetricType *metric) ITK_OVERRIDE;
110 
111  void VerboseOn();
112  void VerboseOff();
113 
120  void SetLineSearchAccuracy(double tol);
121 
122  itkGetConstMacro(LineSearchAccuracy, double);
123 
128  void SetDefaultStepLength(double stp);
129 
130  itkGetConstMacro(DefaultStepLength, double);
131 
132 protected:
134  virtual ~LBFGSOptimizerv4() ITK_OVERRIDE;
135  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
136 
138  typedef vnl_vector< double > InternalParametersType;
139 
141  typedef vnl_lbfgs InternalOptimizerType;
142 
143 private:
144  ITK_DISALLOW_COPY_AND_ASSIGN(LBFGSOptimizerv4);
145 
146  bool m_Verbose;
147  double m_LineSearchAccuracy;
148  double m_DefaultStepLength;
149 };
150 } // end namespace itk
151 #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. The vnl_lbfgs is a wrapper f...