src/biu/QuasiRandomNumberGenerator.cc
Go to the documentation of this file.00001 #include "biu/QuasiRandomNumberGenerator.hh" 00002 #include "biu/qrng/gsl_qrng.h" 00003 00004 using namespace biu; 00005 00006 QuasiRandomNumberGenerator::QuasiRandomNumberGenerator() 00007 { 00008 q = gsl_qrng_alloc (gsl_qrng_sobol, 1); 00009 } 00010 00011 QuasiRandomNumberGenerator::~QuasiRandomNumberGenerator() 00012 { 00013 gsl_qrng_free(q); 00014 } 00015 00016 double 00017 QuasiRandomNumberGenerator::getQuasiRN() 00018 { 00019 double v[1]; 00020 gsl_qrng_get(q, v); 00021 return v[0]; 00022 }