00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLBFGSBOptimizer_h
00018 #define __itkLBFGSBOptimizer_h
00019
00020 #include "itkSingleValuedNonLinearOptimizer.h"
00021 #include <string>
00022
00023 namespace itk
00024 {
00025
00051 class ITK_EXPORT LBFGSBOptimizer :
00052 public SingleValuedNonLinearOptimizer
00053 {
00054 public:
00056 typedef LBFGSBOptimizer Self;
00057 typedef SingleValuedNonLinearOptimizer Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkNewMacro(Self);
00063
00065 itkTypeMacro( LBFGSBOptimizer, SingleValuedNonLinearOptimizer );
00066
00070 typedef Array<double> BoundValueType;
00071
00075 typedef Array<int> BoundSelectionType;
00076
00078 void StartOptimization( void );
00079
00081 typedef SingleValuedCostFunction CostFunctionType;
00082 typedef CostFunctionType::Pointer CostFunctionPointer;
00083 typedef CostFunctionType::MeasureType MeasureType;
00084
00086 virtual void SetLowerBound( const BoundValueType & value );
00087 virtual const BoundValueType & GetLowerBound();
00088
00090 virtual void SetUpperBound( const BoundValueType & value );
00091 virtual const BoundValueType & GetUpperBound();
00092
00099 virtual void SetBoundSelection( const BoundSelectionType & select );
00100 virtual const BoundSelectionType & GetBoundSelection();
00101
00108 itkSetMacro( CostFunctionConvergenceFactor, double );
00109 itkGetMacro( CostFunctionConvergenceFactor, double );
00110
00115 itkSetMacro( ProjectedGradientTolerance, double );
00116 itkGetMacro( ProjectedGradientTolerance, double );
00117
00119 itkSetMacro( MaximumNumberOfIterations, unsigned int );
00120 itkGetMacro( MaximumNumberOfIterations, unsigned int );
00121
00123 itkSetMacro( MaximumNumberOfEvaluations, unsigned int );
00124 itkGetMacro( MaximumNumberOfEvaluations, unsigned int );
00125
00127 itkSetMacro( MaximumNumberOfCorrections, unsigned int );
00128 itkGetMacro( MaximumNumberOfCorrections, unsigned int );
00129
00131 void SetScales( const ScalesType & )
00132 {
00133 itkExceptionMacro( << "This optimizer does not support scales." );
00134 }
00135
00137 itkGetConstReferenceMacro( CurrentIteration, unsigned int );
00138
00140 itkGetConstReferenceMacro( Value, MeasureType );
00141
00144 itkGetConstReferenceMacro( InfinityNormOfProjectedGradient, double );
00145
00146 protected:
00147 LBFGSBOptimizer();
00148 virtual ~LBFGSBOptimizer();
00149 void PrintSelf(std::ostream& os, Indent indent) const;
00150
00151
00152 private:
00153 LBFGSBOptimizer(const Self&);
00154 void operator=(const Self&);
00155
00156 BoundValueType m_LowerBound;
00157 BoundValueType m_UpperBound;
00158 BoundSelectionType m_BoundSelection;
00159
00160 double m_CostFunctionConvergenceFactor;
00161 double m_ProjectedGradientTolerance;
00162 unsigned int m_MaximumNumberOfIterations;
00163 unsigned int m_MaximumNumberOfEvaluations;
00164 unsigned int m_MaximumNumberOfCorrections;
00165
00166 unsigned int m_CurrentIteration;
00167 MeasureType m_Value;
00168 double m_InfinityNormOfProjectedGradient;
00169
00170 };
00171
00172 }
00173
00174
00175
00176 #endif
00177
00178
00179