if (FALSE) {
x <- matrix(c(1, 2, 3), 2, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # LazyTensor from matrix x, indexed by 'i'
y <- matrix(c(1, 1, 1), 2, 3) # arbitrary R matrix, 200 rows, 3 columns
y_i <- LazyTensor(y, index = 'i') # LazyTensor from matrix y, indexed by 'i'
tp_xy <- tensorprod(x_i, y_i) # symbolic (4, 9) matrix.
}
Run the code above in your browser using DataLab