Skip to contents

Symbolic squared Euclidean distance binary operation for LazyTensor objects.

Usage

sqdist(x, y)

Arguments

x

a LazyTensor, a ComplexLazyTensor, a vector of numeric values, or a scalar value.

y

a LazyTensor, a ComplexLazyTensor, a vector of numeric values, or a scalar value.

Value

An object of class LazyTensor.

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.

See also

Author

Chloe Serre-Combe, Amelie Vernay

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
}