Logo ROOT   6.12/07
Reference Guide
MnMachinePrecision.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_MnMachinePrecision
11 #define ROOT_Minuit2_MnMachinePrecision
12 
13 #include <math.h>
14 
15 namespace ROOT {
16 
17  namespace Minuit2 {
18 
19 
20 /**
21  determines the relative floating point arithmetic precision. The
22  SetPrecision() method can be used to override Minuit's own determination,
23  when the user knows that the {FCN} function Value is not calculated to
24  the nominal machine accuracy.
25  */
26 
28 
29 public:
30 
32 
34 
36 
38  fEpsMac = prec.fEpsMac;
39  fEpsMa2 = prec.fEpsMa2;
40  return *this;
41  }
42 
43  /// eps returns the smallest possible number so that 1.+eps > 1.
44  double Eps() const {return fEpsMac;}
45 
46  /// eps2 returns 2*sqrt(eps)
47  double Eps2() const {return fEpsMa2;}
48 
49  /// override Minuit's own determination
50  void SetPrecision(double prec) {
51  fEpsMac = prec;
52  fEpsMa2 = 2.*sqrt(fEpsMac);
53  }
54 
55 private:
56 
57  double fEpsMac;
58  double fEpsMa2;
59 };
60 
61  } // namespace Minuit2
62 
63 } // namespace ROOT
64 
65 #endif // ROOT_Minuit2_MnMachinePrecision
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
double Eps() const
eps returns the smallest possible number so that 1.+eps > 1.
determines the relative floating point arithmetic precision.
double sqrt(double)
MnMachinePrecision(const MnMachinePrecision &prec)
double Eps2() const
eps2 returns 2*sqrt(eps)
MnMachinePrecision & operator=(const MnMachinePrecision &prec)
void SetPrecision(double prec)
override Minuit&#39;s own determination