#include <iostream>
#include "CLHEP/Random/RandGauss.h"
#include "CLHEP/Random/RandGaussQ.h"
#include "CLHEP/Random/RandExponential.h"
#include "CLHEP/Random/RandGaussZiggurat.h"
#include "CLHEP/Random/RandExpZiggurat.h"
Go to the source code of this file.
◆ main()
Definition at line 12 of file testZiggurat.cc.
12 {
13
14 std::ofstream
output(
"testZiggurat.cout");
15
16 int ntest=10000000;
17
18 output <<
"DEBUG: ntest="<<ntest<<std::endl;
19
20 double sum_rnd1=0;
21 for(int i=0;i<ntest;++i) {
24 }
25 sum_rnd1/=ntest;
26 output <<
"DEBUG: avg RandGauss="<<sum_rnd1<<std::endl;
27
28 double sum_rnd2=0;
29 for(int i=0;i<ntest;++i) {
32 }
33 sum_rnd2/=ntest;
34 output <<
"DEBUG: avg RandGaussQ="<<sum_rnd2<<std::endl;
35
36 double sum_zig=0;
37 for(int i=0;i<ntest;++i) {
40 }
41 sum_zig/=ntest;
42 output <<
"DEBUG: avg RandGaussZiggurat="<<sum_zig<<std::endl;
43
44 double sum_exp=0;
45 for(int i=0;i<ntest;++i) {
48 }
49 sum_exp/=ntest;
50 output <<
"DEBUG: avg RandExponential="<<sum_exp<<std::endl;
51
52 double sum_expZ=0;
53 for(int i=0;i<ntest;++i) {
56 }
57 sum_expZ/=ntest;
58 output <<
"DEBUG: avg RandExpZiggurat="<<sum_expZ<<std::endl;
59
60 return 0;
61}
std::ofstream output("ranRestoreTest.cout")