Skip to content

Commit

Permalink
Fixed spacing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Chillee committed Apr 26, 2019
1 parent 7c16aeb commit b886871
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions content/numerical/FastFourierTransform.h
Expand Up @@ -28,12 +28,12 @@ void fft(vector<C> &a, int n, int L) {
rep(i,0,n) if (i < rev[i]) swap(a[i], a[rev[i]]);
for (int k = 1; k < n; k *= 2)
for (int i = 0; i < n; i += 2 * k) rep(j,0,k) {
// C z = rt[j+k] * a[i+j+k]; // (25% faster if hand-rolled) /// include-line
auto x = (double *)&rt[j + k], y = (double *)&a[i + j + k]; /// exclude-line
C z(x[0] * y[0] - x[1] * y[1], x[0] * y[1] + x[1] * y[0]); /// exclude-line
a[i + j + k] = a[i + j] - z;
a[i + j] += z;
}
// C z = rt[j+k] * a[i+j+k]; // (25% faster if hand-rolled) /// include-line
auto x = (double *)&rt[j+k], y = (double *)&a[i+j+k]; /// exclude-line
C z(x[0]*y[0] - x[1]*y[1], x[0]*y[1] + x[1]*y[0]); /// exclude-line
a[i + j + k] = a[i + j] - z;
a[i + j] += z;
}
}

vd conv(const vd &a, const vd &b) {
Expand Down

0 comments on commit b886871

Please sign in to comment.