We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 950cddf commit 6e1da6bCopy full SHA for 6e1da6b
sdp/numpy_fft_sdp.py
@@ -9,13 +9,13 @@ def setup(Q, T):
9
def sliding_dot_product(Q, T, order="F"):
10
n = len(T)
11
m = len(Q)
12
- shape = next_fast_len(n, real=True)
+ next_fast_n = next_fast_len(n, real=True)
13
14
- tmp = np.empty((2, shape), order=order)
+ tmp = np.empty((2, next_fast_n), order=order)
15
tmp[0, :m] = Q[::-1]
16
tmp[0, m:] = 0.0
17
tmp[1, :n] = T
18
tmp[1, n:] = 0.0
19
fft_2d = np.fft.rfft(tmp, axis=-1)
20
21
- return np.fft.irfft(np.multiply(fft_2d[0], fft_2d[1]), n=shape)[m - 1 : n]
+ return np.fft.irfft(np.multiply(fft_2d[0], fft_2d[1]), n=next_fast_n)[m - 1 : n]
0 commit comments