Orfeo Toolbox  3.16
itkLBFGSBOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLBFGSBOptimizer.h,v $
5  Language: C++
6  Date: $Date: 2010-05-12 19:38:30 $
7  Version: $Revision: 1.11 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkLBFGSBOptimizer_h
18 #define __itkLBFGSBOptimizer_h
19 
21 
22 namespace itk
23 {
24 
32 
33 
61 {
62 public:
68 
70  itkNewMacro(Self);
71 
74 
79 
84 
87 
90 
93 
94 
96  void StartOptimization( void );
97 
99  virtual void SetCostFunction( SingleValuedCostFunction * costFunction );
100 
104  virtual void SetTrace( bool flag );
105  itkGetMacro( Trace, bool );
106  itkBooleanMacro( Trace );
107 
109  virtual void SetLowerBound( const BoundValueType & value );
110  virtual const BoundValueType & GetLowerBound();
111 
113  virtual void SetUpperBound( const BoundValueType & value );
114  virtual const BoundValueType & GetUpperBound();
115 
122  virtual void SetBoundSelection( const BoundSelectionType & select );
123  virtual const BoundSelectionType & GetBoundSelection();
124 
131  virtual void SetCostFunctionConvergenceFactor( double );
132  itkGetMacro( CostFunctionConvergenceFactor, double );
133 
138  virtual void SetProjectedGradientTolerance( double );
139  itkGetMacro( ProjectedGradientTolerance, double );
140 
142  virtual void SetMaximumNumberOfIterations( unsigned int );
143  itkGetMacro( MaximumNumberOfIterations, unsigned int );
144 
146  virtual void SetMaximumNumberOfEvaluations( unsigned int );
147  itkGetMacro( MaximumNumberOfEvaluations, unsigned int );
148 
150  virtual void SetMaximumNumberOfCorrections( unsigned int );
151  itkGetMacro( MaximumNumberOfCorrections, unsigned int );
152 
154  void SetScales( const ScalesType & )
155  {
156  itkExceptionMacro( << "This optimizer does not support scales." );
157  }
158 
160  itkGetConstReferenceMacro( CurrentIteration, unsigned int );
161 
163  MeasureType GetValue() const;
164 
167  itkGetConstReferenceMacro( InfinityNormOfProjectedGradient, double );
168 
170  const std::string GetStopConditionDescription() const;
171 
172 protected:
173  LBFGSBOptimizer();
174  virtual ~LBFGSBOptimizer();
175  void PrintSelf(std::ostream& os, Indent indent) const;
176 
177  typedef Superclass::CostFunctionAdaptorType CostFunctionAdaptorType;
178 
179 private:
180  LBFGSBOptimizer(const Self&); //purposely not implemented
181  void operator=(const Self&); //purposely not implemented
182 
183  // give the helper access to member variables, to update iteration
184  // counts, etc.
185  friend class LBFGSBOptimizerHelper;
186 
187  bool m_Trace;
190  mutable OStringStream m_StopConditionDescription;
194 
200 
201  unsigned int m_CurrentIteration;
203 
204 };
205 
206 } // end namespace itk
207 
208 #endif

Generated at Sat Feb 2 2013 23:50:58 for Orfeo Toolbox with doxygen 1.8.1.1