itkContinuousLBFGSOptimizer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkContinuousLBFGSOptimizer.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) Insight Software Consortium. All rights reserved.
00008   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even 
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00012      PURPOSE.  See the above copyright notices for more information.
00013 
00014 =========================================================================*/
00015 #ifndef __itkContinuousLBFGSOptimizer_h
00016 #define __itkContinuousLBFGSOptimizer_h
00017 
00018 #include "itkSingleValuedNonLinearVnlOptimizer.h"
00019 #include "vnl/algo/vnl_lbfgs.h"
00020 
00021 namespace itk
00022 {
00023   
00035 class ITK_EXPORT ContinuousLBFGSOptimizer : 
00036     public SingleValuedNonLinearVnlOptimizer
00037 {
00038 public:
00040   typedef ContinuousLBFGSOptimizer                     Self;
00041   typedef SingleValuedNonLinearVnlOptimizer   Superclass;
00042   typedef SmartPointer<Self>                  Pointer;
00043   typedef SmartPointer<const Self>            ConstPointer;
00044   
00046   itkNewMacro(Self);
00047 
00049   itkTypeMacro( ContinuousLBFGSOptimizer, SingleValuedNonLinearVnlOptimizer );
00050 
00052   typedef   vnl_vector<double>     InternalParametersType;
00053 
00055   typedef   vnl_lbfgs             InternalOptimizerType;
00056 
00058   vnl_lbfgs * GetOptimizer(void);
00059 
00061   void StartOptimization( void );
00062 
00064   virtual void SetCostFunction( SingleValuedCostFunction * costFunction );
00065 
00066   itkGetMacro( ErrorOccurred, bool );
00067 
00071   virtual void SetTrace( bool flag );
00072   itkGetMacro( Trace, bool );
00073   itkBooleanMacro( Trace );
00074 
00076   virtual void SetMaximumNumberOfFunctionEvaluations( unsigned int n );
00077   itkGetMacro( MaximumNumberOfFunctionEvaluations, unsigned int );
00078 
00084   virtual void SetGradientConvergenceTolerance( double gtol );
00085   itkGetMacro( GradientConvergenceTolerance, double );
00086 
00093   virtual void SetLineSearchAccuracy( double tol );
00094   itkGetMacro( LineSearchAccuracy, double );
00095 
00100   virtual void SetDefaultStepLength( double stp );
00101   itkGetMacro( DefaultStepLength, double );
00102 
00104   MeasureType GetValue();
00105 
00106 protected:
00107   ContinuousLBFGSOptimizer();
00108   virtual ~ContinuousLBFGSOptimizer();
00109   void PrintSelf(std::ostream& os, Indent indent) const;
00110 
00111   typedef Superclass::CostFunctionAdaptorType   CostFunctionAdaptorType;
00112 
00113 private:
00114   ContinuousLBFGSOptimizer(const Self&); //purposely not implemented
00115   void operator=(const Self&); //purposely not implemented
00116   
00117   bool                          m_OptimizerInitialized;
00118   InternalOptimizerType       * m_VnlOptimizer;
00119 
00120   bool                          m_Trace;
00121   unsigned int                  m_MaximumNumberOfFunctionEvaluations;
00122   double                        m_GradientConvergenceTolerance;
00123   double                        m_LineSearchAccuracy;
00124   double                        m_DefaultStepLength;
00125   bool                          m_ErrorOccurred;
00126 
00127 };
00128 
00129 } // end namespace itk
00130 
00131 
00132 
00133 #endif
00134 
00135 
00136 

Generated at Sat Oct 13 18:14:02 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000