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

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

[Octave-bug-tracker] [bug #53299] Several rand/randn bugs with state/see


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #53299] Several rand/randn bugs with state/seed behavior.
Date: Wed, 7 Mar 2018 18:27:54 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0

Follow-up Comment #5, bug #53299 (project octave):

Since I spent a lot of time looking at rand* recently with respect to the test
suite, I agree with Rik's assessment that, while confusing, the functions do
seem to be behaving as I expect.

There are the "old" vs "new" algorithms, which switch silently under the hood
when a user sets "state" or "seed", but not when simply asking for the current
value of "state" or "seed". And there is no way to query which algorithm is
currently in use.

The only new bit that Rik states that I didn't know is under the old
algorithms, the rande/randg/randp functions depend on the others.

In summary, never use "seed".

Aside: I would really like to know why this test passes only when setting
"seed" to get a random array from the old algorithm:

https://hg.savannah.gnu.org/hgweb/octave/file/2d68dc548561/libinterp/corefcn/conv2.cc#l274

> It would be nicer to simply remove the old random number generator
functionality entirely.

Absolutely, as well as move the state out of global program state and into a
class so that multiple independent random number generators can be
instantiated.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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