
Multiplies two numeric
or character
matrices, if they are conformable. If one argument is a vector, it will be promoted to either a row or column matrix to make the two arguments conformable. If both are vectors of the same length, it will return the inner product (as a matrix
).
mx(x, y)x %mx% y
numeric
or character
matrix.
numeric
or character
matrix.
matrix
.
%mx%
: binary operator.
Guidotti, E. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086
# NOT RUN {
### numeric inner product
x <- 1:4
mx(x, x)
### symbolic inner product
x <- letters[1:4]
mx(x, x)
### numeric matrix product
x <- letters[1:4]
y <- diag(4)
mx(x, y)
### symbolic matrix product
x <- array(1:12, dim = c(3,4))
y <- letters[1:4]
mx(x, y)
### binary operator
x <- array(1:12, dim = c(3,4))
y <- letters[1:4]
x %mx% y
# }
Run the code above in your browser using DataLab