gmatTimesDiagVec: Multiply a matrix times the 'diag' of a vector quickly.

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/04operations.R

Description

This function calculates A %*% diag(v). It is much faster than the direct calculation as it avoids the huge matrix multiplication problem.

Usage

1

Arguments

A

An object of class gmatrix or 'matrix'.

v

An object of class 'gvecotr' or a 'vector'.

Value

Returns a gmatrix

Note

Note that to calculate the diag(v) %*% A one may use the efficient formula v*A.

Author(s)

Nathan Morris

See Also

diag

Examples

1
2
3
v=grnorm(10)
A=gmatrix(grnorm(100),10,10,dup=FALSE)
gmatTimesDiagVec(A, v)

njm18/gmatrix documentation built on May 23, 2019, 7:07 p.m.