SparseMatrix {EigenR} | R 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 |
nrows , ncols |
dimensions of the matrix |
x |
a |
... |
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)
[Package EigenR version 1.3.0 Index]