* @brief Populate the array with random integers. * @param a The array to populate. * @param N The number of elements in the array. * @param gen The random number generator. * @param min The minimum value for the random integers. * @param max The maximum value for the random integers. */
| 180 | * @param max The maximum value for the random integers. |
| 181 | */ |
| 182 | void randint(float *a, size_t N, std::mt19937 &gen, int min = -1, int max = 1) { |
| 183 | std::uniform_int_distribution<> dist(min, max); |
| 184 | for (int i = 0; i < N; i++) { |
| 185 | a[i] = static_cast<float>(dist(gen)); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * @brief Overload of `randint()` for std::array. |
no outgoing calls