From 009a9b1b085912eb96926597af8e5da96e8b4a9f Mon Sep 17 00:00:00 2001 From: Noobie99 Date: Fri, 2 Feb 2024 19:52:58 +0100 Subject: change fft, ntt and bitwise transforms --- math/transforms/fft.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'math/transforms/fft.cpp') 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; -void fft(vector& a, bool inverse = 0) { +void fft(vector& 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& 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; }}}} -- cgit v1.2.3