Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkLBFGSBOptimizer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLBFGSBOptimizer.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/07/25 14:41:15 $
00007   Version:   $Revision: 1.6 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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<long>                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();
00089 
00091   virtual void SetUpperBound( const BoundValueType & value );
00092   virtual const BoundValueType & GetUpperBound();
00094 
00101   virtual void SetBoundSelection( const BoundSelectionType & select );
00102   virtual const BoundSelectionType & GetBoundSelection();
00104 
00111   itkSetMacro( CostFunctionConvergenceFactor, double );
00112   itkGetMacro( CostFunctionConvergenceFactor, double );
00114 
00119   itkSetMacro( ProjectedGradientTolerance, double );
00120   itkGetMacro( ProjectedGradientTolerance, double );
00122 
00124   itkSetMacro( MaximumNumberOfIterations, unsigned int );
00125   itkGetMacro( MaximumNumberOfIterations, unsigned int );
00127 
00129   itkSetMacro( MaximumNumberOfEvaluations, unsigned int );
00130   itkGetMacro( MaximumNumberOfEvaluations, unsigned int );
00132 
00134   itkSetMacro( MaximumNumberOfCorrections, unsigned int );
00135   itkGetMacro( MaximumNumberOfCorrections, unsigned int );
00137 
00139   void SetScales( const ScalesType & )
00140     {
00141     itkExceptionMacro( << "This optimizer does not support scales." );
00142     }
00143 
00145   itkGetConstReferenceMacro( CurrentIteration, unsigned int );
00146 
00148   itkGetConstReferenceMacro( Value, MeasureType );
00149 
00152   itkGetConstReferenceMacro( InfinityNormOfProjectedGradient, double );
00153 
00154 protected:
00155   LBFGSBOptimizer();
00156   virtual ~LBFGSBOptimizer();
00157   void PrintSelf(std::ostream& os, Indent indent) const;
00158 
00159 
00160 private:
00161   LBFGSBOptimizer(const Self&); //purposely not implemented
00162   void operator=(const Self&); //purposely not implemented
00163   
00164   BoundValueType        m_LowerBound;
00165   BoundValueType        m_UpperBound;
00166   BoundSelectionType    m_BoundSelection;
00167 
00168   double                m_CostFunctionConvergenceFactor;
00169   double                m_ProjectedGradientTolerance;
00170   unsigned int          m_MaximumNumberOfIterations;
00171   unsigned int          m_MaximumNumberOfEvaluations;
00172   unsigned int          m_MaximumNumberOfCorrections;
00173 
00174   unsigned int          m_CurrentIteration;
00175   MeasureType           m_Value;
00176   double                m_InfinityNormOfProjectedGradient;
00177 
00178 };
00179 
00180 } // end namespace itk
00181 
00182 
00183 
00184 #endif
00185 
00186 
00187 
00188 

Generated at Mon Mar 12 01:30:07 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000