Long Term random number strategy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Long Term random number strategy


I believe we should think about short term and long term strategies for
random numbers.  In the short term, we need a strategy that generates
outputs in the range (0,1) and is compatible, to the largest extent
possible, with legacy code and behavior.

Looking forward, the path is clearer.  Implementing pseudo-random number
generation *correctly* is a difficult proposition, and Octave's
implementations don't receive wide testing.  Both objections would be
solved by moving to the C++ <random> library.  The <random> library was
introduced in C++11 which is now the minimum required version for compiling
Octave code so there are no objections there.  I added a project on the
Wiki about this at https://wiki.octave.org/Projects#Numerical.  The task is:

 "Use C++11 <random> libraries for random number generation. Write link
between Octave functions (rand, randi, randn, rande) and C++ API. Implement
RandStream objects as Matlab does."