Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:23

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_AnalyticalGradientCalculator
0011 #define ROOT_Minuit2_AnalyticalGradientCalculator
0012 
0013 #include "Minuit2/GradientCalculator.h"
0014 #include "Minuit2/MnMatrixfwd.h"
0015 
0016 namespace ROOT {
0017 
0018 namespace Minuit2 {
0019 
0020 class FCNGradientBase;
0021 class MnUserTransformation;
0022 
0023 
0024 class AnalyticalGradientCalculator : public GradientCalculator {
0025 
0026 public:
0027    AnalyticalGradientCalculator(const FCNGradientBase &fcn, const MnUserTransformation &state)
0028       : fGradFunc(fcn), fTransformation(state)
0029    {
0030    }
0031 
0032    ~AnalyticalGradientCalculator() override {}
0033 
0034    FunctionGradient operator()(const MinimumParameters &) const override;
0035 
0036    FunctionGradient operator()(const MinimumParameters &, const FunctionGradient &) const override;
0037 
0038    /// compute Hessian matrix
0039    bool Hessian(const MinimumParameters &, MnAlgebraicSymMatrix &) const override;
0040 
0041    /// compute second derivatives (diagonal of Hessian)
0042    bool G2(const MinimumParameters &, MnAlgebraicVector &) const override;
0043 
0044    virtual bool CheckGradient() const;
0045 
0046    virtual bool CanComputeG2() const;
0047 
0048    virtual bool CanComputeHessian() const;
0049 
0050 protected:
0051    const FCNGradientBase &fGradFunc;
0052    const MnUserTransformation &fTransformation;
0053 };
0054 
0055 } // namespace Minuit2
0056 
0057 } // namespace ROOT
0058 
0059 #endif // ROOT_Minuit2_AnalyticalGradientCalculator