@@ -21,7 +21,7 @@ def __init__(self, max_n=2**20):
2121 self .rfft_objects = {}
2222 self .irfft_objects = {}
2323
24- def __call__ (self , Q , T , n_threads = 1 , planning_flag = "FFTW_MEASURE " ):
24+ def __call__ (self , Q , T , n_threads = 1 , planning_flag = "FFTW_ESTIMATE " ):
2525 """
2626 Compute the sliding dot product between `Q` and `T` using FFTW via pyfftw.
2727
@@ -98,7 +98,7 @@ def __call__(self, Q, T, n_threads=1, planning_flag="FFTW_MEASURE"):
9898 # RFFT(Q)
9999 # Scale by 1/next_fast_n to account for
100100 # FFTW's unnormalized inverse FFT via execute()
101- real_arr [: m ] = Q [::- 1 ] / next_fast_n
101+ np . multiply ( Q [::- 1 ], 1.0 / next_fast_n , out = real_arr [: m ])
102102 real_arr [m :] = 0.0
103103 rfft_obj .execute () # output is in complex_arr
104104
@@ -114,10 +114,10 @@ def __call__(self, Q, T, n_threads=1, planning_flag="FFTW_MEASURE"):
114114_sliding_dot_product = SLIDING_DOT_PRODUCT ()
115115
116116
117- def setup (Q , T , n_threads = 1 , planning_flag = "FFTW_MEASURE " ):
117+ def setup (Q , T , n_threads = 1 , planning_flag = "FFTW_ESTIMATE " ):
118118 _sliding_dot_product (Q , T , n_threads = n_threads , planning_flag = planning_flag )
119119 return
120120
121121
122- def sliding_dot_product (Q , T , n_threads = 1 , planning_flag = "FFTW_MEASURE " ):
122+ def sliding_dot_product (Q , T , n_threads = 1 , planning_flag = "FFTW_ESTIMATE " ):
123123 return _sliding_dot_product (Q , T , n_threads = n_threads , planning_flag = planning_flag )
0 commit comments