Description Usage Arguments Details Methods References Examples
Estimate the determinant of a matrix using the MAGMA library for GPU or PLASMA library for multi-core CPUs.
1 2 3 4 | ## S4 method for signature 'dgeMatrix'
determinant(x, logarithm, ...)
## S4 method for signature 'dgeMatrix'
determinant(x, logarithm, ...)
|
x |
an R object of type |
logarithm |
logical; if |
... |
No further arguments at present. |
Uses the LU decomposition using magma_dgetrf
or
PLASMA_dgetrf
.For further details
and methods see the Matrix package documentation
or indeed the base package.
signature(x = "Matrix", logarithm = "missing")
: and
signature(x = "Matrix", logarithm = "logical")
:compute the (\log) determinant of x
.
The method chosen depends on the actual Matrix class of x
.
Note that base::det
also works for all our matrices, calling the appropriate determinant()
method.
The Matrix::det
is an exact copy of base::det
, but in the correct namespace, and hence calling the S4-aware version of
determinant()
.
Martin Maechler, Douglas Bates (Matrix package)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | slotNames("Matrix")
cl <- getClass("Matrix")
names(cl@subclasses) # more than 40 ..
showClass("Matrix")#> output with slots and all subclasses
(M <- Matrix(c(0,1,0,0), 6, 4))
dim(M)
diag(M)
cm <- M[1:4,] + 10*Diagonal(4)
diff(M)
## can reshape it even :
dim(M) <- c(2, 12)
M
stopifnot(identical(M, Matrix(c(0,1,0,0), 2,12)),all.equal(det(cm),
determinant(as(cm,"matrix"), log=FALSE)$modulus, check.attr=FALSE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.