BFGSFitter.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #include <map>
00015 
00016 #ifndef _BFGSFitter_H_
00017 #define _BFGSFitter_H_
00018 
00019 #include "Fitter.h"
00020 
00021 namespace hippodraw {
00022 
00033 class MDL_HIPPOPLOT_API BFGSFitter: public Fitter
00034 {
00035 private:
00036 
00037   /* Using compiler generated copy constructor. 
00038      BFGSFitter ( const BFGSFitter & )
00039   */
00040 
00042   std::vector< std::vector< double > > m_M;
00043   
00045   std::vector< double > m_xinit;
00046   
00050   double m_grad_cutoff;
00051   
00055   double m_step_cutoff;
00056   
00059   double m_proj_cutoff;
00060   
00077   double m_c1, m_c2;
00078   
00081   double m_alpha_max; 
00082   
00085   double m_alpha1;
00086 
00088   std::map< std::string, double * >  m_iter_params;
00089     
00090  public:
00092   BFGSFitter ( const char * name );
00093   
00094   Fitter * clone () const;
00095   
00099   virtual int calcCovariance ( std::vector< std::vector < double > >& cov );
00100   
00104   double wolfeStep( const std::vector< double > & x0,
00105                     const std::vector< double > & p ) const;
00106 
00110   double zoom( const std::vector< double >& x0,
00111                const std::vector< double >& p,
00112                double phi0, double dphi0,
00113                double Alphalo, double Alphahi ) const;
00114 
00116   double interpolate( const std::vector< double >& x0,
00117                       const std::vector< double >& p,
00118                       double Alphaim, double Alphai ) const;
00119   
00121   double function( const std::vector< double > & x ) const;
00122 
00124   std::vector< double > gradient( const std::vector< double > & x ) const;
00125 
00128   double gradp( const std::vector< double > & u,
00129                 const std::vector< double > & p ) const;
00130   
00132   const std::vector< double > & initIter() const;
00133   
00135   int setInitIter( const std::vector< double > & xinit );
00136 
00141   double iterParam( std::string name );
00142 
00147   int setIterParam( std::string name, double value );  
00148   
00152   virtual bool calcBestFit(); 
00153 
00154 };
00155 
00156 } // namespace hippodraw
00157 
00158 #endif // _BFGSFitter_H_

Generated for HippoDraw Class Library by doxygen