
The "TsparseMatrix"
class is the virtual class of
all sparse matrices coded in triplet form. Since it is a virtual class,
no objects may be created from it. See
showClass("TsparseMatrix")
for its subclasses.
Dim
, Dimnames
:i
:Object of class "integer"
- the row indices
of non-zero entries in 0-base, i.e., must be in
0:(nrow(.)-1)
.
j
:Object of class "integer"
- the column
indices of non-zero entries. Must be the same length as slot
i
and 0-based as well, i.e., in
0:(ncol(.)-1)
. For numeric Tsparse matrices, (i,j)
pairs can occur more than once, see '>dgTMatrix
.
Class "sparseMatrix"
, directly.
Class "Matrix"
, by class "sparseMatrix"
.
Extraction ("["
) methods, see
[-methods
.
its superclass, '>sparseMatrix
, and the
'>dgTMatrix
class, for the links to other classes.
# NOT RUN {
showClass("TsparseMatrix")
## or just the subclasses' names
names(getClass("TsparseMatrix")@subclasses)
T3 <- spMatrix(3,4, i=c(1,3:1), j=c(2,4:2), x=1:4)
T3 # only 3 non-zero entries, 5 = 1+4 !
# }
Run the code above in your browser using DataLab