[Insight-users] random number generator on OSX

Blezek, Daniel J (Research) blezek at crd.ge.com
Wed Aug 10 08:50:53 EDT 2005


If you are using ITK, I would suggest having a look at the MersenneTwisterRandomVariateGenerator class:

http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1MersenneTwisterRandomVariateGenerator.html

It is an extremely well tested and high quality random number generator and cross-platform as is all of ITK.

-dan

-----Original Message-----
From: insight-users-bounces+blezek=crd.ge.com at itk.org
[mailto:insight-users-bounces+blezek=crd.ge.com at itk.org]On Behalf Of
Kevin H. Hobbs
Sent: Wednesday, August 10, 2005 8:42 AM
To: Suyash P. Awate
Cc: insight-users at itk.org
Subject: Re: [Insight-users] random number generator on OSX


On Tue, 2005-08-09 at 15:55 -0600, Suyash P. Awate wrote:
> Hello ITK-users,
> 
> While working with ITK on the MacOSX 10.4, I tried to use the random 
> number generator "random_r()" using gcc 4.0 but I was unable to compile 
> the code. I was able to use this function just fine on linux (fedora 
> core 2) using gcc 3.3.
> 
> Has anyone tried something like this before ? I would appreciate any 
> help. Thanks.
> 
> Regards,
> Suyash.

It sounds like it's a gnu extension.  Have you tried:
	#define _GNU_SOURCE
	#include <stdlib.h>



More information about the Insight-users mailing list