You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return the index of the `idx`-th element in the buffer, if index is one past the size, return 1, else error.
93
+
Return the index of the `idx`-th element in the buffer, if index is one past the size, return 1, else error.
94
94
"""
95
-
functionwrap_index(idx, n)
95
+
functionwrap_index(idx::Int, n::Int)
96
96
if idx <= n
97
97
return idx
98
98
elseif idx <=2n
99
99
return idx - n
100
100
else
101
-
@info"oops! idx $(idx) > 2n $(2n)"
102
-
return idx - n
101
+
return-1# NOTE: This should never happen, due to @boundscheck
103
102
end
104
103
end
105
104
106
105
"""
107
106
_buffer_frame(cb::CircularArrayBuffer, i::Int)
108
107
109
-
Return the index of the `i`-th frame in the buffer.
108
+
Here `i` is assumed to be the last dimension of `cb`. Each `frame` means a slice of the last dimension. Since we use *circular frames* (the `data` buffer) underlying, this function transforms the logical `i`-th frame to the real frame of the internal buffer.
0 commit comments