[Insight-developers] problem with vnl_sample

Lydia Ng lng at statsci.com
Fri Nov 10 17:46:41 EST 2000


Hi,

I was hoping to use the vnl_sample_uniform()
function to generate random numbers.
But, in VC++ it always return 0.

The problem is in lines 18-20 of vnl/vnl_sample.cxx

  static unsigned long seed = 12345;
  seed = (seed*16807)%2147483647L;
  double u = seed/2147483711;

In the last line, seed needs to be cast to a double.

Who looks after the vnl stuff?
Can someone fix this in the repository for me?

Thanks,
Lydia







More information about the Insight-developers mailing list