dtRMatrix-class-sparse.Rd
The dtRMatrix
class is a class of triangular, sparse
matrices in the compressed, row-oriented format. In this
implementation the non-zero elements in the rows are sorted into
increasing columnd order.
This class is currently still mostly unimplemented!
Objects can be created by calls of the form new("dtRMatrix", ...)
.
uplo
:Object of class "character"
. Must be
either "U", for upper triangular, and "L", for lower triangular.
At present only the lower triangle form is allowed.
diag
:Object of class "character"
. Must be
either "U"
, for unit triangular (diagonal is all ones), or
"N"
; see triangularMatrix
.
j
:Object of class "integer"
of length
nnzero(.)
(number of non-zero elements). These are
the row numbers for each non-zero element in the matrix.
p
:Object of class "integer"
of pointers, one
for each row, to the initial (zero-based) index of elements in
the row. (Only present in the dsRMatrix
class.)
x
:Object of class "numeric"
- the non-zero
elements of the matrix.
Dim
:The dimension (a length-2 "integer"
)
Dimnames
:corresponding names (or NULL
),
inherited from the Matrix
, see there.
Class "dgRMatrix"
, directly.
Class "dsparseMatrix"
, by class "dgRMatrix"
.
Class "dMatrix"
, by class "dgRMatrix"
.
Class "sparseMatrix"
, by class "dgRMatrix"
.
Class "Matrix"
, by class "dgRMatrix"
.
No methods currently with class "dsRMatrix" in the signature.
(m0 <- new("dtRMatrix"))
#> 0 x 0 sparse Matrix of class "dtRMatrix"
#> <0 x 0 matrix>
(m2 <- new("dtRMatrix", Dim = c(2L,2L),
x = c(5, 1:2), p = c(0L,2:3), j= c(0:1,1L)))
#> 2 x 2 sparse Matrix of class "dtRMatrix"
#>
#> [1,] 5 1
#> [2,] . 2
str(m2)
#> Formal class 'dtRMatrix' [package "Matrix"] with 7 slots
#> ..@ p : int [1:3] 0 2 3
#> ..@ j : int [1:3] 0 1 1
#> ..@ Dim : int [1:2] 2 2
#> ..@ Dimnames:List of 2
#> .. ..$ : NULL
#> .. ..$ : NULL
#> ..@ x : num [1:3] 5 1 2
#> ..@ uplo : chr "U"
#> ..@ diag : chr "N"
(m3 <- as(Diagonal(2), "RsparseMatrix"))# --> dtRMatrix
#> 2 x 2 sparse Matrix of class "dtRMatrix" (unitriangular)
#>
#> [1,] I .
#> [2,] . I