RANDOM question [message #33224] |
Mon, 16 December 2002 07:52  |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
I would like to save the state of the pseudorandom-number generator in a
file so that I can resume (or reproduce) a calculation at a later time.
Does anyone know if the state variable ("seed") is always a 36-element
long vector? The docs say that "seed" is "a named variable that
contains a longword array of the proper length", but does not give the
"proper length".
Thanks, Ken
IDL> seed = 19
IDL> x = randomn(seed)
IDL> print, x
0.774932
IDL> help, seed
SEED LONG = Array[36]
|
|
|
|
Re: RANDOM question [message #33315 is a reply to message #33224] |
Mon, 16 December 2002 09:13  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Kenneth Bowman <k-bowman@null.tamu.edu> writes:
> I would like to save the state of the pseudorandom-number generator in a
> file so that I can resume (or reproduce) a calculation at a later time.
> Does anyone know if the state variable ("seed") is always a 36-element
> long vector? The docs say that "seed" is "a named variable that
> contains a longword array of the proper length", but does not give the
> "proper length".
Hi Ken--
I think in the past, defined as IDL 4.X, the SEED value was a scalar
quantity. I think RSI will probably always reserve the right to
adjust the internal contents and form of SEED in order to maintain the
quality of the random numbers.
So it really depends on what your definition of "always" is.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|