
Calculate sqrt of sparse vectors
sparse_sqrt(x)
A sparse double vector.
A sparse numeric vector.
This function, as with any of the other helper functions assumes that the
input x
is a sparse numeric vector. This is done for performance reasons,
and it is thus the users responsibility to perform input checking.
The output will be a double vector regardless of the input type.
sparse_sqrt(
sparse_double(1000, 1, 10)
)
sparse_sqrt(
sparse_integer(1000, 3, 10, default = 2)
)
sparse_sqrt(
sparse_double(c(10, NA, 11), c(1, 5, 10), 10)
)
Run the code above in your browser using DataLab