Logo ROOT  
Reference Guide
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 <vector>
17 
18 namespace ROOT {
19 
20 namespace Minuit2 {
21 
22 class FCNBase;
23 class MnUserParameterState;
24 class MnUserParameters;
25 class MnUserCovariance;
26 class MnUserTransformation;
27 class MinimumState;
28 class MnMachinePrecision;
29 class MnFcn;
30 class FunctionMinimum;
31 
32 //_______________________________________________________________________
33 /**
34  API class for calculating the numerical covariance matrix
35  (== 2x Inverse Hessian == 2x Inverse 2nd derivative); can be used by the
36  user or Minuit itself
37  */
38 
39 class MnHesse {
40 
41 public:
42  /// default constructor with default strategy
44 
45  /// constructor with user-defined strategy level
46  MnHesse(unsigned int stra) : fStrategy(MnStrategy(stra)) {}
47 
48  /// conctructor with specific strategy
49  MnHesse(const MnStrategy &stra) : fStrategy(stra) {}
50 
51  ~MnHesse() {}
52 
53  ///
54  /// low-level API
55  ///
56  /// FCN + parameters + errors
57  MnUserParameterState operator()(const FCNBase &, const std::vector<double> &, const std::vector<double> &,
58  unsigned int maxcalls = 0) const;
59  /// FCN + parameters + covariance
60  MnUserParameterState operator()(const FCNBase &, const std::vector<double> &, unsigned int nrow,
61  const std::vector<double> &, unsigned int maxcalls = 0) const;
62  /// FCN + parameters + MnUserCovariance
64  operator()(const FCNBase &, const std::vector<double> &, const MnUserCovariance &, unsigned int maxcalls = 0) const;
65  ///
66  /// high-level API
67  ///
68  /// FCN + MnUserParameters
69  MnUserParameterState operator()(const FCNBase &, const MnUserParameters &, unsigned int maxcalls = 0) const;
70  /// FCN + MnUserParameters + MnUserCovariance
72  operator()(const FCNBase &, const MnUserParameters &, const MnUserCovariance &, unsigned int maxcalls = 0) const;
73  /// FCN + MnUserParameterState
74  MnUserParameterState operator()(const FCNBase &, const MnUserParameterState &, unsigned int maxcalls = 0) const;
75  ///
76  /// API to use MnHesse after minimization when function mimimum is avalilable, otherwise information on the last
77  /// state will be lost. (It would be needed to re-call the gradient and spend extra useless function calls) The
78  /// Function Minimum is updated (modified) by adding the Hesse results as last state of minimization
79  ///
80  void operator()(const FCNBase &, FunctionMinimum &, unsigned int maxcalls = 0) const;
81 
82  /// internal interface
83  ///
85  operator()(const MnFcn &, const MinimumState &, const MnUserTransformation &, unsigned int maxcalls = 0) const;
86 
87  /// forward interface of MnStrategy
88  unsigned int Ncycles() const { return fStrategy.HessianNCycles(); }
89  double Tolerstp() const { return fStrategy.HessianStepTolerance(); }
90  double TolerG2() const { return fStrategy.HessianG2Tolerance(); }
91 
92 private:
94 };
95 
96 } // namespace Minuit2
97 
98 } // namespace ROOT
99 
100 #endif // ROOT_Minuit2_MnHesse
ROOT::Minuit2::MnStrategy::HessianStepTolerance
double HessianStepTolerance() const
Definition: MnStrategy.h:45
ROOT::Minuit2::MnHesse::~MnHesse
~MnHesse()
Definition: MnHesse.h:51
ROOT::Minuit2::MnFcn
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:30
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:27
MnStrategy.h
ROOT::Minuit2::MnHesse::operator()
MnUserParameterState operator()(const FCNBase &, const std::vector< double > &, const std::vector< double > &, unsigned int maxcalls=0) const
low-level API
Definition: MnHesse.cxx:28
ROOT::Minuit2::FCNBase
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition: FCNBase.h:45
ROOT::Minuit2::MnHesse::MnHesse
MnHesse()
default constructor with default strategy
Definition: MnHesse.h:43
ROOT::Minuit2::MnHesse::fStrategy
MnStrategy fStrategy
Definition: MnHesse.h:93
ROOT::Minuit2::MnUserCovariance
Class containing the covariance matrix data represented as a vector of size n*(n+1)/2 Used to hide in...
Definition: MnUserCovariance.h:26
ROOT::Minuit2::MnHesse::MnHesse
MnHesse(const MnStrategy &stra)
conctructor with specific strategy
Definition: MnHesse.h:49
ROOT::Minuit2::MnStrategy::HessianNCycles
unsigned int HessianNCycles() const
Definition: MnStrategy.h:44
ROOT::Minuit2::MnUserParameters
API class for the user interaction with the parameters; serves as input to the minimizer as well as o...
Definition: MnUserParameters.h:36
ROOT::Minuit2::MnStrategy::HessianG2Tolerance
double HessianG2Tolerance() const
Definition: MnStrategy.h:46
ROOT::Minuit2::MnUserTransformation
class dealing with the transformation between user specified parameters (external) and internal param...
Definition: MnUserTransformation.h:38
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:36
ROOT::Minuit2::MnHesse::MnHesse
MnHesse(unsigned int stra)
constructor with user-defined strategy level
Definition: MnHesse.h:46
ROOT::Minuit2::MnHesse::TolerG2
double TolerG2() const
Definition: MnHesse.h:90
ROOT::Minuit2::MnUserParameterState
class which holds the external user and/or internal Minuit representation of the parameters and error...
Definition: MnUserParameterState.h:33
ROOT::Minuit2::MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
ROOT::Minuit2::MnHesse
API class for calculating the numerical covariance matrix (== 2x Inverse Hessian == 2x Inverse 2nd de...
Definition: MnHesse.h:39
ROOT::Minuit2::MnHesse::Ncycles
unsigned int Ncycles() const
forward interface of MnStrategy
Definition: MnHesse.h:88
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
MnConfig.h
ROOT::Minuit2::MnHesse::Tolerstp
double Tolerstp() const
Definition: MnHesse.h:89