1234567891011121314151617181920212223242526272829303132 |
- #ifndef GSLRANDOMNUMBERGENERATOR
- #define GSLRANDOMNUMBERGENERATOR
- #ifdef NICE_USELIB_GSL
- #include <gsl/gsl_randist.h>
- #include <gsl/gsl_rng.h>
- static gsl_rng *randomGSL = NULL;
- static void initGSLRandom ()
- {
- if ( randomGSL == NULL )
- {
- gsl_rng_env_setup();
- const gsl_rng_type * T = gsl_rng_default;
- gsl_rng_default_seed = time(NULL);
- randomGSL = gsl_rng_alloc (T);
- }
- }
- static void resetGSLRandom ()
- {
- if ( randomGSL != NULL )
- {
- gsl_rng_free ( randomGSL );
- randomGSL = NULL;
- }
- }
- #endif
- #endif
|