template class xf::fintech::MultiVariateNormalRng¶
#include "rng.hpp"
Overview¶
Multi-variate normal distribution RNG.
Parameters:
| _DT | data type, either float or double. |
| _VariateNum | number of variates. |
| _BuffDepth | depth of buffer. |
template < typename _DT, int _VariatePairNum, int _BuffDepth > class MultiVariateNormalRng
Methods¶
MultiVariateNormalRng¶
MultiVariateNormalRng ()
Constructor, use pragma to determine data member’s hardware implementation.
init¶
void init ( ap_uint <32> seed, _DT input_ltm [_VariatePairNum *2+1][_VariatePairNum] )
Initialize underlying RNG, setup lower triangle matrix and pre-calculate.
Parameters:
| seed | seed to initialize underlying RNG |
| input_ltm | input lower triangle matrix |
next¶
void next ( _DT& res_0, _DT& res_1 )
Each call returns two random number, in the order of 1st and 2nd, 3rd and 4th …. 2*n-1 th and 2*n th.
Parameters:
| res_0 | (2*n - 1)-th random number generated. |
| res_1 | 2*n-th random number generated. |