Skip to contents

Matrix-vector product for LazyTensor objects.

Usage

matvecmult(m, v)

Arguments

m

a LazyTensor or a ComplexLazyTensor encoding a matrix.

v

a LazyTensor or a ComplexLazyTensor encoding a parameter vector.

Value

a LazyTensor or a ComplexLazyTensor.

Details

matvecmult(m, v) encodes, symbolically, the matrix-vector product of matrix m and vector v.

Note: m and v should have the same inner dimension or v should be of dimension 1.

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
m <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
v <- c(1,2,3)                       # arbitrary R vector of length 3
m_i <- LazyTensor(m, index = 'i')   # LazyTensor from matrix m, indexed by 'i'
Pm_v <- LazyTensor(v)               # parameter vector LazyTensor from v

mv_mult <- matvecmult(m_i, Pm_v)    # symbolic matrix
}