[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sampling from two instances of a random number generator
From: |
Leo Razoumov |
Subject: |
sampling from two instances of a random number generator |
Date: |
Sat, 24 May 2008 17:39:56 -0400 |
Hi ALL,
I need to sample from several instances of a random number generator
in the same program. Apparently, Octave does not let me do it. It
seems as though that "rand" has only one global state. The best advice
from the manual is to save/restore rand state with
v = rand("state")
rand("state", v)
Since I have to draw only one number at a time from each RNG millions
of time this can quickly become a nuisance. Also, it is plain ugly!
Octave is object oriented, right? Why not to have a RNG constructor
rng1= RNGuniform(seed)
...
sample= rng1.get()
or something similar. Is it a Matlab heritage or I am missing
something important?
Thanks,
--Leo--
- sampling from two instances of a random number generator,
Leo Razoumov <=
- Re: sampling from two instances of a random number generator, Ben Abbott, 2008/05/24
- Re: sampling from two instances of a random number generator, Jaroslav Hajek, 2008/05/25
- Re: sampling from two instances of a random number generator, Leo Razoumov, 2008/05/25
- Re: sampling from two instances of a random number generator, Leo Razoumov, 2008/05/25
- Re: sampling from two instances of a random number generator, Søren Hauberg, 2008/05/26
- Re: sampling from two instances of a random number generator, Leo Razoumov, 2008/05/27
- Re: sampling from two instances of a random number generator, David Bateman, 2008/05/27