fmlmat: fmlmat

Description Usage Arguments Details Value Examples

View source: R/fmlmat.r

Description

Cast an R matrix as an fmlmat object, or create a skeleton fmlmat object.

Usage

1
fmlmat(x, nrows, ncols, type = "double", backend = "cpu")

Arguments

x

A numeric R matrix/vector. Can be of integer or double type, or a float32 object of float data (from the float package).

nrows, ncols

The number of rows/columns for a skeleton matrix.

type

The fundamental type. Should be one of "int", "float", or "double".

backend

Should be one of "cpu", "gpu", or "mpi".

Details

Must pass either x (an R object to cast) or nrows/ncols, but not both.

GPU data will use the defaults from fmlr::card(), and MPI data will use the defaults from fmlr::grid(). If you need more control, you should use the fmlr constructors and convert with craze::as_fmlmat().

Value

An fmlmat class object.

Examples

1
2
3
4
5
suppressMessages(library(craze))

x = matrix(as.double(1:6), 3)
x_cpu = fmlmat(x)
x_cpu

fml-fam/craze documentation built on June 6, 2020, 2:05 p.m.