summaryrefslogtreecommitdiff
path: root/content/math/transforms/orTransform.cpp
blob: 1833ac5320b2ba284a1c3c7f37ecfb89b17af00f (plain)
1
2
3
4
5
6
7
8
void fft(vector<ll>& a, bool inv = false) {
	int n = ssize(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];
				v = inv ? v - u : v + u;
}}}}