18 const double MIN = -2.5;
19 const double MAX = +2.5;
23 bool showGraphics =
false;
40 vector<Double_t>
x( ARRAYSIZE );
41 vector<Double_t> yg( ARRAYSIZE );
42 vector<Double_t> ymtg( ARRAYSIZE );
43 vector<Double_t> yga( ARRAYSIZE );
44 vector<Double_t> ymga( ARRAYSIZE );
45 vector<Double_t> ylng( ARRAYSIZE );
46 vector<Double_t> ymlng( ARRAYSIZE );
54 unsigned int index = 0;
74 <<
" yg[index] " << yg[index]
75 <<
" ymtg[index] " << ymtg[index]
76 <<
" " <<
std::fabs( yg[index] - ymtg[index] )
83 if (
std::fabs( yga[index] - ymga[index] ) > ERRORLIMIT )
86 <<
" yga[index] " << yga[index]
87 <<
" ymga[index] " << ymga[index]
88 <<
" " <<
std::fabs( yga[index] - ymga[index] )
95 if (
std::fabs( ylng[index] - ymlng[index] ) > ERRORLIMIT )
98 <<
" ylng[index] " << ylng[index]
99 <<
" ymlng[index] " << ymlng[index]
100 <<
" " <<
std::fabs( ylng[index] - ymlng[index] )
112 TH2F* hpx =
new TH2F(
"hpx",
"Two Graphs(hpx)", ARRAYSIZE, MIN, MAX, ARRAYSIZE, -1,5);
124 legend->
AddEntry(gg,
"TMath::Gamma()");
125 legend->
AddEntry(gmtg,
"ROOT::Math::tgamma()");
126 legend->
AddEntry(gga,
"TMath::GammaI()");
127 legend->
AddEntry(gmga,
"ROOT::Math::inc_gamma()");
128 legend->
AddEntry(glng,
"TMath::LnGamma()");
129 legend->
AddEntry(gmlng,
"ROOT::Math::lgamma()");
135 cout <<
"Test Done!" << endl;
141 int main(
int argc,
char **argv)
144 for (
Int_t i=1 ; i<argc ; i++) {
145 std::string arg = argv[i] ;
154 cerr <<
"Usage: " << argv[0] <<
" [-g] [-v]\n";
156 cerr <<
" -g : graphics mode\n";
157 cerr <<
" -v : verbose mode";
virtual void SetLineWidth(Width_t lwidth)
This class displays a legend box (TPaveText) containing several legend entries.
TGraph * drawPoints(Double_t x[], Double_t y[], int color, int style=1)
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.
double tgamma(double x)
The gamma function is defined to be the extension of the factorial to real numbers.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
virtual void Run(Bool_t retrn=kFALSE)
Main application eventloop. Calls system dependent eventloop via gSystem.
virtual void SetLineColor(Color_t lcolor)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
int main(int argc, char **argv)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void SetLineStyle(Style_t lstyle)
A Graph is a graphics object made of two arrays X and Y with npoints each.
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
double lgamma(double x)
Calculates the logarithm of the gamma function.
double inc_gamma(double a, double x)
Calculates the normalized (regularized) lower incomplete gamma function (lower integral) ...
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.