dmult: Multiply a diagonal matrix by another matrix
Description
Fast multiplication of a diagonal matrix by another matrix, taking
taking advantage of the properties of diagonal matrices.
Usage
dmult(matrix1, matrix2)
Value
Product of matrix1 and matrix2.
Arguments
matrix1
A diagonal matrix.
matrix2
An ordinary matrix.
Details
dmult() will turn matrix1 into a vector and multiply it
horizontally by every rows in matrix2. This saves precious computing
time.\
The number of rows and columns of the diagonal matrix1 must be
equal to the number of rows of matrix1.