Learn R Programming

fmesher (version 0.3.0)

fm_as_dgCMatrix: Conversion between sparse matrix types

Description

Conversion between sparse matrix types

Usage

fm_as_dgCMatrix(x)

fm_as_dgTMatrix(x, unique = TRUE, ...)

fm_as_unpackedMatrix(x)

fm_as_fmesher_sparse(x)

# S3 method for default fm_as_dgCMatrix(x)

# S3 method for fmesher_sparse fm_as_dgCMatrix(x)

# S3 method for default fm_as_dgTMatrix(x, unique = TRUE, ...)

# S3 method for default fm_as_unpackedMatrix(x)

# S3 method for fmesher_sparse fm_as_unpackedMatrix(x)

# S3 method for fmesher_sparse fm_as_dgTMatrix(x, unique = TRUE, ...)

Value

fm_as_dgCMatrix returns a Matrix::dgCMatrix object.

fm_as_dgTMatrix returns a Matrix::dgTMatrix object.

fm_as_unpackedMatrix returns an object of virtual class Matrix::unpackedMatrix.

fm_as_fmesher_sparse returns an fmesher_sparse object.

Arguments

x

Object to be converted

unique

logical; if TRUE, ensures that the sparse triplet representation has a single entry for each non-zero matrix element.

Examples

Run this code
library(Matrix)
str(A <- fm_as_dgCMatrix(matrix(c(1, 2, 0, 0, 0, 3, 4, 0, 5), 3, 3)))
str(fm_as_dgTMatrix(A))
str(fm_as_unpackedMatrix(A))
str(fm_as_fmesher_sparse(A))

Run the code above in your browser using DataLab