switchable random number generators

This commit is contained in:
2023-11-17 21:57:28 +01:00
parent c5a2865639
commit 578ca7bab6
10 changed files with 110 additions and 63 deletions

4
vec.cc
View File

@@ -194,7 +194,7 @@ void NRVec<double>::randomize(const double &x){
NOT_GPU(*this);
for(register int i=0; i<nn; ++i){
v[i] = x*(2.*random()/(1. + RAND_MAX) - 1.);
v[i] = x*RANDDOUBLESIGNED();
}
}
@@ -211,7 +211,7 @@ void NRVec<std::complex<double> >::randomize(const double &x) {
NOT_GPU(*this);
for(register int i=0; i<nn; ++i){
v[i] = std::complex<double>(x*(2.*random()/(1. + RAND_MAX) - 1.), x*(2.*random()/(1. + RAND_MAX) - 1.));
v[i] = std::complex<double>(x*RANDDOUBLESIGNED(), x*RANDDOUBLESIGNED());
}
}