๐ท๐‘Ž๐‘ก๐‘Ž๐ท๐‘Ž๐‘ก๐‘Žโ‚—โ‚‘โ‚™ ๐‘†๐‘๐‘Ž๐‘› ๐‘†๐‘๐‘Ž๐‘›โ‚—โ‚‘โ‚™ ๐’ฏ ๐’ฏโ‚—โ‚‘โ‚™ ๐’ซ ๐’ซโ‚—โ‚‘โ‚™ ๐’ช ๐’ชโบ ๐’ชโป

๐ท๐‘Ž๐‘ก๐‘Ž๐ท๐‘Ž๐‘ก๐‘Žโ‚™ ๐‘†๐‘๐‘Ž๐‘› ๐‘†๐‘๐‘Ž๐‘›โ‚™ ๐’ฏ ๐’ฏโ‚™ ๐’ซ ๐’ซโ‚™ ๐’ช ๐’ชโบ ๐’ชโป โบ๐’ชโ‚™ โป๐’ชโ‚™

We accept a data sequence๐ท๐‘Ž๐‘ก๐‘Ž๐’ฎ of type Vector{T} and of length๐ท๐‘Ž๐‘ก๐‘Ž๐’ฎโ‚™ (๐ท๐‘Ž๐‘ก๐‘Ž๐’ฎ[begin:end], length(๐ท๐‘Ž๐‘ก๐‘Ž๐’ฎ) ==๐ท๐‘Ž๐‘ก๐‘Ž๐’ฎโ‚™). We are given a window specification that includes its length, the span of any tiling, and more.

Given a data seqeunce of N elements and a window that spans W elements (W <= N), ccompletewindows, rremainingindices = fldmod(N, W) if iszero(remainingelements) the data sequence is covered exactly with ccompletewindows otherwise, the data sequence is nearly fully covered with ccompletewindows, leaving rremaining_indices

N = c_complete_windows * W + r_remaining_indices
0 = c_complete_windows * W + r_remaining_indices - N
c_complete_windows * W = N - r_remaining_indices
c_complete_windows = div((N - r_remaining_indices), W)
W = div((N - r_remaining_indices), c_complete_windows)
r_remaining_indices = N - c_complete_windows * W

The preceeding assumes that the window always advances by 1 index. Use A as the whole number of indices (1 <= A <= N-1-W) that window always advances. With A = N-1-W, there is exactly one advance, from index 1 to index 1+N-1-W = N-W the repositioned window now starts at index N-W and spans W indices, N-W+W == N and the window has nowhere more to traverse.

What value of A allows exactly 2 advances? A1 = N-1-W, if iseven(A1) A2 = div(A1,2) or, if isodd(N-W), A2 = div(N-W-1, 2)