ENH: provide Rand48 as generator in the expected C++11 form

- this removes an OS-specific dependency (eg, drand48_r is not POSIX)
  and allows easier use of other random number generators.

  The Rand48 generator has identical behaviour and period as the
  lrand48() library routine, but holds its own seed and state
  (which makes it re-entrant) and can be combined with other
  random distributions.

  However, when using the modified form to obtain scalar values
  they will not be identical to what drand48() yields.

  This is because drand48() uses the raw 48-bit values to directly
  set the mantissa of an IEEE double where as the newer distribution
  normalizes based on the 32-bit value.

STYLE: simplify code in Random::shuffle and use Swap
This commit is contained in:
Mark Olesen
2018-04-09 11:08:34 +02:00
parent e4f5471edf
commit b85d0b5cb7
10 changed files with 455 additions and 250 deletions

View File

@ -0,0 +1,3 @@
Test-Random.C
EXE = $(FOAM_USER_APPBIN)/Test-Random

View File

@ -0,0 +1,3 @@
EXE_INC =
EXE_LIBS =