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

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

[Octave-bug-tracker] [bug #57564] Implementation of rng


From: Guillaume
Subject: [Octave-bug-tracker] [bug #57564] Implementation of rng
Date: Thu, 9 Jan 2020 09:43:28 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

URL:
  <https://savannah.gnu.org/bugs/?57564>

                 Summary: Implementation of rng
                 Project: GNU Octave
            Submitted by: gyom
            Submitted on: Thu 09 Jan 2020 02:43:27 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

Matlab has a "rng" function to set and query the state of the random number
generator:
https://www.mathworks.com/help/matlab/ref/rng.html
This is the recommended syntax. The use of rand('state',...) is discouraged
and not documented any more:
https://www.mathworks.com/help/matlab/math/updating-your-random-number-generator-syntax.html
https://www.mathworks.com/help/matlab/ref/rand.html

I attach a possible implementation for Octave. Currently, Octave has a
separate generator for rand and randn so rng stores both states: if and when
Octave evolves to use a single generator, the rng function can be updated
internally without any visible change from the outside. This means that, in my
eye, rng can be considered for inclusion in Octave now even if some work is
still to take place in rand/randn.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 09 Jan 2020 02:43:27 PM UTC  Name: rng.m  Size: 9KiB   By: gyom

<http://savannah.gnu.org/bugs/download.php?file_id=48187>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57564>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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