SparseMatrix: Sparse matrix

View source: R/SparseMatrix.R

SparseMatrixR Documentation

Sparse matrix

Description

Constructs a sparse matrix, real or complex.

Usage

SparseMatrix(i, j, Mij, nrows, ncols)

## S3 method for class 'SparseMatrix'
print(x, ...)

asSparseMatrix(M)

Arguments

i, j

indices of the non-zero coefficients

Mij

values of the non-zero coefficients; must be a vector of the same length as i and j or a single number which will be recycled

nrows, ncols

dimensions of the matrix

x

a SparseMatrix object

...

ignored

M

a matrix, real or complex

Value

A list with the class SparseMatrix.

Examples

set.seed(666)
( M <- matrix(rpois(50L, 1), 10L, 5L) )
asSparseMatrix(M)

EigenR documentation built on May 18, 2022, 9:05 a.m.