octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53300] rand('state') at Octave start is not c


From: Rik
Subject: [Octave-bug-tracker] [bug #53300] rand('state') at Octave start is not correct
Date: Thu, 8 Mar 2018 19:18:04 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #53300 (project octave):

                  Status:             In Progress => Ready For Test         

    _______________________________________________________

Follow-up Comment #4:

Okay, I found the problem.  During initialization we repeatedly initialize the
random number generator using entropy, and then store the created state vector
for each random number generator.  We do this 5 times for rand, randn, rande,
randp, and randg.

What we were not doing is restoring the state vector after all this
initialization.  When you query rand ("state") you were getting the state
vector for the rand generator, but the generator itself was still using the
last configured value which happened to be randg.

This cset seems to fix it
(http://hg.savannah.gnu.org/hgweb/octave/rev/53db3b152397).  I applied it to
the default branch, but we could consider backporting it to stable as well.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53300>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]