| 364 | |
| 365 | template<typename T> |
| 366 | void normalDistributionMT(T *out, size_t elements, uint *const state, |
| 367 | const uint *const pos, const uint *const sh1, |
| 368 | const uint *const sh2, uint mask, |
| 369 | const uint *const recursion_table, |
| 370 | const uint *const temper_table) { |
| 371 | T temp[(4 * sizeof(uint)) / sizeof(T)]; |
| 372 | uint l_state[STATE_SIZE]; |
| 373 | uint o[4]; |
| 374 | uint lpos = pos[0]; |
| 375 | uint lsh1 = sh1[0]; |
| 376 | uint lsh2 = sh2[0]; |
| 377 | |
| 378 | state_read(l_state, state); |
| 379 | |
| 380 | int reset = (4 * sizeof(uint)) / sizeof(T); |
| 381 | for (int i = 0; i < (int)elements; i += reset) { |
| 382 | mersenne(o, l_state, i, lpos, lsh1, lsh2, mask, recursion_table, |
| 383 | temper_table); |
| 384 | boxMullerTransform(o, temp); |
| 385 | int lim = (reset < (int)(elements - i)) ? reset : (int)(elements - i); |
| 386 | for (int j = 0; j < lim; ++j) { out[i + j] = temp[j]; } |
| 387 | } |
| 388 | |
| 389 | state_write(state, l_state); |
| 390 | } |
| 391 | |
| 392 | template<typename T> |
| 393 | void uniformDistributionCBRNG(T *out, size_t elements, |
nothing calls this directly
no test coverage detected