Matrix-vector product for LazyTensor
objects.
Arguments
- m
a
LazyTensor
or aComplexLazyTensor
encoding a matrix.- v
a
LazyTensor
or aComplexLazyTensor
encoding a parameter vector.
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.
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
}