MCPcopy
hub / github.com/stumpy-dev/stumpy / _compute_diagonal

Function _compute_diagonal

stumpy/aamp.py:18–183  ·  view source on GitHub ↗

Compute (Numba JIT-compiled) and update the (top-k) matrix profile P, PL, PR, I, IL, and IR sequentially along individual diagonals using a single thread and avoiding race conditions. Parameters ---------- T_A : numpy.ndarray The time series or sequence for which to

(
    T_A,
    T_B,
    m,
    T_A_subseq_isfinite,
    T_B_subseq_isfinite,
    p,
    diags,
    diags_start_idx,
    diags_stop_idx,
    thread_idx,
    P,
    PL,
    PR,
    I,
    IL,
    IR,
    ignore_trivial,
)

Source from the content-addressed store, hash-verified

16 fastmath=config.STUMPY_FASTMATH_FLAGS,
17)
18def _compute_diagonal(
19 T_A,
20 T_B,
21 m,
22 T_A_subseq_isfinite,
23 T_B_subseq_isfinite,
24 p,
25 diags,
26 diags_start_idx,
27 diags_stop_idx,
28 thread_idx,
29 P,
30 PL,
31 PR,
32 I,
33 IL,
34 IR,
35 ignore_trivial,
36):
37 """
38 Compute (Numba JIT-compiled) and update the (top-k) matrix profile P,
39 PL, PR, I, IL, and IR sequentially along individual diagonals using a single
40 thread and avoiding race conditions.
41
42 Parameters
43 ----------
44 T_A : numpy.ndarray
45 The time series or sequence for which to compute the matrix profile
46
47 T_B : numpy.ndarray
48 The time series or sequence that will be used to annotate T_A. For every
49 subsequence in T_A, its nearest neighbor in T_B will be recorded.
50
51 m : int
52 Window size
53
54 T_A_subseq_isfinite : numpy.ndarray
55 A boolean array that indicates whether a subsequence in `T_A` contains a
56 `np.nan`/`np.inf` value (False)
57
58 T_B_subseq_isfinite : numpy.ndarray
59 A boolean array that indicates whether a subsequence in `T_B` contains a
60 `np.nan`/`np.inf` value (False)
61
62 p : float
63 The p-norm to apply for computing the Minkowski distance. Minkowski distance is
64 typically used with `p` being 1 or 2, which correspond to the Manhattan distance
65 and the Euclidean distance, respectively.
66
67 diags : numpy.ndarray
68 The diag of diagonals to process and compute
69
70 diags_start_idx : int
71 The start index for a range of diagonal diag to process and compute
72
73 diags_stop_idx : int
74 The (exclusive) stop index for a range of diagonal diag to process and compute
75

Callers 1

_aampFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected