Symbolic element extraction operation for LazyTensor objects.
Arguments
- x
a
LazyTensoror aComplexLazyTensor.- m
an
integercorresponding to the index (starting from 0) of the element ofxthat will be extracted.
Details
If x is a LazyTensor, elem(x, m) returns a LazyTensor that
encodes, symbolically, the m+1-th element of x, i.e. x[m+1] in
standard R notation.
IMPORTANT: IN THIS CASE, INDICES START AT ZERO, therefore, m should
be in [0, n), where n is the inner dimension of x.
Examples
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # LazyTensor from matrix x, indexed by 'i'
m <- 2
elem_x <- elem(x_i, m) # symbolic `m+1`-th element of `x_i`.
}