Skip to content

Commit a705c14

Browse files
Change variable name from shape to next_fast_n (#33)
* minor change * revise variable name
1 parent 9b4cf54 commit a705c14

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

sdp/numpy_fft_sdp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ def setup(Q, T):
99
def sliding_dot_product(Q, T, order="F"):
1010
n = len(T)
1111
m = len(Q)
12-
shape = next_fast_len(n, real=True)
12+
next_fast_n = next_fast_len(n, real=True)
1313

14-
tmp = np.empty((2, shape), order=order)
14+
tmp = np.empty((2, next_fast_n), order=order)
1515
tmp[0, :m] = Q[::-1]
1616
tmp[0, m:] = 0.0
1717
tmp[1, :n] = T
1818
tmp[1, n:] = 0.0
1919
fft_2d = np.fft.rfft(tmp, axis=-1)
2020

21-
return np.fft.irfft(np.multiply(fft_2d[0], fft_2d[1]), n=shape)[m - 1 : n]
21+
return np.fft.irfft(np.multiply(fft_2d[0], fft_2d[1]), n=next_fast_n)[m - 1 : n]

sdp/pocketfft_r2c_c2r_sdp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def setup(Q, T):
1010
def sliding_dot_product(Q, T):
1111
n = len(T)
1212
m = len(Q)
13-
shape = next_fast_len(n, real=True)
13+
next_fast_n = next_fast_len(n, real=True)
1414

15-
tmp = np.empty((2, shape))
15+
tmp = np.empty((2, next_fast_n))
1616
tmp[0, :m] = Q[::-1]
1717
tmp[0, m:] = 0.0
1818
tmp[1, :n] = T
1919
tmp[1, n:] = 0.0
2020
fft_2d = r2c(True, tmp, axis=-1)
2121

22-
return c2r(False, np.multiply(fft_2d[0], fft_2d[1]), n=shape)[m - 1 : n]
22+
return c2r(False, np.multiply(fft_2d[0], fft_2d[1]), n=next_fast_n)[m - 1 : n]

0 commit comments

Comments
 (0)