view_gather: Create a gather (indexed) view over a shared matrix

View source: R/views.R

view_gatherR Documentation

Create a gather (indexed) view over a shared matrix

Description

Gather views describe non-contiguous column (or row) subsets without allocating a slice-sized matrix. shard-aware kernels can then choose to pack the requested indices into scratch explicitly (bounded and reportable) or run gather-aware compute paths.

Usage

view_gather(x, rows = NULL, cols)

Arguments

x

A shared (share()d) atomic matrix (double/integer/logical/raw).

rows

Row selector. NULL (all rows) or idx_range().

cols

Integer vector of column indices (1-based).

Details

v1 note: only column-gather views are implemented (rows may be NULL or idx_range()).

Value

A shard_view_gather object describing the indexed column view.

Examples


m <- share(matrix(1:20, nrow = 4))
v <- view_gather(m, cols = c(1L, 3L))


shard documentation built on April 3, 2026, 9:08 a.m.