diagv: Matrix product with a diagonal matrix

Description Usage Arguments Details Value See Also Examples

Description

Computes faster the product of a diagonal matrix times a full matrix.

Usage

1
diagv(v, M)

Arguments

v

A numeric vector specifying the elements on the diagonal of a matrix.

M

A numeric matrix compatible with the product D_v M.

Details

Computes N = D_v M where D_v is diagonal avoiding the diag operator.

Value

A matrix N.

See Also

diag

Examples

1
2
3
v <- 1:1000
M <- matrix(runif(3000), 1000, 3)
dim(diagv(v, M))

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to diagv in ggm...