A step of the momento_native implementation. Called by momento_reconstruction_curve.
See the file header for the source the module follows.
the source it follows.
Usage
momento_mask_patches(patches, mask_idx, fill = 0)
Arguments
- patches
A vector; its length is taken and its elements indexed.
- mask_idx
Coerced to integer by the body, with as.integer.
- fill
A count; the body uses it as rep(...). Defaults to 0.
Value
A list with masked, mask, mask_idx, mask_rate,
n_patches.
Examples
p <- list(c(1, 2), c(3, 4), c(5, 6), c(7, 8))
momento_mask_patches(p, mask_idx = c(1, 3))$masked # 0-based patch indices
#> [[1]]
#> [1] 1 2
#>
#> [[2]]
#> [1] 0 0
#>
#> [[3]]
#> [1] 5 6
#>
#> [[4]]
#> [1] 0 0
#>