/************************************************************************ * Routines to download random seed value from www.random.org * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ************************************************************************ * * * Probably you need to call RNGSeedWarmup or RNGSeedWarmupGiven. * * * * These functions support the random number generator of the GSL. * * See: http://www.gnu.org/software/gsl/ * * GSL sould be installed on your computer to compile your codes. * * * * Donwloading is performed by wget. It should be installed on your * * computer to run your programs. * * * ************************************************************************ * Writen by: * * Laszlo BALOGH * * e-mail: blaci947@yahoo.co.uk * * Ph.D. student @ Dep. of Theor. Phys., BUTE, Budapest, Hungary * * 2011. * ************************************************************************/ #include int RNGSeedWarmup(gsl_rng* rng_); // * initializes the Randon Number Generator with a random value (zero excluded) // * gets some (undefined) amount of random numbers - "warming up" the generator int RNGSeedWarmupGiven(gsl_rng* rng_, const unsigned long int s_, const unsigned long int w_); // * initializes the Randon Number Generator with the given value // * gets some the given amount of random numbers - "warming up" the generator int DownloadSeed(unsigned long int *seed_, unsigned long int *warmup_); // seed + warm up // download integers (3 x 16 bits) from http://www.random.org // * it OWERWRITES the "random.org.txt" file, // * it will USE THE WGET software, // * it will CONNECT TO THE INTERNET // return value: 1, if no error occured, // zero, if an error occured (cannot open "random.org" file, // the wget is not installed, // the random.org server is unavailable, // or the free quota is exceeded) // To check your free quota, visit: http://www.random.org/quota/ // or type: wget -O /dev/stdout -q "http://www.random.org/quota/?format=plain"