Re: Random Numbers
- From: pa@xxxxxxxxxxxxxxxxxxxxx (Pierre Asselin)
- Date: Thu, 29 Jun 2006 19:19:47 +0000 (UTC)
Steven G. Kargl <kargl@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
[ wants random numbers reproducible from run to run ]
OTOH, I do use code of the form
call random_seed(size=n)
allocate(put(n))
put = nrand + 37 * (/ (i - 1, i = 1, n) /) ! nrand is user input.
call random_seed(put=put)
deallocate(put)
Does the standard specify what you can or cannot pass to
random_seed(put=) ? I mean the content, not just the size. I was
bitten once by an implementation that was very picky about the
contents of its seed vectors. I did as you show, asking random_seed()
for the size and filling the array with some sequence salted by a
small user input. The resulting sequence was anything but random !
IIRC the standard promises that you can call random_seed(get=) and
use the result in a random_seed(put=), but as far as I know you
can't construct your own seed.
--
pa at panix dot com
.
- Follow-Ups:
- Re: Random Numbers
- From: Steven G. Kargl
- Re: Random Numbers
- From: Richard E Maine
- Re: Random Numbers
- From: Ken Fairfield
- Re: Random Numbers
- References:
- Random Numbers
- From: CTallant
- Re: Random Numbers
- From: dpb
- Re: Random Numbers
- From: Richard E Maine
- Re: Random Numbers
- From: Steven G. Kargl
- Random Numbers
- Prev by Date: Re: Random Numbers
- Next by Date: Re: Random Numbers
- Previous by thread: Re: Random Numbers
- Next by thread: Re: Random Numbers
- Index(es):
Relevant Pages
|