code: def DotProductStomp(ts, m, dot_first, dot_prev, order):
      """
      Updates the sliding dot product for a time series ts from the previous dot product dot_prev.
  
      Parameters
      ----------
      ts: Time series under analysis.
      m: Length of query within sliding dot product.
      dot_first: The dot product between ts and the beginning query (QT1,1 in Zhu et.al).
      dot_prev: The dot product between ts and the query starting at index-1.
      order: The location of the first point in the query.
      """
  
      l = len(ts) - m + 1
      dot = np.roll(dot_prev, 1)
  
      dot += ts[order + m - 1] * ts[m - 1 : l + m] - ts[
          order - 1
      ] * np.roll(ts[:l], 1)
  
      # Update the first value in the dot product array
      dot[0] = dot_first[order]
  
      return dot
  
file_path: matrixprofile-ts/matrixprofile/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import numpy.fft
label_desc: Use image node_id 6 for calling a global function with example usage: DotProductStomp(ts, m, dot_first, dot_prev, order) and returns: dot