Main features:
Speed and multithreading
Most of the code is written in C++ for additional efficiency. We also use OpenMP to speedup computations with multithreading:
library(DepthProc)
set.seed(123)
d <- 10
x <- mvrnorm(1000, rep(0, d), diag(d))
# Default - utilize as many threads as possible
system.time(depth(x, x, method = "LP"))
#> user system elapsed
#> 0.351 0.000 0.090
# Only single thread - 4 times slower:
system.time(depth(x, x, method = "LP", threads = 1))
#> user system elapsed
#> 0.208 0.000 0.208
# Two threads - 2 times slower:
system.time(depth(x, x, method = "LP", threads = 2))
#> user system elapsed
#> 0.201 0.000 0.103