Random number generator. More...

#include <random.h>

Public Member Functions

auto SetSeed (unsigned int seed) -> void
 Set seed and initialize internal state.
auto NextUInt () -> unsigned int
 Generate an uniform random number as unsigned int type.
auto Next () -> Float
 Generate an uniform random number in [0,1].
LM_INLINE auto Next2D () -> Vec2
 Generate uniform random numbers in [0,1]^2.

Public Attributes

Impl * p_

Detailed Description

Random number generator.

As the underlying implementation, we uses SIMD-oriented Fast Mersenne Twister (SFMT) using an implementation by Mutsuo Saito and Makoto Matsumoto: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/