matrix.csr-class {SparseM} | R Documentation |
Class "matrix.csr" - Sparse Matrices in Compressed Sparse Row Format
Description
A class for sparse matrices stored in compressed sparse row ('csr') format.
Objects from the Class
Objects can be created by calls of the form new("matrix.csr", ...)
and coerced from various other formats. Coercion of integer scalars
and vectors into identity matrices and diagonal matrices respectively
is accomplished by as(x,"matrix.diag.csr")
which generates an
object that has all the rights and responsibilties of the "matrix.csr"
class.
The default "matrix.csr"
object, i.e., new("matrix.csr")
, is
a scalar (1 by 1) matrix with element 0.
Slots
ra
:Object of class
numeric
, a real array of nnz elements containing the non-zero elements of A, stored in row order. Thus, ifi < j
, all elements of row i precede elements from row j. The order of elements within the rows is immaterial.ja
:Object of class
integer
, an integer array of nnz elements containing the column indices of the elements stored inra
.ia
:A class
integer
array of n+1 elements containing pointers to the beginning of each row in the arraysra
andja
. Thus ‘ia[i]’ indicates the position in the arraysra
andja
where the ith row begins. The last, (n+1)st, element ofia
indicates where the n+1 row would start, if it existed.dimension
:An
integer
, dimension of the matrix
Methods
- %*%
signature(x = "matrix.csr", y = "matrix.csr")
: ...- %*%
signature(x = "matrix.csr", y = "matrix")
: ...- %*%
signature(x = "matrix.csr", y = "numeric")
: ...- %*%
signature(x = "matrix", y = "matrix.csr")
: ...- %*%
signature(x = "numeric", y = "matrix.csr")
: ...- as.matrix.csc
signature(x = "matrix.csr")
: ...- as.matrix.ssc
signature(x = "matrix.csr")
: ...- as.matrix.ssr
signature(x = "matrix.csr")
: ...- as.matrix.coo
signature(x = "matrix.csr")
: ...- as.matrix
signature(x = "matrix.csr")
: ...- chol
signature(x = "matrix.csr")
: ...- diag
signature(x = "matrix.csr")
: ...- diag<-
signature(x = "matrix.csr")
: ...- dim
signature(x = "matrix.csr")
: ...- image
signature(x = "matrix.csr")
: ...- solve
signature(a = "matrix.csr")
: ...- t
signature(x = "matrix.csr")
: ...- diff
signature(x = "matrix.csr")
: ...- diag<-
signature(x = "matrix.diag.csr")
: ...
See Also
Examples
new("matrix.csr") # the 1x1 matrix [0]
new("matrix.diag.csr") # the 'same'
as(1:5, "matrix.diag.csr") # a sparse version of diag(1:5)