Options
All
  • Public
  • Public/Protected
  • All
Menu

Uniform random number generator Random number generator by Knuth. For more details see Knuth, Seminumerical Algorithms, 3rd edition, Section 3.6. note This is not Knuth's original implementation which is available at http://www-cs-faculty.stanford.edu/~knuth/programs.html, but rather a slightly modified version wrapped in a C++ class. Such modifications did not affect the code but only the data structures used, which were converted to their standard C++ equivalents.

Hierarchy

  • KnuthUniformRng

Implements

Index

Properties

Private _ran_u

_ran_u: Real[]

Private _ranf_arr_buf

_ranf_arr_buf: Real[]

Private _ranf_arr_ptr

_ranf_arr_ptr: Size

Private _ranf_arr_sentinel

_ranf_arr_sentinel: Size

Methods

init1

Private is_odd

  • Parameters

    Returns boolean

Private mod_sum

  • Parameters

    Returns Real

next

  • Returns Sample<Real>

Private ranf_arr_cycle

  • ranf_arr_cycle(): Real
  • Returns Real

Private ranf_array

  • Parameters

    Returns void

Private ranf_start

  • Parameters

    Returns void