tests/test-dist.R

library(supc)
supc:::.set_num_threads(2)
set.seed(1)
x <- matrix(0, 20, 20)
x[] <- rnorm(length(x))
system.time(d1 <- supc:::.test.dist(x))
system.time(d2 <- stats::dist(x))
max(abs(d1 - d2)) < sqrt(.Machine$double.eps)


x <- matrix(0, 200, 2000)
x[] <- rnorm(length(x))
system.time(d1 <- supc:::.test.dist(x))
system.time(d2 <- stats::dist(x))
max(abs(d1 - d2)) < sqrt(.Machine$double.eps)

Try the supc package in your browser

Any scripts or data that you put into this service are public.

supc documentation built on Dec. 11, 2021, 5:07 p.m.