Creates an fmalloc-backed ALTREP matrix in a single step by allocating vector storage and installing matrix dimensions (and optional dimnames).
Usage
create_fmalloc_matrix(
type = "integer",
nrow,
ncol,
dimnames = NULL,
runtime = NULL,
zero_initialize = TRUE
)Arguments
- type
Character string specifying the vector type. Supported values are the same as for
create_fmalloc_vector().- nrow
Integer number of rows.
- ncol
Integer number of columns.
- dimnames
Optional
dimnameslist for the matrix.- runtime
Optional runtime handle returned by
open_fmalloc(). If not supplied, the default runtime established byinit_fmalloc()is used.- zero_initialize
Logical scalar passed through to payload allocation. See
create_fmalloc_vector()for semantics.
Examples
if (FALSE) { # \dontrun{
rt <- open_fmalloc(tempfile(fileext = ".bin"))
m <- create_fmalloc_matrix("integer", nrow = 2, ncol = 3, runtime = rt)
cleanup_fmalloc(rt)
} # }