Skip to contents

A step of the mistr_native implementation. Called by mistr_mistral_block. See the file header for the source the module follows.

Usage

mistr_sliding_window_mask(L, window, causal = TRUE)

Arguments

L

A count; the body uses it as seq_len(...).

window

Passed to <.

causal

A flag; the body branches on it. Defaults to TRUE.

Value

The value of mask, as built in the body.

Examples

mistr_sliding_window_mask(L = 5, window = 2)
#>       [,1]  [,2]  [,3]  [,4]  [,5]
#> [1,]  TRUE FALSE FALSE FALSE FALSE
#> [2,]  TRUE  TRUE FALSE FALSE FALSE
#> [3,] FALSE  TRUE  TRUE FALSE FALSE
#> [4,] FALSE FALSE  TRUE  TRUE FALSE
#> [5,] FALSE FALSE FALSE  TRUE  TRUE