| 295 | |
| 296 | template<typename T> |
| 297 | void philoxNormal(T *out, size_t elements, const uintl seed, uintl counter) { |
| 298 | uint hi = seed >> 32; |
| 299 | uint lo = seed; |
| 300 | uint hic = counter >> 32; |
| 301 | uint loc = counter; |
| 302 | uint key[2] = {lo, hi}; |
| 303 | uint ctr[4] = {loc, hic, 0, 0}; |
| 304 | T temp[(4 * sizeof(uint)) / sizeof(T)]; |
| 305 | |
| 306 | int reset = (4 * sizeof(uint)) / sizeof(T); |
| 307 | for (int i = 0; i < (int)elements; i += reset) { |
| 308 | philox(key, ctr); |
| 309 | boxMullerTransform(ctr, temp); |
| 310 | int lim = (reset < (int)(elements - i)) ? reset : (int)(elements - i); |
| 311 | for (int j = 0; j < lim; ++j) { out[i + j] = temp[j]; } |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | template<typename T> |
| 316 | void threefryNormal(T *out, size_t elements, const uintl seed, uintl counter) { |
no test coverage detected