This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: what to do about random numbers?
On Mon, May 24, 2004 at 11:54:37AM +0200, Lars Segerlund wrote:
>
> Hi, I am VERY gratefull for this work :-) ... and I was actually
> unaware that it was the sign bit causing problems in the get and put !
I'm not sure the sign bit matters. It, howver, is a complication.
> I have been trying to get and put to work as expected for a while,
> (my put gives a segfault ... which it used not to ), and have been
> putting in snippets of spare time but not enough continous effort
> to get anywhere.
I fixed a segfault with put. It looks like a cut-n-paste problem,
where a "get->" should have been changed to "put->".
> but , if we could put something in the build system to select the
> RNG it would be nice, perhaps we vould prefix the code I wrote with
> MT_ and your with SGK_ and then do a define in the build for the
> symbols to resolve to the correct routine ? ( also this way we would
> have one 'standard' generator, and the other's available as external
> subroutines ?
I prefixed my functions with SGK_ because I doubt anything within
GCC would use that string. I'll change this to KISS_, which describes
the fact the PRNG is Marsaglia's KISS generator.
For your code, I'll leave it in random.c with a #if 0 ... #endif.
Paul or Toon or ... can decide to delete the dead code or change
the #if 0 ... #endif to a #if MT ... #elif KISS ... #endif
compiler option.
> I will also have a good look at your code :-) ... (perhaps I can fix
> mine with it ? ).
I'll clean it up and post it later today.
--
Steve