00001 #ifndef __BCMATH__H
00002 #define __BCMATH__H
00003
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #define BCMATH_NFACT_ALIMIT 20
00025
00026
00027
00028 namespace BCMath
00029 {
00030
00037 double LogGaus(double x, double mean = 0, double sigma = 1, bool norm = false);
00038
00042 double LogPoisson(double x, double par);
00043
00049 double ApproxBinomial(int n, int k, double p);
00050
00057 double LogApproxBinomial(int n, int k, double p);
00058
00066 double LogBinomFactor(int n, int k);
00067
00075 double ApproxLogFact(double x);
00076
00080 double LogNoverK(int n, int k);
00081
00085 double LogFact(int n);
00086
00090 inline int Max(int x, int y)
00091 { return x >= y ? x : y; }
00092
00093 inline double Max(double x, double y)
00094 { return x >= y ? x : y; }
00095
00099 inline int Min(int x, int y)
00100 { return x <= y ? x : y; }
00101
00102 inline double Min(double x, double y)
00103 { return x <= y ? x : y; }
00104
00108 int Nint(double x);
00109
00113 double rms(int n, const double * a);
00114
00115
00116
00117
00118
00119 double LogBreitWignerNonRel(double x, double mean, double Gamma, bool norm = false);
00120 double LogBreitWignerRel(double x, double mean, double Gamma);
00121
00122 };
00123
00124
00125
00126 #endif
00127