aboutsummaryrefslogtreecommitdiffstats
path: root/R/tests/test_lossdistrib.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/tests/test_lossdistrib.R')
-rw-r--r--R/tests/test_lossdistrib.R15
1 files changed, 15 insertions, 0 deletions
diff --git a/R/tests/test_lossdistrib.R b/R/tests/test_lossdistrib.R
new file mode 100644
index 00000000..34c7554c
--- /dev/null
+++ b/R/tests/test_lossdistrib.R
@@ -0,0 +1,15 @@
+library(lossdistrib)
+p <- runif(1000)
+S <- runif(1000)
+w <- rep(1/10000,10000)
+
+run1 <- system.time(for(i in 1:1000){
+ lossdistC(p, w, S, 301)
+})
+cat("simple lossdist", run1["elapsed"], "\n")
+
+run2 <- system.time(for(i in 1:1000){
+ lossdistCblas(p, w, S, 301)
+})
+# the blas function should be roughly twice as fast
+cat("blas lossdist", run2["elapsed"], "\n")