dmult: Multiply a diagonal matrix by another matrix

View source: R/matrix_mult.R

dmultR Documentation

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)

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.

Value

Product of matrix1 and matrix2.

See Also

multd().

Examples

wio <- make_wio("wiodtest")
dmult(wio$W, wio$Bd)

exvatools documentation built on May 29, 2024, 6:46 a.m.