Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MnHesse.h
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
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_MnHesse
12
13#include "Minuit2/MnConfig.h"
14#include "Minuit2/MnStrategy.h"
15
16#include <ROOT/RSpan.hxx>
17
18#include <vector>
19
20namespace ROOT {
21
22namespace Minuit2 {
23
24class FCNBase;
25class MnUserParameterState;
26class MnUserParameters;
27class MnUserCovariance;
28class MnUserTransformation;
29class MinimumState;
30class MnMachinePrecision;
31class MnFcn;
32class FunctionMinimum;
33
34//_______________________________________________________________________
35/**
36 API class for calculating the numerical covariance matrix
37 (== 2x Inverse Hessian == 2x Inverse 2nd derivative); can be used by the
38 user or Minuit itself
39 */
40
41class MnHesse {
42
43public:
44 /// default constructor with default strategy
46
47 /// constructor with user-defined strategy level
48 MnHesse(unsigned int stra) : fStrategy(MnStrategy(stra)) {}
49
50 /// conctructor with specific strategy
51 MnHesse(const MnStrategy &stra) : fStrategy(stra) {}
52
53 /// FCN + MnUserParameterState
54 MnUserParameterState operator()(const FCNBase &, const MnUserParameterState &, unsigned int maxcalls = 0) const;
55 ///
56 /// API to use MnHesse after minimization when function minimum is avalilable, otherwise information on the last
57 /// state will be lost. (It would be needed to re-call the gradient and spend extra useless function calls) The
58 /// Function Minimum is updated (modified) by adding the Hesse results as last state of minimization
59 ///
60 void operator()(const FCNBase &, FunctionMinimum &, unsigned int maxcalls = 0) const;
61
62 /// internal interface
63 ///
65 operator()(const MnFcn &, const MinimumState &, const MnUserTransformation &, unsigned int maxcalls = 0) const;
66
67 /// forward interface of MnStrategy
68 unsigned int Ncycles() const { return fStrategy.HessianNCycles(); }
69 double Tolerstp() const { return fStrategy.HessianStepTolerance(); }
70 double TolerG2() const { return fStrategy.HessianG2Tolerance(); }
71
72private:
73
74 /// internal function to compute the Hessian using numerical derivative computation
75 MinimumState ComputeNumerical(const MnFcn &, const MinimumState &, const MnUserTransformation &, unsigned int maxcalls) const;
76
77 /// internal function to compute the Hessian using an analytical computation or externally provided in the FCNBase class
79
81};
82
83} // namespace Minuit2
84
85} // namespace ROOT
86
87#endif // ROOT_Minuit2_MnHesse
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition FCNBase.h:51
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Wrapper class to FCNBase interface used internally by Minuit.
Definition MnFcn.h:30
API class for calculating the numerical covariance matrix (== 2x Inverse Hessian == 2x Inverse 2nd de...
Definition MnHesse.h:41
MnHesse(const MnStrategy &stra)
conctructor with specific strategy
Definition MnHesse.h:51
MinimumState ComputeAnalytical(const FCNBase &, const MinimumState &, const MnUserTransformation &) const
internal function to compute the Hessian using an analytical computation or externally provided in th...
Definition MnHesse.cxx:80
MnHesse()
default constructor with default strategy
Definition MnHesse.h:45
double Tolerstp() const
Definition MnHesse.h:69
MnUserParameterState operator()(const FCNBase &, const MnUserParameterState &, unsigned int maxcalls=0) const
FCN + MnUserParameterState.
Definition MnHesse.cxx:31
unsigned int Ncycles() const
forward interface of MnStrategy
Definition MnHesse.h:68
MinimumState ComputeNumerical(const MnFcn &, const MinimumState &, const MnUserTransformation &, unsigned int maxcalls) const
internal function to compute the Hessian using numerical derivative computation
Definition MnHesse.cxx:151
MnStrategy fStrategy
Definition MnHesse.h:80
MnHesse(unsigned int stra)
constructor with user-defined strategy level
Definition MnHesse.h:48
double TolerG2() const
Definition MnHesse.h:70
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
Definition MnStrategy.h:27
double HessianG2Tolerance() const
Definition MnStrategy.h:46
double HessianStepTolerance() const
Definition MnStrategy.h:45
unsigned int HessianNCycles() const
Definition MnStrategy.h:44
class which holds the external user and/or internal Minuit representation of the parameters and error...
class dealing with the transformation between user specified parameters (external) and internal param...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...