Description
The spam
class is a representation of sparse matrices.Objects from the Class
Objects can be created by calls of the form new("spam", entries, colindices,
rowpointes, dimension)
.
The standard "old Yale sparse format" is used to store sparse matrices.
The matrix
x
is stored in row form. The first element of row i
is
x@rowpointers[i]
. The length of row i
is determined by
x@rowpointers[i+1]-x@rowpointers[i]
. The column indices of x
are stored in
the x@colindices
vector. The column index for element x@entries[k]
is
x@colindices[k]
.Examples
Run this codesmat <- diag.spam(runif(15))
range(smat)
cos(smat)
Run the code above in your browser using DataLab