CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
testZiggurat.cc File Reference
#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.

Functions

int main ()
 

Function Documentation

◆ main()

int 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) {
23 sum_rnd1+=g;
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) {
31 sum_rnd2+=g;
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) {
39 sum_zig+=g;
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) {
47 sum_exp+=g;
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) {
55 sum_expZ+=g;
56 }
57 sum_expZ/=ntest;
58 output << "DEBUG: avg RandExpZiggurat="<<sum_expZ<<std::endl;
59
60 return 0;
61}
static double shoot()
static double shoot()
Definition: RandGauss.cc:64
std::ofstream output("ranRestoreTest.cout")
int g(shared_ptr< X >)