diagv | R Documentation |
Computes faster the product of a diagonal matrix times a full matrix.
diagv(v, M)
v |
A numeric vector specifying the elements on the diagonal of a matrix. |
M |
A numeric matrix compatible with the product |
Computes N = D_v M
where D_v
is diagonal
avoiding the diag
operator.
A matrix N
.
diag
v <- 1:1000
M <- matrix(runif(3000), 1000, 3)
dim(diagv(v, M))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.