help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Problem with gsl_rng_alloc


From: Olivier Tournaire
Subject: [Help-gsl] Problem with gsl_rng_alloc
Date: Sat, 10 Nov 2007 19:04:26 +0100

Hi all,

I have a problem when I try to use random number generation. Here is my
code:


    unsigned long int seed;
#ifdef __WINDOWS__
    seed = unsigned long int(GetTickCount());
    std::cout << "Windows !" << std::endl;
    std::cout << seed << std::endl;
#endif
#ifdef __LINUX__
    struct timeval tv;
    gettimeofday(&tv,0);
    seed = tv.tv_sec + tv.tv_usec;
#endif
#ifdef __MAC__
    struct timeval tv;
    gettimeofday(&tv,0);
    seed = tv.tv_sec + tv.tv_usec;
#endif

    // Initialisation de l'environnement GSL pour la generation de nombres
aleatoires
    gsl_rng_env_setup();
    GSL_RNG_TYPE_ = gsl_rng_taus; // in the hpp : const gsl_rng_type
*GSL_RNG_TYPE_;
    GSL_RNG_ = gsl_rng_alloc (gsl_rng_taus); // run-time error here !
    gsl_rng_set(GSL_RNG_,seed);

Can you tell me what is the problem ?

Regards

-- 
Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux.
Courage.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]