Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:11

0001 // @(#)root/minuit2:$Id$
0002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005
0003 
0004 /**********************************************************************
0005  *                                                                    *
0006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
0007  *                                                                    *
0008  **********************************************************************/
0009 
0010 #ifndef ROOT_Minuit2_FumiliGradientCalculator
0011 #define ROOT_Minuit2_FumiliGradientCalculator
0012 
0013 #include "Minuit2/AnalyticalGradientCalculator.h"
0014 #include "Minuit2/MnMatrix.h"
0015 
0016 namespace ROOT {
0017 
0018 namespace Minuit2 {
0019 
0020 class FumiliFCNBase;
0021 class MnUserTransformation;
0022 
0023 /// Fumili gradient calculator using external gradient provided by FCN
0024 /// Note that the computed Hessian and G2 are an approximation valid for small residuals
0025 class FumiliGradientCalculator : public AnalyticalGradientCalculator {
0026 
0027 public:
0028    FumiliGradientCalculator(const FumiliFCNBase &fcn, const MnUserTransformation &trafo, int n);
0029 
0030    ~FumiliGradientCalculator() override {}
0031 
0032    FunctionGradient operator()(const MinimumParameters &) const override;
0033 
0034    FunctionGradient operator()(const MinimumParameters &, const FunctionGradient &) const override;
0035 
0036    const MnUserTransformation &Trafo() const { return fTransformation; }
0037 
0038    const MnAlgebraicSymMatrix &GetHessian() const { return fHessian; }
0039 
0040    bool Hessian(const MinimumParameters &, MnAlgebraicSymMatrix &) const override;
0041 
0042    bool G2(const MinimumParameters &, MnAlgebraicVector &) const override;
0043 
0044    bool CanComputeG2() const override { return true;}
0045 
0046    bool CanComputeHessian() const override { return true;}
0047 
0048 
0049 private:
0050    const FumiliFCNBase &fFcn;
0051    mutable MnAlgebraicSymMatrix fHessian;
0052 };
0053 
0054 } // namespace Minuit2
0055 
0056 } // namespace ROOT
0057 
0058 #endif // ROOT_Minuit2_FumiliGradientCalculator