[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36867] randn gives same number when rand is i
From: |
David Bateman |
Subject: |
[Octave-bug-tracker] [bug #36867] randn gives same number when rand is initialised with a random seed |
Date: |
Tue, 09 Oct 2012 19:36:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1 |
Follow-up Comment #3, bug #36867 (project octave):
You're right that having different seeding behavior between the primary and
derived generators might seem odd. The discussion about the reason for this
choice was about 5 years ago on the developers list but I can't remember why
off the top of my head the reason for this choice.
Effectively the process id could be used as additional entropy. Though there
is probably another corner case where using it as entropy doesn't help. I
suppose this should be added to the initialisation of the generators, but till
then you could add something like
s = rand ('state');
s(end) = getpid ();
rand ('state', s);
to get the behavior you want
D.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36867>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/