Matrix reduction helpers for fmalloc-backed matrices
Source:R/fmalloc_methods.R
fmalloc_reduction_methods.RdThese S3 methods preserve current fmalloc behavior for matrix summary/reduction operations while returning ordinary R vectors for small results.
Usage
rowSums(x, na.rm = FALSE, dims = 1L)
colSums(x, na.rm = FALSE, dims = 1L)
rowMeans(x, na.rm = FALSE, dims = 1L)
colMeans(x, na.rm = FALSE, dims = 1L)Value
The reduction result, as either an ordinary R object or a
fmalloc vector when result length exceeds
getOption("Rfmalloc.reduce_result_length", 1e6).
Details
These implementations keep managed execution for 2D fmalloc matrices with
dims = 1L. For unsupported shapes or dims values (for example,
non-2D arrays or dims != 1L), the methods warn and delegate to the base R
implementations (base::rowSums, base::colSums, base::rowMeans, and
base::colMeans).