| 1 | // @(#)root/minuit2:$Id$cxx . . $ `<file>/extern/root/math/minuit2/inc/Minuit2/MnHesse.h`/ |
| 2 | // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 |
| 3 | |
| 4 | /********************************************************************** |
| 5 | * * |
| 6 | * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * |
| 7 | * * |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #ifndef ROOT_Minuit2_MnHesse |
| 11 | #define ROOT_Minuit2_MnHessecxx . . $ `extern/root/math/minuit2/inc/Minuit2/MnHesse.h:11:9`! |
| 12 | |
| 13 | #include "Minuit2/MnConfig.h"cxx . . $ `<file>/extern/root/math/minuit2/inc/Minuit2/MnConfig.h`/ |
| 14 | #include "Minuit2/MnStrategy.h"cxx . . $ `<file>/extern/root/math/minuit2/inc/Minuit2/MnStrategy.h`/ |
| 15 | |
| 16 | #include <vector> |
| 17 | |
| 18 | namespace ROOTcxx . . $ ROOT/ { |
| 19 | |
| 20 | namespace Minuit2cxx . . $ ROOT/Minuit2/ { |
| 21 | |
| 22 | class FCNBasecxx . . $ ROOT/Minuit2/FCNBase#; |
| 23 | class MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState#; |
| 24 | class MnUserParameterscxx . . $ ROOT/Minuit2/MnUserParameters#; |
| 25 | class MnUserCovariancecxx . . $ ROOT/Minuit2/MnUserCovariance#; |
| 26 | class MnUserTransformationcxx . . $ ROOT/Minuit2/MnUserTransformation#; |
| 27 | class MinimumStatecxx . . $ ROOT/Minuit2/MinimumState#; |
| 28 | class MnMachinePrecisioncxx . . $ ROOT/Minuit2/MnMachinePrecision#; |
| 29 | class MnFcncxx . . $ ROOT/Minuit2/MnFcn#; |
| 30 | class FunctionMinimumcxx . . $ ROOT/Minuit2/FunctionMinimum#; |
| 31 | class FCNGradientBasecxx . . $ ROOT/Minuit2/FCNGradientBase#; |
| 32 | |
| 33 | //_______________________________________________________________________ |
| 34 | /** |
| 35 | API class for calculating the numerical covariance matrix |
| 36 | (== 2x Inverse Hessian == 2x Inverse 2nd derivative); can be used by the |
| 37 | user or Minuit itself |
| 38 | */ |
| 39 | |
| 40 | class MnHessecxx . . $ ROOT/Minuit2/MnHesse# { |
| 41 | |
| 42 | public: |
| 43 | /// default constructor with default strategy |
| 44 | MnHessecxx . . $ ROOT/Minuit2/MnHesse#MnHesse(49f6e7a06ebc5aa8).() : fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy.(MnStrategycxx . . $ ROOT/Minuit2/MnStrategy#(1)) {} |
| 45 | |
| 46 | /// constructor with user-defined strategy level |
| 47 | MnHessecxx . . $ ROOT/Minuit2/MnHesse#MnHesse(cb2f890c2fdad230).(unsigned int stra) : fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy.(MnStrategycxx . . $ ROOT/Minuit2/MnStrategy#(stra)) {} |
| 48 | |
| 49 | /// conctructor with specific strategy |
| 50 | MnHessecxx . . $ ROOT/Minuit2/MnHesse#MnHesse(564b3aaaa870a8e5).(const MnStrategycxx . . $ ROOT/Minuit2/MnStrategy# &stra) : fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy.(stra) {} |
| 51 | |
| 52 | ~cxx . . $ ROOT/Minuit2/MnHesse#`~MnHesse`(49f6e7a06ebc5aa8).MnHessecxx . . $ ROOT/Minuit2/MnHesse#() {} |
| 53 | |
| 54 | /// |
| 55 | /// low-level API |
| 56 | /// |
| 57 | /// FCN + parameters + errors |
| 58 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(d46616841b945a1d).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> &, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> &, |
| 59 | unsigned int maxcalls = 0) const; |
| 60 | /// FCN + parameters + covariance |
| 61 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(357875b3a28c556d).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> &, unsigned int nrow, |
| 62 | const stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> &, unsigned int maxcalls = 0) const; |
| 63 | /// FCN + parameters + MnUserCovariance |
| 64 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# |
| 65 | operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(8855b8dde8da2c0c).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const stdcxx . . $ std/::vectorcxx . . $ std/vector#<double> &, const MnUserCovariancecxx . . $ ROOT/Minuit2/MnUserCovariance# &, unsigned int maxcalls = 0) const; |
| 66 | /// |
| 67 | /// high-level API |
| 68 | /// |
| 69 | /// FCN + MnUserParameters |
| 70 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(1462d08b8a44ec84).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const MnUserParameterscxx . . $ ROOT/Minuit2/MnUserParameters# &, unsigned int maxcalls = 0) const; |
| 71 | /// FCN + MnUserParameters + MnUserCovariance |
| 72 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# |
| 73 | operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(5ac009948512d100).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const MnUserParameterscxx . . $ ROOT/Minuit2/MnUserParameters# &, const MnUserCovariancecxx . . $ ROOT/Minuit2/MnUserCovariance# &, unsigned int maxcalls = 0) const; |
| 74 | /// FCN + MnUserParameterState |
| 75 | MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(9eae79c4d771f103).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, const MnUserParameterStatecxx . . $ ROOT/Minuit2/MnUserParameterState# &, unsigned int maxcalls = 0) const; |
| 76 | /// |
| 77 | /// API to use MnHesse after minimization when function minimum is avalilable, otherwise information on the last |
| 78 | /// state will be lost. (It would be needed to re-call the gradient and spend extra useless function calls) The |
| 79 | /// Function Minimum is updated (modified) by adding the Hesse results as last state of minimization |
| 80 | /// |
| 81 | void operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(dfd2654791fca62f).()(const FCNBasecxx . . $ ROOT/Minuit2/FCNBase# &, FunctionMinimumcxx . . $ ROOT/Minuit2/FunctionMinimum# &, unsigned int maxcalls = 0) const; |
| 82 | |
| 83 | /// internal interface |
| 84 | /// |
| 85 | MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# |
| 86 | operatorcxx . . $ ROOT/Minuit2/MnHesse#`operator()`(cb6d5c368ecb1204).()(const MnFcncxx . . $ ROOT/Minuit2/MnFcn# &, const MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# &, const MnUserTransformationcxx . . $ ROOT/Minuit2/MnUserTransformation# &, unsigned int maxcalls = 0) const; |
| 87 | |
| 88 | /// forward interface of MnStrategy |
| 89 | unsigned int Ncyclescxx . . $ ROOT/Minuit2/MnHesse#Ncycles(ddd8539a2fcdd4ce).() const { return fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy..HessianNCyclescxx . . $ ROOT/Minuit2/MnStrategy#HessianNCycles(ddd8539a2fcdd4ce).(); } |
| 90 | double Tolerstpcxx . . $ ROOT/Minuit2/MnHesse#Tolerstp(21b6c25e127938e2).() const { return fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy..HessianStepTolerancecxx . . $ ROOT/Minuit2/MnStrategy#HessianStepTolerance(21b6c25e127938e2).(); } |
| 91 | double TolerG2cxx . . $ ROOT/Minuit2/MnHesse#TolerG2(21b6c25e127938e2).() const { return fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy..HessianG2Tolerancecxx . . $ ROOT/Minuit2/MnStrategy#HessianG2Tolerance(21b6c25e127938e2).(); } |
| 92 | |
| 93 | private: |
| 94 | |
| 95 | /// internal function to compute the Hessian using numerical derivative computation |
| 96 | MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# ComputeNumericalcxx . . $ ROOT/Minuit2/MnHesse#ComputeNumerical(cb6d5c368ecb1204).(const MnFcncxx . . $ ROOT/Minuit2/MnFcn# &, const MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# &, const MnUserTransformationcxx . . $ ROOT/Minuit2/MnUserTransformation# &, unsigned int maxcalls) const; |
| 97 | |
| 98 | /// internal function to compute the Hessian using an analytical computation or externally provided in the FCNGradientBase class |
| 99 | MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# ComputeAnalyticalcxx . . $ ROOT/Minuit2/MnHesse#ComputeAnalytical(37abd484788df3b4).(const FCNGradientBasecxx . . $ ROOT/Minuit2/FCNGradientBase# &, const MinimumStatecxx . . $ ROOT/Minuit2/MinimumState# &, const MnUserTransformationcxx . . $ ROOT/Minuit2/MnUserTransformation# &) const; |
| 100 | |
| 101 | MnStrategycxx . . $ ROOT/Minuit2/MnStrategy# fStrategycxx . . $ ROOT/Minuit2/MnHesse#fStrategy.; |
| 102 | }; |
| 103 | |
| 104 | } // namespace Minuit2 |
| 105 | |
| 106 | } // namespace ROOT |
| 107 | |
| 108 | #endif // ROOT_Minuit2_MnHesse |