Symbolic squared Euclidean distance binary operation for LazyTensor
objects.
Arguments
- x
a
LazyTensor
, aComplexLazyTensor
, a vector of numeric values, or a scalar value.- y
a
LazyTensor
, aComplexLazyTensor
, a vector of numeric values, or a scalar value.
Details
sqdist(x)
returns a LazyTensor
that encodes, symbolically,
the squared Euclidean distance between x
and y
, same as sqnorm2(x - y)
.
Note: x
and y
input arguments should have the same inner dimension
or be of dimension 1.
Examples
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'
SqD_x <- sqdist(x_i) # symbolic matrix, 150 rows and 3 columns
}