[Rcpp-commits] r3092 - scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 17 04:13:15 CEST 2011


Author: edd
Date: 2011-06-17 04:13:13 +0200 (Fri, 17 Jun 2011)
New Revision: 3092

Added:
   scripts/lmBench.R
Log:
added simplified lmBench.r

Added: scripts/lmBench.R
===================================================================
--- scripts/lmBench.R	                        (rev 0)
+++ scripts/lmBench.R	2011-06-17 02:13:13 UTC (rev 3092)
@@ -0,0 +1,27 @@
+#!/usr/bin/r
+
+suppressMessages({
+    library(utils)
+    library(methods)
+    library(RcppEigen)
+    library(RcppArmadillo)
+    library(RcppGSL)
+    library(rbenchmark)
+})
+
+set.seed(1)
+N <- 100
+p <- 9
+mm <- cbind(1, matrix(rnorm(N * p), nc = p))
+y <- rnorm(N)
+res <- benchmark(RRchol = .Call("fastLmChol2", mm, y, PACKAGE="RcppEigen"),
+                 NRchol = .Call("fastLmChol1", mm, y, PACKAGE="RcppEigen"),
+                 NReigen = .Call("fastLmBench", mm, y, PACKAGE="RcppEigen"),
+                 RReigen = .Call("fastLm", mm, y, PACKAGE="RcppEigen"),
+                 NRarma = .Call("fastLm", mm, y, PACKAGE="RcppArmadillo"),
+                 lmFit = lm.fit(mm, y),
+                 NRGSL = .Call("fastLm", mm, y, PACKAGE="RcppGSL"),
+                 columns=c("test", "elapsed", "relative", "user.self", "sys.self"),
+                 order="elapsed",
+                 replications=1000)
+print(res)



More information about the Rcpp-commits mailing list