Menu

[GSL] gsl_rng_set problem

Help
Olivier
2006-08-20
2012-07-26
  • Olivier

    Olivier - 2006-08-20

    Hi all,

    I'm using MSVC on XP and I've a problem with gsl_rng_set. When I use this function, my program compiles and links correctly but fails at execution. Here is my piece of code :

    unsigned long int seed;
    seed = unsigned long int(GetTickCount());
    gsl_rng_set(GSL_RNG,seed);
    
    gsl_rng_env_setup();
    GSL_RNG_TYPE = gsl_rng_mt19937;
    GSL_RNG = gsl_rng_alloc (GSL_RNG_TYPE);
    

    I already had this problem for RNG without gsl_rng_set, but solved it using GSL_DLL in the preprocessor definition.

    Can someone help me ?
    Thanks.

    Olivier

     
    • Olivier

      Olivier - 2006-08-20

      Here is the problem : set the seed before allocation of the RNG ...
      Simply have to change lines order ...