22 int quasirandom(
int n = 10000,
int skip = 0) {
24 TH2D * h0 =
new TH2D(
"h0",
"Pseudo-random Sequence",200,0,1,200,0,1);
25 TH2D *
h1 =
new TH2D(
"h1",
"Sobol Sequence",200,0,1,200,0,1);
26 TH2D * h2 =
new TH2D(
"h2",
"Niederrer Sequence",200,0,1,200,0,1);
39 for (
int i = 0; i <
n; ++i) {
43 std::cout <<
"Time for gRandom ";
48 for (
int i = 0; i <
n; ++i) {
52 std::cout <<
"Time for Sobol ";
57 for (
int i = 0; i <
n; ++i) {
61 std::cout <<
"Time for Niederreiter ";
81 for (
int i = 1; i <= h1->
GetNbinsX(); ++i) {
82 for (
int j = 1; j <= h1->
GetNbinsY(); ++j) {
89 std::cout <<
"number of empty bins for pseudo-random = " << nzerobins0 << std::endl;
90 std::cout <<
"number of empty bins for " << r1.Name() <<
"\t= " << nzerobins1 << std::endl;
91 std::cout <<
"number of empty bins for " << r2.Name() <<
"\t= " << nzerobins2 << std::endl;
94 if (nzerobins1 >= nzerobins0 ) iret += 1;
95 if (nzerobins2 >= nzerobins0 ) iret += 2;
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
User class for MathMore random numbers template on the Engine type.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
void RndmArray(int n, double *array)
Generate an array of random numbers between ]0,1] 0 is excluded and 1 is included Function to preserv...
virtual void Draw(Option_t *option="")
Draw this histogram with options.
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Int_t GetNbinsX() const
Int_t Fill(Double_t)
Invalid Fill method.
static char * skip(char **buf, const char *delimiters)
virtual Int_t GetNbinsY() const
Documentation for the Random class.
2-D histogram with a double per channel (see TH1 documentation)}