summaryrefslogtreecommitdiff
path: root/content/math/transforms/andTransform.cpp
blob: 93a323a76f80c181b1025a452d1d1dd43dd4a5f7 (plain)
1
2
3
4
5
6
7
8
void fft(vector<ll>& a, bool inv = false) {
	int n = sz(a);
	for (int s = 1; s < n; s *= 2) {
		for (int i = 0; i < n; i += 2 * s) {
			for (int j = i; j < i + s; j++) {
				ll& u = a[j], &v = a[j + s];
				u = inv ? u - v : u + v;
}}}}