We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea778e3 commit daa8bb1Copy full SHA for daa8bb1
pocketfft_demo.cc
@@ -7,10 +7,18 @@
7
using namespace std;
8
using namespace pocketfft;
9
10
+// floating point RNG which is good enough for sinmple demos
11
+// Do not use for anything important!
12
+inline double simple_drand()
13
+ {
14
+ constexpr double norm = 1./RAND_MAX;
15
+ return rand()*norm;
16
+ }
17
+
18
template<typename T> void crand(vector<complex<T>> &v)
19
{
20
for (auto & i:v)
- i = complex<T>(drand48()-0.5, drand48()-0.5);
21
+ i = complex<T>(simple_drand()-0.5, simple_drand()-0.5);
22
}
23
24
template<typename T1, typename T2> long double l2err
0 commit comments