class xf::fintech::MT19937

#include "rng.hpp"

Overview

Mersenne Twister to generate uniform random number.

Reference:Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator


Methods

seedInitialization

void seedInitialization (ap_uint <W> seed)

initialize mt and mt_1 using seed

Parameters:

seed initialization seed

MT19937

MT19937 (ap_uint <W> seed)

Constructor with seed.

Parameters:

seed initialization seed

statusSetup

void statusSetup (ap_uint <W> data [N])

Setup status.

Parameters:

data array to store the initialization data

nextTwo

void nextTwo (
    ap_ufixed <W, 0>& result_l,
    ap_ufixed <W, 0>& result_r
    )

each call of nextTwo() generate two uniformly distributed random numbers

Parameters:

result_l first random number
result_r second random number