materializeR Documentation

Materialize virtual FlashR objects.

Description

FlashR lazily evaluates many operations and outputs virtual objects that represent computation results. fm.materialize.list and fm.materialize explicitly materialize the virtualized computation and save the computation results to memory or disks. Materialization of these virtualized computations triggers materialization of other virtualized computation. By default, FlashR only saves the computation results specified by the arguments of fm.materialize.list and fm.materialize. fm.set.cached changes the default behavior and notifies FlashR to save the materialized computation results of a virtual matrix in memory or on disks.

Usage

fm.materialize.list(args)

fm.materialize(...)

fm.set.cached(fm, cached, in.mem = fm.in.mem(fm))

Arguments

args

a list of virtual FlashR objects.

...

a list of virtual FlashR objects.

fm

a FlashR object.

in.mem

a logical value, indicating whether to save the computation results in memory.

Value

a list of materialized compuation results.

Examples

mat <- fm.mapply2(fm.runif.matrix(100, 10), fm.runif.matrix(100, 10), "+")
mat <- fm.materialize(mat)
mat2 <- fm.sapply(fm.runif.matrix(100, 10), "sqrt")
mat.list <- list(mat, mat2)
mat.list <- fm.materialize.list(mat.list)
mat <- fm.mapply2(fm.runif.matrix(100, 10), fm.runif.matrix(100, 10), "+")
fm.set.cached(mat, TRUE)
res <- fm.agg(mat, "+")