Computes the cross product of two sparse_numeric vectors.

sparse_crossprod(x, y, ...)

# S4 method for class 'sparse_numeric,sparse_numeric'
sparse_crossprod(x, y, ...)

Arguments

x

A sparse_numeric object.

y

A sparse_numeric object of the same length as x.

...

Additional arguments (not used).

Value

A numeric scalar representing the cross product of x and y.

Examples

x <- new("sparse_numeric", value = c(1,2), pos = c(2L,5L), length = 6L)
y <- new("sparse_numeric", value = c(3,4), pos = c(1L,5L), length = 6L)
sparse_crossprod(x, y)
#> [1] 8