MnHesse.h

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: MnHesse.h 23654 2008-05-06 07:30:34Z moneta $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #ifndef ROOT_Minuit2_MnHesse
00011 #define ROOT_Minuit2_MnHesse
00012 
00013 #include "Minuit2/MnConfig.h"
00014 #include "Minuit2/MnStrategy.h"
00015 
00016 #include <vector>
00017 
00018 namespace ROOT {
00019 
00020    namespace Minuit2 {
00021 
00022 
00023 class FCNBase;
00024 class MnUserParameterState;
00025 class MnUserParameters;
00026 class MnUserCovariance;
00027 class MnUserTransformation;
00028 class MinimumState;
00029 class MnMachinePrecision;
00030 class MnFcn;
00031 class FunctionMinimum; 
00032 
00033 //_______________________________________________________________________
00034 /** 
00035     API class for calculating the numerical covariance matrix 
00036     (== 2x Inverse Hessian == 2x Inverse 2nd derivative); can be used by the 
00037     user or Minuit itself
00038  */
00039 
00040 class MnHesse {
00041 
00042 public:
00043 
00044    /// default constructor with default strategy
00045    MnHesse() : fStrategy(MnStrategy(1)) {}
00046 
00047    /// constructor with user-defined strategy level
00048    MnHesse(unsigned int stra) : fStrategy(MnStrategy(stra)) {}
00049 
00050    /// conctructor with specific strategy
00051    MnHesse(const MnStrategy& stra) : fStrategy(stra) {}
00052 
00053    ~MnHesse() {}
00054 
00055    ///
00056    /// low-level API
00057    ///
00058    /// FCN + parameters + errors
00059    MnUserParameterState operator()(const FCNBase&, const std::vector<double>&, const std::vector<double>&, unsigned int maxcalls=0) const;
00060    /// FCN + parameters + covariance
00061    MnUserParameterState operator()(const FCNBase&, const std::vector<double>&,  unsigned int nrow, const std::vector<double>&, unsigned int maxcalls = 0) const;
00062    /// FCN + parameters + MnUserCovariance
00063    MnUserParameterState operator()(const FCNBase&, const std::vector<double>&, const MnUserCovariance&, unsigned int maxcalls=0) const;
00064    ///
00065    /// high-level API
00066    ///
00067    /// FCN + MnUserParameters
00068    MnUserParameterState operator()(const FCNBase&, const MnUserParameters&, unsigned int maxcalls=0) const;
00069    /// FCN + MnUserParameters + MnUserCovariance
00070    MnUserParameterState operator()(const FCNBase&, const MnUserParameters&, const MnUserCovariance&, unsigned int maxcalls=0) const;
00071    /// FCN + MnUserParameterState
00072    MnUserParameterState operator()(const FCNBase&, const MnUserParameterState&, unsigned int maxcalls=0) const;
00073    /// 
00074    /// API to use MnHesse after minimization when function mimimum is avalilable, otherwise information on the last state will be 
00075    /// lost. (It would be needed to re-call the gradient and spend extra useless function calls) 
00076    /// The Function Minimum is updated (modified) by adding the Hesse results as last state of minimization
00077    ///
00078    void operator()(const FCNBase&, FunctionMinimum&, unsigned int maxcalls=0) const;
00079    
00080 
00081    /// internal interface
00082    ///
00083    MinimumState operator()(const MnFcn&, const MinimumState&, const MnUserTransformation&, unsigned int maxcalls=0) const;
00084 
00085    /// forward interface of MnStrategy
00086    unsigned int Ncycles() const {return fStrategy.HessianNCycles();}
00087    double Tolerstp() const {return fStrategy.HessianStepTolerance();}
00088    double TolerG2() const {return fStrategy.HessianG2Tolerance();}
00089 
00090 private:
00091 
00092    MnStrategy fStrategy;
00093 };
00094 
00095   }  // namespace Minuit2
00096 
00097 }  // namespace ROOT
00098 
00099 #endif  // ROOT_Minuit2_MnHesse

Generated on Tue Jul 5 14:25:44 2011 for ROOT_528-00b_version by  doxygen 1.5.1