Multi-dimensional wrapper to compute the sliding dot product between the query, `T[:, start:start+m])` and the time series, `T`. Additionally, compute QT for the first window. Parameters ---------- start : int The window index for T_B from which to calculate the QT
(start, T, m)
| 770 | |
| 771 | |
| 772 | def _get_multi_QT(start, T, m): |
| 773 | """ |
| 774 | Multi-dimensional wrapper to compute the sliding dot product between |
| 775 | the query, `T[:, start:start+m])` and the time series, `T`. |
| 776 | Additionally, compute QT for the first window. |
| 777 | |
| 778 | Parameters |
| 779 | ---------- |
| 780 | start : int |
| 781 | The window index for T_B from which to calculate the QT dot product |
| 782 | |
| 783 | T : numpy.ndarray |
| 784 | The time series or sequence for which to compute the dot product |
| 785 | |
| 786 | m : int |
| 787 | Window size |
| 788 | |
| 789 | Returns |
| 790 | ------- |
| 791 | QT : numpy.ndarray |
| 792 | Given `start`, return the corresponding multi-dimensional QT |
| 793 | |
| 794 | QT_first : numpy.ndarray |
| 795 | Multi-dimensional QT for the first window |
| 796 | """ |
| 797 | d = T.shape[0] |
| 798 | l = T.shape[1] - m + 1 |
| 799 | |
| 800 | QT = np.empty((d, l), dtype=np.float64) |
| 801 | QT_first = np.empty((d, l), dtype=np.float64) |
| 802 | |
| 803 | for i in range(d): |
| 804 | QT[i] = core.sliding_dot_product(T[i, start : start + m], T[i]) |
| 805 | QT_first[i] = core.sliding_dot_product(T[i, :m], T[i]) |
| 806 | |
| 807 | return QT, QT_first |
| 808 | |
| 809 | |
| 810 | @njit( |
no outgoing calls