Commit Graph

6 Commits

Author SHA1 Message Date
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
4a51239820 STYLE: restrict posix and ieee754 random tests (non-portable) to linux 2019-04-30 10:05:53 +02:00
Mark Olesen
a5cc0ffcad STYLE: use const reference for caught exceptions 2019-01-23 09:03:06 +01:00
Mark Olesen
a784afc87d STYLE: floor/truncate instead of rounding for Random::position (issue #865)
- affects random integer ranges.
  Simpler to extend the range by one and floor (truncate) instead of
  rounding using odd intervals.
2018-06-13 12:38:13 +02:00
Mark Olesen
3bcbb1615b ENH: improve uniformity of Random::position<label>() (closes #865)
- start/end values were underrepresented due to rounding.
  Now extend the range to include -0.5 and +0.5 beyond the usual
  range to ensure the same number density.
2018-06-12 08:16:06 +02:00
Mark Olesen
b85d0b5cb7 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
2018-04-09 11:08:34 +02:00