mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-06-16 15:18:45 +08:00
move srand to main()
Signed-off-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
This commit is contained in:
@@ -28,7 +28,6 @@ using qr_algorithm::operator<<;
|
||||
void create_matrix(std::valarray<std::valarray<double>> *A) {
|
||||
int i, j, tmp, lim2 = LIMS >> 1;
|
||||
int N = A->size();
|
||||
std::srand(std::time(nullptr));
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for
|
||||
@@ -242,6 +241,9 @@ int main(int argc, char **argv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// initialize random number generator
|
||||
std::srand(std::time(nullptr));
|
||||
|
||||
int i, rows = mat_size, columns = mat_size;
|
||||
|
||||
std::valarray<std::valarray<double>> A(rows);
|
||||
|
||||
Reference in New Issue
Block a user