"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.
Object of class
"integer" - the row indices
of non-zero entries in 0-base, i.e., must be in
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,
pairs can occur more than once, see
"Matrix", by class
"[") methods, see
Most operations with sparse matrices are performed using the
compressed, column-oriented or
representation. The triplet representation is convenient for
creating a sparse matrix or for reading and writing such
matrices. Once it is created, however, the matrix is generally
coerced to a
CsparseMatrix for further
Note that all
sparseMatrix(*, repr="T") constructors
"TsparseMatrix" classes implicitly add (i.e., “sum up”)
x_k's that belong to identical (i_k, j_k) pairs, see, the
example below, or also
For convenience, methods for some operations such as
crossprod are defined for
TsparseMatrix objects. These methods simply
TsparseMatrix object to a
CsparseMatrix object then perform the
sparseMatrix, and the
dgTMatrix class, for the links to other classes.
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 !
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.