File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ void dft(Iter X, Iter last) {
26
26
std::vector<complex> tmp (N);
27
27
for (auto i = 0 ; i < N; ++i) {
28
28
for (auto j = 0 ; j < N; ++j) {
29
- using namespace std ::literals::complex_literals;
30
- tmp[i] += X[j] * exp (-2.0 * M_PI * i * j / N * 1i);
29
+ tmp[i] += X[j] * exp (complex (0 , -2.0 * M_PI * i * j / N));
31
30
}
32
31
}
33
32
std::copy (std::begin (tmp), std::end (tmp), X);
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ In the end, the code looks like:
119
119
{% sample lang="c" %}
120
120
[ import:20-39, lang:"c_cpp"] ( code/c/fft.c )
121
121
{% sample lang="cpp" %}
122
- [ import:36-67 , lang:"c_cpp"] ( code/c++/fft.cpp )
122
+ [ import:35-66 , lang:"c_cpp"] ( code/c++/fft.cpp )
123
123
{% sample lang="hs" %}
124
124
[ import:6-19, lang:"haskell"] ( code/haskell/fft.hs )
125
125
{% sample lang="py" %}
You can’t perform that action at this time.
0 commit comments