| 22 | |
| 23 | template <typename Iter> |
| 24 | void dft(Iter X, Iter last) { |
| 25 | const auto N = last - X; |
| 26 | std::vector<complex> tmp(N); |
| 27 | for (auto i = 0; i < N; ++i) { |
| 28 | for (auto j = 0; j < N; ++j) { |
| 29 | tmp[i] += X[j] * exp(complex(0, -2.0 * M_PI * i * j / N)); |
| 30 | } |
| 31 | } |
| 32 | std::copy(std::begin(tmp), std::end(tmp), X); |
| 33 | } |
| 34 | |
| 35 | // `cooley_tukey` does the cooley-tukey algorithm, recursively |
| 36 | template <typename Iter> |
nothing calls this directly
no outgoing calls
no test coverage detected