[Rcpp-commits] r3109 - pkg/RcppEigen/inst/examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 28 18:36:40 CEST 2011


Author: dmbates
Date: 2011-06-28 18:36:40 +0200 (Tue, 28 Jun 2011)
New Revision: 3109

Modified:
   pkg/RcppEigen/inst/examples/lmBenchmark.R
Log:
Print the results from do_bench() so echo=TRUE is not needed when sourcing; add a suppressSVD argument to do_bench().


Modified: pkg/RcppEigen/inst/examples/lmBenchmark.R
===================================================================
--- pkg/RcppEigen/inst/examples/lmBenchmark.R	2011-06-27 22:13:03 UTC (rev 3108)
+++ pkg/RcppEigen/inst/examples/lmBenchmark.R	2011-06-28 16:36:40 UTC (rev 3109)
@@ -42,9 +42,10 @@
     exprs$GSL <- expression(.Call("fastLm", mm, y, PACKAGE="RcppGSL"))
 }
 
-do_bench <- function(n=100000L, p=40L, nrep=20L) {
+do_bench <- function(n=100000L, p=40L, nrep=20L, suppressSVD=(n > 100000L)) {
     mm <- cbind(1, matrix(rnorm(n * (p - 1L)), nc=p-1L))
     y <- rnorm(n)
+    if (suppressSVD) exprs <- exprs[!names(exprs) %in% c("SVD", "GSL")]
     cat(paste("lm benchmark for n = ", n, " and p = ", p, ": nrep = ",
               nrep, "\n", sep=''))
     do.call(benchmark, c(exprs,
@@ -54,4 +55,4 @@
                               replications = nrep)))
 }
 
-do_bench()
+print(do_bench())



More information about the Rcpp-commits mailing list