ldiMatrix-class: Class "ldiMatrix" of Diagonal Logical Matrices

Description Objects from the Class Slots Extends See Also Examples

Description

The class "ldiMatrix" of logical diagonal matrices.

Objects from the Class

Objects can be created by calls of the form new("ldiMatrix", ...) but typically rather via Diagonal.

Slots

x:

"logical" vector.

diag:

"character" string, either "U" or "N", see ddiMatrix.

Dim,Dimnames:

matrix dimension and dimnames, see the Matrix class description.

Extends

Class "diagonalMatrix" and class "lMatrix", directly.

Class "sparseMatrix", by class "diagonalMatrix".

See Also

Classes ddiMatrix and diagonalMatrix; function Diagonal.

Examples

1
2
3
4
5
6
(lM <- Diagonal(x = c(TRUE,FALSE,FALSE)))
str(lM)#> gory details (slots)

crossprod(lM) # numeric
(nM <- as(lM, "nMatrix"))# -> sparse (not formally ``diagonal'')
crossprod(nM) # logical sparse

Matrix documentation built on May 31, 2017, 1:41 a.m.

Search within the Matrix package
Search all R packages, documentation and source code