Symmetric Dense Logical Matrices
lsyMatrix-class.RdThe "lsyMatrix" class is the class of symmetric, dense logical
matrices in non-packed storage and "lspMatrix" is the class of
of these in packed storage. In the packed form, only the upper
triangle or the lower triangle is stored.
Slots
uplo:Object of class
"character". Must be either "U", for upper triangular, and "L", for lower triangular.x:Object of class
"logical". The logical values that constitute the matrix, stored in column-major order.Dim,Dimnames:The dimension (a length-2
"integer") and corresponding names (orNULL), see theMatrixclass.factors:Object of class
"list". A named list of factorizations that have been computed for the matrix.
Extends
Both extend classes "ldenseMatrix" and
"symmetricMatrix", directly; further, class
"Matrix" and others, indirectly. Use
showClass("lsyMatrix"), e.g., for details.
Methods
Currently, mainly t() and coercion methods (for
as(.); use, e.g.,
showMethods(class="lsyMatrix") for details.
Examples
(M2 <- Matrix(c(TRUE, NA, FALSE, FALSE), 2, 2)) # logical dense (ltr)
#> 2 x 2 Matrix of class "ltrMatrix"
#> [,1] [,2]
#> [1,] TRUE .
#> [2,] NA FALSE
str(M2)
#> Formal class 'ltrMatrix' [package "Matrix"] with 5 slots
#> ..@ Dim : int [1:2] 2 2
#> ..@ Dimnames:List of 2
#> .. ..$ : NULL
#> .. ..$ : NULL
#> ..@ x : logi [1:4] TRUE NA FALSE FALSE
#> ..@ uplo : chr "L"
#> ..@ diag : chr "N"
# can
(sM <- M2 | t(M2)) # "lge"
#> 2 x 2 Matrix of class "lgeMatrix"
#> [,1] [,2]
#> [1,] TRUE NA
#> [2,] NA FALSE
as(sM, "symmetricMatrix")
#> 2 x 2 Matrix of class "lsyMatrix"
#> [,1] [,2]
#> [1,] TRUE NA
#> [2,] NA FALSE
str(sM <- as(sM, "packedMatrix")) # packed symmetric
#> Formal class 'lspMatrix' [package "Matrix"] with 5 slots
#> ..@ uplo : chr "U"
#> ..@ Dim : int [1:2] 2 2
#> ..@ Dimnames:List of 2
#> .. ..$ : NULL
#> .. ..$ : NULL
#> ..@ x : logi [1:3] TRUE NA FALSE
#> ..@ factors : list()