logo       

Re: Problem with gsl_rng_alloc: msg#00035

lib.gsl.general

Subject: Re: Problem with gsl_rng_alloc

OK, I found the answer. Have to add the flag GSL_DLL ...

2007/11/10, Olivier Tournaire <olitour@xxxxxxxxx>:
>
> 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.




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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise