Skip to content

Commit 5a7f315

Browse files
committed
improve njit_sdp
1 parent bd6aed8 commit 5a7f315

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stumpy/sdp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ def _njit_sliding_dot_product(Q, T):
2323
out : numpy.ndarray
2424
Sliding dot product between `Q` and `T`.
2525
"""
26-
m = Q.shape[0]
26+
m = len(Q)
2727
l = T.shape[0] - m + 1
2828
out = np.empty(l)
2929
for i in range(l):
30-
out[i] = np.dot(Q, T[i : i + m])
30+
result = 0.0
31+
for j in range(m):
32+
result += Q[j] * T[i + j]
33+
out[i] = result
3134

3235
return out
3336

0 commit comments

Comments
 (0)