Computes element-wise multiplication of two sparse_numeric vectors.

sparse_mult(x, y, ...)

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

Arguments

x

A sparse_numeric object.

y

A sparse_numeric object of the same length as x.

...

Additional arguments.

Value

A sparse_numeric object representing the element-wise 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_mult(x, y)
#> sparse_numeric object of length 6 
#> Non-zero elements:
#>   pos value
#> 1   5     8