[Insight-users] Typo in MersenneTwisterRandomVariateGenerator?

Blezek, Daniel J (GE, Research) blezek at crd.ge.com
Thu Oct 26 12:47:01 EDT 2006


Nice catch,  I'll make the change and check it in.  Not sure where
"rand()" came from...

-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
Gheorghe Postelnicu
Sent: Thursday, October 26, 2006 12:42 PM
To: insight-users at itk.org
Subject: [Insight-users] Typo in MersenneTwisterRandomVariateGenerator?

Hi,

I am trying to use MersenneTwisterRandomVariateGenerator, namely the
method GetVariateWithClosedRange, but the result was above the given
range. The code actually uses the STL(or other) rand() funciton. Is this
normal?


/** Get a random variate in the range [0, n] */ inline double
  MersenneTwisterRandomVariateGenerator::GetVariateWithClosedRange(
                                                    const double& n )
  {
  return rand() * n;
  }

Thanks,
--
Gheorghe Postelnicu, PhD
MGH, Harvard Medical School
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list