[Rcpp-commits] r3177 - pkg/Rcpp/inst/examples/Misc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 24 00:18:04 CEST 2011


Author: edd
Date: 2011-08-24 00:18:04 +0200 (Wed, 24 Aug 2011)
New Revision: 3177

Modified:
   pkg/Rcpp/inst/examples/Misc/ifelseLooped.r
Log:
fix identical() over group think with switch to sapply()


Modified: pkg/Rcpp/inst/examples/Misc/ifelseLooped.r
===================================================================
--- pkg/Rcpp/inst/examples/Misc/ifelseLooped.r	2011-08-23 19:24:51 UTC (rev 3176)
+++ pkg/Rcpp/inst/examples/Misc/ifelseLooped.r	2011-08-23 22:18:04 UTC (rev 3177)
@@ -48,7 +48,8 @@
 
 
 z <- rep(c(1,1,0,0,0,0), 100)
-identical(fun1(z),fun2(z),fun1c(z),fun2c(z),funRcpp(z))
+## test all others against fun1 and make sure all are identical
+all(sapply(list(fun2(z),fun1c(z),fun2c(z),funRcpp(z)), identical, fun1(z)))
 
 res <- benchmark(fun1(z), fun2(z),
                  fun1c(z), fun2c(z),



More information about the Rcpp-commits mailing list