2024-12-13 00:33:08 +01:00
|
|
|
#ifndef UTILS_HPP
|
|
|
|
#define UTILS_HPP
|
|
|
|
|
|
|
|
#include <random>
|
|
|
|
|
|
|
|
// Function to initialize a vector with random numbers
|
|
|
|
void initialize_vector(std::vector<float>& v) {
|
2024-12-13 12:01:35 +01:00
|
|
|
std::random_device rd;
|
|
|
|
std::mt19937 gen(rd());
|
|
|
|
std::uniform_real_distribution<float> dis(0.0f, 1.0f);
|
|
|
|
for (auto& elem : v) {
|
|
|
|
elem = dis(gen);
|
|
|
|
}
|
2024-12-13 00:33:08 +01:00
|
|
|
}
|
|
|
|
|
2024-12-13 12:01:35 +01:00
|
|
|
#endif // UTILS_HPP
|