AmpTools
URMath.h
Go to the documentation of this file.
1 // @(#)root/base:$Name: $:$Id: URMath.h,v 1.1.1.1 2006/11/15 18:01:50 mashephe Exp $
2 // Author: Fons Rademakers 29/07/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_URMath
13 #define ROOT_URMath
14 
15 
17 // //
18 // URMath //
19 // //
20 // Encapsulate math routines. For the time being avoid templates. //
21 // //
23 
24 #ifndef ROOT_URtypes
25 #include "UpRootMinuit/URtypes.h"
26 #endif
27 
28 #include <string>
29 
30 class URMath {
31 
32 private:
33  static Double_urt GamCf(Double_urt a,Double_urt x);
34  static Double_urt GamSer(Double_urt a,Double_urt x);
35 
36 public:
37 
38  // Fundamental constants
39  static Double_urt Pi() { return 3.14159265358979323846; }
40  static Double_urt TwoPi() { return 2.0 * Pi(); }
41  static Double_urt PiOver2() { return Pi() / 2.0; }
42  static Double_urt PiOver4() { return Pi() / 4.0; }
43  static Double_urt InvPi() { return 1.0 / Pi(); }
44  static Double_urt RadToDeg() { return 180.0 / Pi(); }
45  static Double_urt DegToRad() { return Pi() / 180.0; }
46 
47  // e (base of natural log)
48  static Double_urt E() { return 2.71828182845904523536; }
49 
50  // natural log of 10 (to convert log to ln)
51  static Double_urt Ln10() { return 2.30258509299404568402; }
52 
53  // base-10 log of e (to convert ln to log)
54  static Double_urt LogE() { return 0.43429448190325182765; }
55 
56  // velocity of light
57  static Double_urt C() { return 2.99792458e8; } // m s^-1
58  static Double_urt Ccgs() { return 100.0 * C(); } // cm s^-1
59  static Double_urt CUncertainty() { return 0.0; } // exact
60 
61  // gravitational constant
62  static Double_urt G() { return 6.673e-11; } // m^3 kg^-1 s^-2
63  static Double_urt Gcgs() { return G() / 1000.0; } // cm^3 g^-1 s^-2
64  static Double_urt GUncertainty() { return 0.010e-11; }
65 
66  // G over h-bar C
67  static Double_urt GhbarC() { return 6.707e-39; } // (GeV/c^2)^-2
68  static Double_urt GhbarCUncertainty() { return 0.010e-39; }
69 
70  // standard acceleration of gravity
71  static Double_urt Gn() { return 9.80665; } // m s^-2
72  static Double_urt GnUncertainty() { return 0.0; } // exact
73 
74  // Planck's constant
75  static Double_urt H() { return 6.62606876e-34; } // J s
76  static Double_urt Hcgs() { return 1.0e7 * H(); } // erg s
77  static Double_urt HUncertainty() { return 0.00000052e-34; }
78 
79  // h-bar (h over 2 pi)
80  static Double_urt Hbar() { return 1.054571596e-34; } // J s
81  static Double_urt Hbarcgs() { return 1.0e7 * Hbar(); } // erg s
82  static Double_urt HbarUncertainty() { return 0.000000082e-34; }
83 
84  // hc (h * c)
85  static Double_urt HC() { return H() * C(); } // J m
86  static Double_urt HCcgs() { return Hcgs() * Ccgs(); } // erg cm
87 
88  // Boltzmann's constant
89  static Double_urt K() { return 1.3806503e-23; } // J K^-1
90  static Double_urt Kcgs() { return 1.0e7 * K(); } // erg K^-1
91  static Double_urt KUncertainty() { return 0.0000024e-23; }
92 
93  // Stefan-Boltzmann constant
94  static Double_urt Sigma() { return 5.6704e-8; } // W m^-2 K^-4
95  static Double_urt SigmaUncertainty() { return 0.000040e-8; }
96 
97  // Avogadro constant (Avogadro's Number)
98  static Double_urt Na() { return 6.02214199e+23; } // mol^-1
99  static Double_urt NaUncertainty() { return 0.00000047e+23; }
100 
101  // universal gas constant (Na * K)
102  // http://scienceworld.wolfram.com/physics/UniversalGasConstant.html
103  static Double_urt R() { return K() * Na(); } // J K^-1 mol^-1
104  static Double_urt RUncertainty() { return R()*((KUncertainty()/K()) + (NaUncertainty()/Na())); }
105 
106  // Molecular weight of dry air
107  // 1976 US Standard Atmosphere,
108  // also see http://atmos.nmsu.edu/jsdap/encyclopediawork.html
109  static Double_urt MWair() { return 28.9644; } // kg kmol^-1 (or gm mol^-1)
110 
111  // Dry Air Gas Constant (R / MWair)
112  // http://atmos.nmsu.edu/education_and_outreach/encyclopedia/gas_constant.htm
113  static Double_urt Rgair() { return (1000.0 * R()) / MWair(); } // J kg^-1 K^-1
114 
115  // Elementary charge
116  static Double_urt Qe() { return 1.602176462e-19; } // C
117  static Double_urt QeUncertainty() { return 0.000000063e-19; }
118 
119  // Trigo
120  static Double_urt Sin(Double_urt);
121  static Double_urt Cos(Double_urt);
122  static Double_urt Tan(Double_urt);
123  static Double_urt SinH(Double_urt);
124  static Double_urt CosH(Double_urt);
125  static Double_urt TanH(Double_urt);
126  static Double_urt ASin(Double_urt);
127  static Double_urt ACos(Double_urt);
128  static Double_urt ATan(Double_urt);
130  static Double_urt ASinH(Double_urt);
131  static Double_urt ACosH(Double_urt);
132  static Double_urt ATanH(Double_urt);
133  static Double_urt Hypot(Double_urt x, Double_urt y);
134 
135  // Misc
136  static Double_urt Sqrt(Double_urt x);
137  static Double_urt Ceil(Double_urt x);
138  static Double_urt Floor(Double_urt x);
139  static Double_urt Exp(Double_urt);
140  static Double_urt Factorial(Int_urt);
141  static Double_urt Power(Double_urt x, Double_urt y);
142  static Double_urt Log(Double_urt x);
143  static Double_urt Log2(Double_urt x);
144  static Double_urt Log10(Double_urt x);
145  static Int_urt Nint(Float_urt x);
146  static Int_urt Nint(Double_urt x);
147  static Int_urt Finite(Double_urt x);
148  static Int_urt IsNaN(Double_urt x);
149 
150  // Some integer math
151  static Long_urt NextPrime(Long_urt x); // Least prime number greater than x
152  static Long_urt Sqrt(Long_urt x);
153  static Long_urt Hypot(Long_urt x, Long_urt y); // sqrt(px*px + py*py)
154 
155  // Abs
156  static Short_urt Abs(Short_urt d);
157  static Int_urt Abs(Int_urt d);
158  static Long_urt Abs(Long_urt d);
159  static Float_urt Abs(Float_urt d);
160  static Double_urt Abs(Double_urt d);
161 
162  // Even/Odd
163  static Bool_urt Even(Long_urt a);
164  static Bool_urt Odd(Long_urt a);
165 
166  // Sign
167  static Short_urt Sign(Short_urt a, Short_urt b);
168  static Int_urt Sign(Int_urt a, Int_urt b);
169  static Long_urt Sign(Long_urt a, Long_urt b);
170  static Float_urt Sign(Float_urt a, Float_urt b);
171  static Double_urt Sign(Double_urt a, Double_urt b);
172 
173  // Min
174  static Short_urt Min(Short_urt a, Short_urt b);
175  static UShort_urt Min(UShort_urt a, UShort_urt b);
176  static Int_urt Min(Int_urt a, Int_urt b);
177  static UInt_urt Min(UInt_urt a, UInt_urt b);
178  static Long_urt Min(Long_urt a, Long_urt b);
179  static ULong_urt Min(ULong_urt a, ULong_urt b);
180  static Float_urt Min(Float_urt a, Float_urt b);
181  static Double_urt Min(Double_urt a, Double_urt b);
182 
183  // Max
184  static Short_urt Max(Short_urt a, Short_urt b);
185  static UShort_urt Max(UShort_urt a, UShort_urt b);
186  static Int_urt Max(Int_urt a, Int_urt b);
187  static UInt_urt Max(UInt_urt a, UInt_urt b);
188  static Long_urt Max(Long_urt a, Long_urt b);
189  static ULong_urt Max(ULong_urt a, ULong_urt b);
190  static Float_urt Max(Float_urt a, Float_urt b);
191  static Double_urt Max(Double_urt a, Double_urt b);
192 
193  // Locate Min, Max
194  static Int_urt LocMin(Int_urt n, const Short_urt *a);
195  static Int_urt LocMin(Int_urt n, const Int_urt *a);
196  static Int_urt LocMin(Int_urt n, const Float_urt *a);
197  static Int_urt LocMin(Int_urt n, const Double_urt *a);
198  static Int_urt LocMin(Int_urt n, const Long_urt *a);
199  static Int_urt LocMax(Int_urt n, const Short_urt *a);
200  static Int_urt LocMax(Int_urt n, const Int_urt *a);
201  static Int_urt LocMax(Int_urt n, const Float_urt *a);
202  static Int_urt LocMax(Int_urt n, const Double_urt *a);
203  static Int_urt LocMax(Int_urt n, const Long_urt *a);
204 
205  // Range
206  static Short_urt Range(Short_urt lb, Short_urt ub, Short_urt x);
207  static Int_urt Range(Int_urt lb, Int_urt ub, Int_urt x);
208  static Long_urt Range(Long_urt lb, Long_urt ub, Long_urt x);
209  static ULong_urt Range(ULong_urt lb, ULong_urt ub, ULong_urt x);
210  static Double_urt Range(Double_urt lb, Double_urt ub, Double_urt x);
211 
212  // Binary search
213  static Int_urt BinarySearch(Int_urt n, const Short_urt *array, Short_urt value);
214  static Int_urt BinarySearch(Int_urt n, const Short_urt **array, Short_urt value);
215  static Int_urt BinarySearch(Int_urt n, const Int_urt *array, Int_urt value);
216  static Int_urt BinarySearch(Int_urt n, const Int_urt **array, Int_urt value);
217  static Int_urt BinarySearch(Int_urt n, const Float_urt *array, Float_urt value);
218  static Int_urt BinarySearch(Int_urt n, const Float_urt **array, Float_urt value);
219  static Int_urt BinarySearch(Int_urt n, const Double_urt *array, Double_urt value);
220  static Int_urt BinarySearch(Int_urt n, const Double_urt **array, Double_urt value);
221  static Int_urt BinarySearch(Int_urt n, const Long_urt *array, Long_urt value);
222  static Int_urt BinarySearch(Int_urt n, const Long_urt **array, Long_urt value);
223 
224  // Hashing
225  static ULong_urt Hash(const void *txt, Int_urt ntxt);
226  static ULong_urt Hash(const char *str);
227 
228  // IsInside
230  static Bool_urt IsInside(Float_urt xp, Float_urt yp, Int_urt np, Float_urt *x, Float_urt *y);
231  static Bool_urt IsInside(Int_urt xp, Int_urt yp, Int_urt np, Int_urt *x, Int_urt *y);
232 
233  // Sorting
234  static void Sort(Int_urt n, const Short_urt *a, Int_urt *index, Bool_urt down=kurTRUE);
235  static void Sort(Int_urt n, const Int_urt *a, Int_urt *index, Bool_urt down=kurTRUE);
236  static void Sort(Int_urt n, const Float_urt *a, Int_urt *index, Bool_urt down=kurTRUE);
237  static void Sort(Int_urt n, const Double_urt *a, Int_urt *index, Bool_urt down=kurTRUE);
238  static void Sort(Int_urt n, const Long_urt *a, Int_urt *index, Bool_urt down=kurTRUE);
239  static void BubbleHigh(Int_urt Narr, Double_urt *arr1, Int_urt *arr2);
240  static void BubbleLow (Int_urt Narr, Double_urt *arr1, Int_urt *arr2);
241 
242  // Advanced
243  static Float_urt *Cross(Float_urt v1[3],Float_urt v2[3],Float_urt out[3]); // Calculate the Cross Product of two vectors
244  static Float_urt Normalize(Float_urt v[3]); // Normalize a vector
245  static Float_urt NormCross(Float_urt v1[3],Float_urt v2[3],Float_urt out[3]); // Calculate the Normalized Cross Product of two vectors
246  static Float_urt *Normal2Plane(Float_urt v1[3],Float_urt v2[3],Float_urt v3[3], Float_urt normal[3]); // Calcualte a normal vector of a plane
247 
248  static Double_urt *Cross(Double_urt v1[3],Double_urt v2[3],Double_urt out[3]);// Calculate the Cross Product of two vectors
249  static Double_urt Erf(Double_urt x);
250  static Double_urt Erfc(Double_urt x);
251  static Double_urt Freq(Double_urt x);
252  static Double_urt Gamma(Double_urt z);
254  static Double_urt BreitWigner(Double_urt x, Double_urt mean=0, Double_urt gamma=1);
255  static Double_urt Gaus(Double_urt x, Double_urt mean=0, Double_urt sigma=1, Bool_urt norm=kurFALSE);
256  static Double_urt Landau(Double_urt x, Double_urt mean=0, Double_urt sigma=1);
257  static Double_urt LnGamma(Double_urt z);
258  static Double_urt Normalize(Double_urt v[3]); // Normalize a vector
259  static Double_urt NormCross(Double_urt v1[3],Double_urt v2[3],Double_urt out[3]); // Calculate the Normalized Cross Product of two vectors
260  static Double_urt *Normal2Plane(Double_urt v1[3],Double_urt v2[3],Double_urt v3[3], Double_urt normal[3]); // Calcualte a normal vector of a plane
261  static Double_urt Poisson(Double_urt x, Double_urt par);
262  static Double_urt Prob(Double_urt chi2,Int_urt ndf);
264  static Double_urt Voigt(Double_urt x, Double_urt sigma, Double_urt lg, Int_urt R = 4);
265 
266  // Bessel functions
267  static Double_urt BesselI(Int_urt n,Double_urt x); // integer order modified Bessel function I_n(x)
268  static Double_urt BesselK(Int_urt n,Double_urt x); // integer order modified Bessel function K_n(x)
269  static Double_urt BesselI0(Double_urt x); // modified Bessel function I_0(x)
270  static Double_urt BesselK0(Double_urt x); // modified Bessel function K_0(x)
271  static Double_urt BesselI1(Double_urt x); // modified Bessel function I_1(x)
272  static Double_urt BesselK1(Double_urt x); // modified Bessel function K_1(x)
273  static Double_urt BesselJ0(Double_urt x); // Bessel function J0(x) for any real x
274  static Double_urt BesselJ1(Double_urt x); // Bessel function J1(x) for any real x
275  static Double_urt BesselY0(Double_urt x); // Bessel function Y0(x) for positive x
276  static Double_urt BesselY1(Double_urt x); // Bessel function Y1(x) for positive x
277  static Double_urt StruveH0(Double_urt x); // Struve functions of order 0
278  static Double_urt StruveH1(Double_urt x); // Struve functions of order 1
279  static Double_urt StruveL0(Double_urt x); // Modified Struve functions of order 0
280  static Double_urt StruveL1(Double_urt x); // Modified Struve functions of order 1
281 
282  // kludge for now
283  void Error( const std::string& errorMessage, double value );
284  void Error( const std::string& errorMessage, int iValue, double value );
285 };
286 
287 
288 //---- Even/odd ----------------------------------------------------------------
289 
291  { return ! (a & 1); }
292 
294  { return (a & 1); }
295 
296 //---- Abs ---------------------------------------------------------------------
297 
299  { return (d > 0) ? d : -d; }
300 
302  { return (d > 0) ? d : -d; }
303 
305  { return (d > 0) ? d : -d; }
306 
308  { return (d > 0) ? d : -d; }
309 
311  { return (d > 0) ? d : -d; }
312 
313 //---- Sign --------------------------------------------------------------------
314 
316  { return (b >= 0) ? Abs(a) : -Abs(a); }
317 
319  { return (b >= 0) ? Abs(a) : -Abs(a); }
320 
322  { return (b >= 0) ? Abs(a) : -Abs(a); }
323 
325  { return (b >= 0) ? Abs(a) : -Abs(a); }
326 
328  { return (b >= 0) ? Abs(a) : -Abs(a); }
329 
330 //---- Min ---------------------------------------------------------------------
331 
333  { return a <= b ? a : b; }
334 
336  { return a <= b ? a : b; }
337 
339  { return a <= b ? a : b; }
340 
342  { return a <= b ? a : b; }
343 
345  { return a <= b ? a : b; }
346 
348  { return a <= b ? a : b; }
349 
351  { return a <= b ? a : b; }
352 
354  { return a <= b ? a : b; }
355 
356 //---- Max ---------------------------------------------------------------------
357 
359  { return a >= b ? a : b; }
360 
362  { return a >= b ? a : b; }
363 
365  { return a >= b ? a : b; }
366 
368  { return a >= b ? a : b; }
369 
371  { return a >= b ? a : b; }
372 
374  { return a >= b ? a : b; }
375 
377  { return a >= b ? a : b; }
378 
380  { return a >= b ? a : b; }
381 
382 //---- Range -------------------------------------------------------------------
383 
385  { return x < lb ? lb : (x > ub ? ub : x); }
386 
388  { return x < lb ? lb : (x > ub ? ub : x); }
389 
391  { return x < lb ? lb : (x > ub ? ub : x); }
392 
394  { return x < lb ? lb : (x > ub ? ub : x); }
395 
397  { return x < lb ? lb : (x > ub ? ub : x); }
398 
399 //---- Trig and other functions ------------------------------------------------
400 
401 
402 #include <float.h>
403 
404 #ifdef R__WIN32
405 # ifndef finite
406 # define finite _finite
407 # define isnan _isnan
408 # endif
409 #endif
410 #if defined(R__AIX) || defined(R__MAC) || defined(R__SOLARIS_CC50) || \
411  defined(R__HPUX11) || defined(R__GLIBC)
412 // math functions are defined inline so we have to include them here
413 # include <math.h>
414 # ifdef R__SOLARIS_CC50
415  extern "C" { int finite(double); }
416 # endif
417 # if defined(R__GLIBC) && defined(__STRICT_ANSI__)
418 # ifndef finite
419 # define finite __finite
420 # endif
421 # ifndef isnan
422 # define isnan __isnan
423 # endif
424 # endif
425 #else
426 // don't want to include complete <math.h>
427 extern "C" {
428  extern double sin(double);
429  extern double cos(double);
430  extern double tan(double);
431  extern double sinh(double);
432  extern double cosh(double);
433  extern double tanh(double);
434  extern double asin(double);
435  extern double acos(double);
436  extern double atan(double);
437  extern double atan2(double, double);
438  extern double sqrt(double);
439  extern double exp(double);
440  extern double pow(double, double);
441  extern double log(double);
442  extern double log10(double);
443 #ifndef R__WIN32
444 # if !defined(finite)
445  extern int finite(double);
446 # endif
447 # if !defined(isnan)
448  extern int isnan(double);
449 # endif
450 #endif
451 }
452 #endif
453 
455  { return sin(x); }
456 
458  { return cos(x); }
459 
461  { return tan(x); }
462 
464  { return sinh(x); }
465 
467  { return cosh(x); }
468 
470  { return tanh(x); }
471 
473  { return asin(x); }
474 
476  { return acos(x); }
477 
479  { return atan(x); }
480 
482  { return x != 0 ? atan2(y, x) : (y > 0 ? Pi()/2 : -Pi()/2); }
483 
485  { return sqrt(x); }
486 
488  { return exp(x); }
489 
491  { return pow(x, y); }
492 
494  { return log(x); }
495 
497  { return log10(x); }
498 
500 #ifdef R__HPUX11
501  { return isfinite(x); }
502 #else
503  { return finite(x); }
504 #endif
505 
507  { return isnan(x); }
508 
509 //-------- Advanced -------------
510 
512 {
513  // Calculate the Normalized Cross Product of two vectors
514  return Normalize(Cross(v1,v2,out));
515 }
516 
518 {
519  // Calculate the Normalized Cross Product of two vectors
520  return Normalize(Cross(v1,v2,out));
521 }
522 
523 
524 #endif
long Long_urt
Definition: URtypes.h:46
double pow(double, double)
static Int_urt LocMax(Int_urt n, const Short_urt *a)
static Double_urt Gcgs()
Definition: URMath.h:63
static ULong_urt Hash(const void *txt, Int_urt ntxt)
double exp(double)
short Short_urt
Definition: URtypes.h:31
static Double_urt ACosH(Double_urt)
static Float_urt * Cross(Float_urt v1[3], Float_urt v2[3], Float_urt out[3])
double log10(double)
static Double_urt ASin(Double_urt)
Definition: URMath.h:472
static Double_urt ASinH(Double_urt)
unsigned long ULong_urt
Definition: URtypes.h:47
static Float_urt Normalize(Float_urt v[3])
static Double_urt Sin(Double_urt)
Definition: URMath.h:454
static Double_urt Hbar()
Definition: URMath.h:80
static Double_urt KolmogorovProb(Double_urt z)
static void Sort(Int_urt n, const Short_urt *a, Int_urt *index, Bool_urt down=kurTRUE)
static Double_urt Ceil(Double_urt x)
static Double_urt BesselI1(Double_urt x)
static Short_urt Sign(Short_urt a, Short_urt b)
Definition: URMath.h:315
static Double_urt SinH(Double_urt)
Definition: URMath.h:463
int isnan(double)
static Double_urt Ccgs()
Definition: URMath.h:58
static Short_urt Max(Short_urt a, Short_urt b)
Definition: URMath.h:358
int Int_urt
Definition: URtypes.h:37
static Double_urt Gn()
Definition: URMath.h:71
const Bool_urt kurFALSE
Definition: URtypes.h:76
static Int_urt Nint(Float_urt x)
static Int_urt IsNaN(Double_urt x)
Definition: URMath.h:506
static Double_urt RadToDeg()
Definition: URMath.h:44
static Double_urt Sigma()
Definition: URMath.h:94
static Double_urt BreitWigner(Double_urt x, Double_urt mean=0, Double_urt gamma=1)
static Double_urt StruveH1(Double_urt x)
static Double_urt Log2(Double_urt x)
static Double_urt Rgair()
Definition: URMath.h:113
static Double_urt BesselY0(Double_urt x)
static Double_urt DegToRad()
Definition: URMath.h:45
static Short_urt Min(Short_urt a, Short_urt b)
Definition: URMath.h:332
static Double_urt GhbarCUncertainty()
Definition: URMath.h:68
static Double_urt Hbarcgs()
Definition: URMath.h:81
static Int_urt Finite(Double_urt x)
Definition: URMath.h:499
static Double_urt Log10(Double_urt x)
Definition: URMath.h:496
static Double_urt BesselK0(Double_urt x)
double sinh(double)
static Int_urt LocMin(Int_urt n, const Short_urt *a)
static Double_urt Floor(Double_urt x)
static Double_urt StruveL0(Double_urt x)
static Double_urt SigmaUncertainty()
Definition: URMath.h:95
static Double_urt HbarUncertainty()
Definition: URMath.h:82
static Double_urt K()
Definition: URMath.h:89
static Double_urt InvPi()
Definition: URMath.h:43
double tan(double)
static Double_urt ATan(Double_urt)
Definition: URMath.h:478
static Double_urt Log(Double_urt x)
Definition: URMath.h:493
static Double_urt Hypot(Double_urt x, Double_urt y)
static Double_urt BesselI(Int_urt n, Double_urt x)
static Double_urt G()
Definition: URMath.h:62
static Double_urt GUncertainty()
Definition: URMath.h:64
static Double_urt ACos(Double_urt)
Definition: URMath.h:475
static Double_urt LnGamma(Double_urt z)
static Double_urt C()
Definition: URMath.h:57
static Double_urt H()
Definition: URMath.h:75
static Double_urt Exp(Double_urt)
Definition: URMath.h:487
const Bool_urt kurTRUE
Definition: URtypes.h:75
double cos(double)
static Double_urt GhbarC()
Definition: URMath.h:67
static Double_urt KUncertainty()
Definition: URMath.h:91
double asin(double)
Definition: URMath.h:30
static Double_urt Factorial(Int_urt)
static Double_urt StruveL1(Double_urt x)
float Float_urt
Definition: URtypes.h:49
double sqrt(double)
static Float_urt * Normal2Plane(Float_urt v1[3], Float_urt v2[3], Float_urt v3[3], Float_urt normal[3])
static Double_urt BesselJ1(Double_urt x)
static Double_urt Erfc(Double_urt x)
static Double_urt Gamma(Double_urt z)
static Double_urt Sqrt(Double_urt x)
Definition: URMath.h:484
static Double_urt Hcgs()
Definition: URMath.h:76
void Error(const std::string &errorMessage, double value)
static Double_urt BesselY1(Double_urt x)
unsigned int UInt_urt
Definition: URtypes.h:38
static Double_urt Qe()
Definition: URMath.h:116
static Double_urt MWair()
Definition: URMath.h:109
static Bool_urt Odd(Long_urt a)
Definition: URMath.h:293
static Double_urt Power(Double_urt x, Double_urt y)
Definition: URMath.h:490
static Double_urt TwoPi()
Definition: URMath.h:40
static Double_urt BesselK1(Double_urt x)
static Bool_urt Even(Long_urt a)
Definition: URMath.h:290
static Double_urt HCcgs()
Definition: URMath.h:86
static Double_urt LogE()
Definition: URMath.h:54
static Double_urt RUncertainty()
Definition: URMath.h:104
static Double_urt Tan(Double_urt)
Definition: URMath.h:460
static Double_urt Na()
Definition: URMath.h:98
static Long_urt NextPrime(Long_urt x)
static Double_urt CUncertainty()
Definition: URMath.h:59
int finite(double)
static Short_urt Abs(Short_urt d)
Definition: URMath.h:298
double cosh(double)
unsigned short UShort_urt
Definition: URtypes.h:32
double atan(double)
static Double_urt R()
Definition: URMath.h:103
static Double_urt Freq(Double_urt x)
static Double_urt Poisson(Double_urt x, Double_urt par)
static Float_urt NormCross(Float_urt v1[3], Float_urt v2[3], Float_urt out[3])
Definition: URMath.h:511
static Double_urt HC()
Definition: URMath.h:85
static Double_urt CosH(Double_urt)
Definition: URMath.h:466
static Double_urt NaUncertainty()
Definition: URMath.h:99
static Double_urt StruveH0(Double_urt x)
double Double_urt
Definition: URtypes.h:50
static void BubbleLow(Int_urt Narr, Double_urt *arr1, Int_urt *arr2)
double sin(double)
static Double_urt E()
Definition: URMath.h:48
static Double_urt BesselI0(Double_urt x)
static Double_urt Ln10()
Definition: URMath.h:51
static Bool_urt IsInside(Double_urt xp, Double_urt yp, Int_urt np, Double_urt *x, Double_urt *y)
static Double_urt Pi()
Definition: URMath.h:39
static Double_urt PiOver2()
Definition: URMath.h:41
static Double_urt PiOver4()
Definition: URMath.h:42
static Double_urt Kcgs()
Definition: URMath.h:90
static void BubbleHigh(Int_urt Narr, Double_urt *arr1, Int_urt *arr2)
static Short_urt Range(Short_urt lb, Short_urt ub, Short_urt x)
Definition: URMath.h:384
bool Bool_urt
Definition: URtypes.h:52
double acos(double)
double log(double)
static Double_urt ATanH(Double_urt)
static Double_urt QeUncertainty()
Definition: URMath.h:117
static Double_urt BesselJ0(Double_urt x)
static Double_urt ATan2(Double_urt, Double_urt)
Definition: URMath.h:481
static Int_urt BinarySearch(Int_urt n, const Short_urt *array, Short_urt value)
static Double_urt Voigt(Double_urt x, Double_urt sigma, Double_urt lg, Int_urt R=4)
static Double_urt BesselK(Int_urt n, Double_urt x)
static Double_urt Landau(Double_urt x, Double_urt mean=0, Double_urt sigma=1)
double atan2(double, double)
static Double_urt HUncertainty()
Definition: URMath.h:77
static Double_urt Prob(Double_urt chi2, Int_urt ndf)
static Double_urt TanH(Double_urt)
Definition: URMath.h:469
static Double_urt Gaus(Double_urt x, Double_urt mean=0, Double_urt sigma=1, Bool_urt norm=kurFALSE)
double tanh(double)
static Double_urt GnUncertainty()
Definition: URMath.h:72
static Double_urt Erf(Double_urt x)
static Double_urt Cos(Double_urt)
Definition: URMath.h:457