Orfeo Toolbox  4.0
itkLBFGSBOptimizer.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 __itkLBFGSBOptimizer_h
19 #define __itkLBFGSBOptimizer_h
20 
21 #include "itkIntTypes.h"
23 
24 namespace itk
25 {
26 /* Necessary forward declaration see below for definition */
34 class LBFGSBOptimizerHelper;
35 
64 {
65 public:
71 
73  itkNewMacro(Self);
74 
77 
82 
87 
89  typedef vnl_vector< double > InternalBoundValueType;
90 
92  typedef vnl_vector< long > InternalBoundSelectionType;
93 
96 
98  void StartOptimization(void);
99 
101  virtual void SetCostFunction(SingleValuedCostFunction *costFunction);
102 
106  virtual void SetTrace(bool flag);
107 
108  itkGetMacro(Trace, bool);
109  itkBooleanMacro(Trace);
110 
112  virtual void SetLowerBound(const BoundValueType & value);
113  itkGetConstReferenceMacro(LowerBound,BoundValueType);
114 
116  virtual void SetUpperBound(const BoundValueType & value);
117  itkGetConstReferenceMacro(UpperBound,BoundValueType);
118 
125  virtual void SetBoundSelection(const BoundSelectionType & select);
126  itkGetConstReferenceMacro(BoundSelection,BoundSelectionType);
127 
134  virtual void SetCostFunctionConvergenceFactor(double);
135 
136  itkGetMacro(CostFunctionConvergenceFactor, double);
137 
142  virtual void SetProjectedGradientTolerance(double);
143 
144  itkGetMacro(ProjectedGradientTolerance, double);
145 
147  virtual void SetMaximumNumberOfIterations(unsigned int);
148 
149  itkGetMacro(MaximumNumberOfIterations, unsigned int);
150 
152  virtual void SetMaximumNumberOfEvaluations(unsigned int);
153 
154  itkGetMacro(MaximumNumberOfEvaluations, unsigned int);
155 
157  virtual void SetMaximumNumberOfCorrections(unsigned int);
158 
159  itkGetMacro(MaximumNumberOfCorrections, unsigned int);
160 
162  void SetScales(const ScalesType &)
163  {
164  itkExceptionMacro(<< "This optimizer does not support scales.");
165  }
166 
168  itkGetConstReferenceMacro(CurrentIteration, unsigned int);
169 
171  MeasureType GetValue() const;
172 
175  itkGetConstReferenceMacro(InfinityNormOfProjectedGradient, double);
176 
178  const std::string GetStopConditionDescription() const;
179 
180 protected:
181  LBFGSBOptimizer();
182  virtual ~LBFGSBOptimizer();
183  void PrintSelf(std::ostream & os, Indent indent) const;
184 
186 
187 private:
188  LBFGSBOptimizer(const Self &); //purposely not implemented
189  void operator=(const Self &); //purposely not implemented
190 
191  // give the helper access to member variables, to update iteration
192  // counts, etc.
193  friend class LBFGSBOptimizerHelper;
194 
195  bool m_Trace;
202  unsigned int m_CurrentIteration;
204 
209 };
210 } // end namespace itk
211 
212 #endif

Generated at Sat Mar 8 2014 15:06:52 for Orfeo Toolbox with doxygen 1.8.3.1