fmesher_sparse: Conversion between sparse matrix types

fm_as_dgCMatrixR Documentation

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)

## Default S3 method:
fm_as_dgCMatrix(x)

## S3 method for class 'fmesher_sparse'
fm_as_dgCMatrix(x)

## Default S3 method:
fm_as_dgTMatrix(x, unique = TRUE, ...)

## Default S3 method:
fm_as_unpackedMatrix(x)

## S3 method for class 'fmesher_sparse'
fm_as_unpackedMatrix(x)

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

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.

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.

Examples

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))

fmesher documentation built on July 1, 2024, 5:07 p.m.