
"dsyMatrix"
class is the class of symmetric, dense matrices
in non-packed storage and "dspMatrix"
is the class of symmetric
dense matrices in packed storage. Only the upper triangle or the
lower triangle is stored.new("dsyMatrix", ...)
."dsyMatrix"
extends class "dgeMatrix"
, directly, whereas
"dspMatrix"
extends class "ddenseMatrix"
, directly. Both extend class "symmetricMatrix"
, directly,
and class "Matrix"
and others, indirectly, use
showClass("dsyMatrix")
, e.g., for details.
dgeMatrix-class
, Matrix-class
,
solve
, norm
, rcond
,
t
## Only upper triangular part matters (when uplo == "U" as per default)
(sy2 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, NA,32,77)))
(c2 <- chol(sy2))
all.equal(c2, c2. <- chol(as(sy2, "dpoMatrix")))# equal, but not same class
str(c2)
## An example where chol() can't work
(sy3 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, -1, 2, -7)))
validObject(as(sy3, "dpoMatrix"), test=TRUE) # >> is not pos.def.
try(chol(sy3)) ## Error: not pos.def
Run the code above in your browser using DataLab