TsparseMatrix-class {Matrix} | R Documentation

## Class "TsparseMatrix" of Sparse Matrices in Triplet Form

### Description

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.

### Slots

`Dim`, `Dimnames`:

  from the `"Matrix"` class,

`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`.

### Extends

Class `"sparseMatrix"`, directly. Class `"Matrix"`, by class `"sparseMatrix"`.

### Methods

Extraction (`"["`) methods, see `[-methods`.

### Note

Most operations with sparse matrices are performed using the compressed, column-oriented or `CsparseMatrix` 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 operations.

For convenience, methods for some operations such as `%*%` and `crossprod` are defined for `TsparseMatrix` objects. These methods simply coerce the `TsparseMatrix` object to a `CsparseMatrix` object then perform the operation.

### See Also

its superclass, `sparseMatrix`, and the `dgTMatrix` class, for the links to other classes.

### Examples

    showClass("TsparseMatrix")
    ## or just the subclasses' names
    names(getClass("TsparseMatrix")@subclasses)

[Package Matrix version 1.0-9 Index]