00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __BCMATH__H
00022 #define __BCMATH__H
00023
00024 #include <math.h>
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
00074 double ApproxLogFact(double x);
00075
00079 double LogNoverK(int n, int k);
00080
00084 double LogFact(int n);
00085
00089 inline int Max(int x, int y)
00090 { return x >= y ? x : y; }
00091
00092 inline double Max(double x, double y)
00093 { return x >= y ? x : y; }
00094
00098 inline int Min(int x, int y)
00099 { return x <= y ? x : y; }
00100
00101 inline double Min(double x, double y)
00102 { return x <= y ? x : y; }
00103
00107 int Nint(double x);
00108
00112 double rms(int n, const double * a);
00113
00114
00115
00116
00117
00118 double LogBreitWignerNonRel(double x, double mean, double Gamma, bool norm = false);
00119
00120 };
00121
00122
00123
00124 #endif
00125