### 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