| mem_matrix | R Documentation |
S3 object wrapping an external pointer to a Cpp MemoryMappedMatrix.
mem_matrix(filename, rows, cols, mode = "readwrite")
filename |
Path to binary mmap file |
rows |
Number of rows |
cols |
Number of columns |
mode |
Access mode: 'readonly' or 'readwrite' (default). Code that
writes into the matrix needs 'readwrite': a selector that standardizes
the design in place and restores it ( |
A file serves one writer at a time. Do not run several selectors
or T-solvers that standardize the file in place on one file at the same
time, neither through a second handle in one session nor in several
processes. Each would change the data the other works on, and the
results come out wrong. To use one design in several processes at once,
pre-normalize it with trex_normalize_design, open the file
in 'readonly' mode and run every selector with
scaling_mode = "NONE".
Object of classes MemoryMappedMatrix and mmap_matrix (S3 XPtr wrapper)
F. Scheidt, J. Machkour, and M. Muma, "Solving FDR-Controlled Sparse Regression Problems with Five Million Variables on a Laptop," in Proc. IEEE 9th Int. Workshop Comput. Adv. Multi-Sensor Adapt. Process. (CAMSAP), 2023, pp. 116-120.
Other memory-mapped matrices:
[.mmap_matrix(),
as.matrix.mmap_matrix(),
dim.mmap_matrix(),
mem_matrix_from(),
print.mmap_matrix()
mat <- matrix(as.double(1:20), nrow = 4, ncol = 5)
f <- tempfile(fileext = ".bin")
on.exit(unlink(f), add = TRUE)
mem_matrix_from(mat, f)
mm <- mem_matrix(f, rows = 4, cols = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.