if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # creating LazyTensor from matrix x,
# indexed by 'i'
una_x <- unaryop.LazyTensor(x_i, "Minus") # symbolic matrix
una2_x <- unaryop.LazyTensor(x_i, "Pow", opt_arg = 3) # symbolic matrix
# example with not NA dim_res:
## set dim_res to 1 because the "Norm2" operation results on a (symbolic) scalar
una3_x <- unaryop.LazyTensor(x, "Norm2",
res_type = "LazyTensor",
dim_res = 1)
}
Run the code above in your browser using DataLab