|
From: Ethan A M. <merritt@u.washington.edu> - 2006-05-12 03:30:13
|
On Thursday 11 May 2006 07:33 pm, Daniel J Sebald wrote:
>
> Well, it depends. Here is what the gnuplot code says:
>
> This is a transcription from Pascal to Fortran of routine
[...]
The fact that this comment is in a C program doesn't bother you?
> Setting the seed of a random number generator is meaningless?
> Then why have the capability?
So that you can reproduce a previous run, if necessary.
> Say we wanted "all.dem" to produce the same exact plots no matter how it was run.
Then we would not use random numbers.
> No, the seed and what the PRNG return are two different things.
> My issue is that, yes, the gnuplot PRNG is replacing the state of the
> PRNG but then it immediately generates a random number that *can't be used*.
I have no idea what you mean by that. Random number generators oftern
produce intermediate values that are never seen by the caller. So what?
> unused = rand(678)
>
> does not set the seed to 678. It sets it to whatever the seed is that follows 678.
That statement makes no sense at all.
The seed is set to some internal value that is reproducibly generated
by calling rand(678). That's all you need to know. If you call
rand(678) again next week, you will be setting the same seed.
In fact you *can* set the full 64 bits of the seed to something
in particular if you want to. This is even documented:
`rand(0)` returns a pseudo random number in the interval [0:1] generated
from the current value of two internal 32-bit seeds.
`rand({x,y})` for x>0 sets seed1 to x and seed2 to y
Note that rand(678) is not an example of this, since 678 is not a
complex number. But since the documentation does not say what those
two internal seeds will be used for, the reader is really no wiser than before.
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|