Learn R Programming

rkeops (version 2.2.2)

weightedsqnorm: Generic weighted squared Euclidean norm

Description

Symbolic weighted squared norm of a LazyTensor binary operation for LazyTensor objects.

Usage

weightedsqnorm(x, s)

Value

An object of class LazyTensor.

Arguments

x

a vector of numeric values or a scalar value.

s

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

Author

Chloe Serre-Combe, Amelie Vernay

Details

weightedsqnorm(x, s) returns a LazyTensor that encodes, symbolically, the weighted squared norm of a vector x with weights stored in the LazyTensor s.

Note: x, and s should have the same inner dimension.

Note: Run browseVignettes("rkeops") to access the vignettes and find details about this function in the "RKeOps LazyTensor" vignette, at section "Simple vector operations".

See Also

sqnorm2(), weightedsqdist()

Examples

Run this code
if (FALSE) {
x <- matrix(runif(100 * 3), 100, 3) # arbitrary R matrix, 100 rows, 3 columns
s <- matrix(runif(100 * 3), 100, 3) # arbitrary R matrix, 100 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'
s_j <- LazyTensor(s, index = 'j')   # creating LazyTensor from matrix s, 
                                    # indexed by 'j'
wsqn_xy <- weightedsqnorm(x_i, s_j) # symbolic matrix, 100 rows,1 columns
}

Run the code above in your browser using DataLab