| nMatrix-class {Matrix} | R Documentation |
The lMatrix class is the virtual “mother” class of all
non-zero pattern matrices in the Matrix package.
Common to all matrix object in the package:
Dim:"integer" - the dimensions
of the matrix - must be an integer vector with exactly two
non-negative values.Dimnames:character vector length
equal the corresponding Dim element.
There is a bunch of coercion methods (for as(..)), e.g.,
signature(from = "nMatrix", to = "matrix"): ... signature(from = "nMatrix", to = "dMatrix"): ... signature(from = "nMatrix", to = "lMatrix"): ... signature(from = "matrix", to = "nMatrix"): ... signature(from = "dMatrix", to = "nMatrix"): ... signature(from = "lMatrix", to = "nMatrix"): ...
The classes lMatrix, and the mother class',
Matrix.
showClass("nMatrix")
L3 <- Matrix(upper.tri(diag(3)))
L3 # an "ltCMatrix"
as(L3, "nMatrix") # -> ntC*
## similar, not using Matrix()
as(upper.tri(diag(3)), "nMatrix")# currently "ngTMatrix"