multd {exvatools} | R Documentation |
Multiply a matrix by a diagonal matrix
Description
Fast multiplication of a matrix by a diagonal matrix, taking advantage of the properties of diagonal matrices.
Usage
multd(matrix1, matrix2)
Arguments
matrix1 |
An ordinary matrix. |
matrix2 |
A diagonal matrix. |
Details
multd()
will turn matrix2
into a vector and multiply it
horizontally by every row in matrix1
. This saves precious computing
time.\
The number of columns of matrix1
must be equal to the rows and
columns of diagonal matrix2
.
Value
The product of matrix1 and matrix2.
See Also
Examples
wio <- make_wio("wiodtest")
multd(wio$B, wio$E)
[Package exvatools version 0.8.0 Index]