diff options
| author | Noobie99 <noob999noob999@gmail.com> | 2024-02-02 19:52:58 +0100 |
|---|---|---|
| committer | Noobie99 <noob999noob999@gmail.com> | 2024-02-02 19:52:58 +0100 |
| commit | 009a9b1b085912eb96926597af8e5da96e8b4a9f (patch) | |
| tree | a88e676b596e00f8338110344b2865cdd26fd089 /math/transforms/fft.cpp | |
| parent | 3aa6d97a451a7bac3667d35639c0d100b89e8933 (diff) | |
change fft, ntt and bitwise transforms
Diffstat (limited to 'math/transforms/fft.cpp')
| -rw-r--r-- | math/transforms/fft.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/math/transforms/fft.cpp b/math/transforms/fft.cpp index 53a2d8d..2bd95b2 100644 --- a/math/transforms/fft.cpp +++ b/math/transforms/fft.cpp @@ -1,6 +1,6 @@ using cplx = complex<double>; -void fft(vector<cplx>& a, bool inverse = 0) { +void fft(vector<cplx>& a, bool inv = false) { int n = sz(a); for (int i = 0, j = 1; j < n - 1; ++j) { for (int k = n >> 1; k > (i ^= k); k >>= 1); @@ -16,8 +16,8 @@ void fft(vector<cplx>& a, bool inverse = 0) { for (int j = 0; j < n; j += 2 * s) { for (int k = 0; k < s; k++) { cplx u = a[j + k], t = a[j + s + k]; - t *= (inverse ? conj(ws[s + k]) : ws[s + k]); + t *= (inv ? conj(ws[s + k]) : ws[s + k]); a[j + k] = u + t; a[j + s + k] = u - t; - if (inverse) a[j + k] /= 2, a[j + s + k] /= 2; + if (inv) a[j + k] /= 2, a[j + s + k] /= 2; }}}} |
