[Rcpp-commits] r3771 - in pkg/Rcpp/inst: . unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 16 15:51:22 CEST 2012


Author: edd
Date: 2012-09-16 15:51:22 +0200 (Sun, 16 Sep 2012)
New Revision: 3771

Modified:
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/unitTests/runit.sugarOps.R
Log:
updated NEWS.Rd to note conversion
another sugar ops test not committed last time


Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2012-09-16 13:47:40 UTC (rev 3770)
+++ pkg/Rcpp/inst/NEWS.Rd	2012-09-16 13:51:22 UTC (rev 3771)
@@ -1,15 +1,18 @@
 \name{NEWS}
 \title{News for Package 'Rcpp'}
+\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
+
 \section{Changes in Rcpp version 0.9.14 (2012-xx-yy)}{
   \itemize{
     \item Added new Rcpp sugar functions trunc(), round() and signif(), as well
-             as unit tests for them
+    as unit tests for them
     \item Be more conservative about where we support clang++ and the inclusion
-             of exception_defines.h and prevent this from being attempted on OS X
-             where it failed for clang 3.1
-    \item Corrected a typo in Module.h who now again permits use of finalizers
+    of exception_defines.h and prevent this from being attempted on OS X
+    where it failed for clang 3.1
+    \item Corrected a typo in Module.h which now again permits use of finalizers
     \item Small correction for (unexported) bib() function (which provides a path
-             to the bibtex file that ships with Rcpp)
+    to the bibtex file that ships with Rcpp)
+    \item Converted NEWS to NEWS.Rd
   }
 }
 \section{Changes in Rcpp version 0.9.13 (2012-06-28)}{

Modified: pkg/Rcpp/inst/unitTests/runit.sugarOps.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugarOps.R	2012-09-16 13:47:40 UTC (rev 3770)
+++ pkg/Rcpp/inst/unitTests/runit.sugarOps.R	2012-09-16 13:51:22 UTC (rev 3771)
@@ -56,6 +56,21 @@
 			'
         		)
 
+        ,
+    	"vector_vector_logical" = list(signature(x = "numeric", y="numeric"),
+    			'
+			NumericVector xx(x);
+			NumericVector yy(y);
+			LogicalVector y1 = xx < yy;
+			LogicalVector y2 = xx > yy;
+			LogicalVector y3 = xx <= yy;
+			LogicalVector y4 = xx >= yy;
+			LogicalVector y5 = xx == yy;
+			LogicalVector y6 = xx != yy;
+			return List::create(y1, y2, y3, y4, y5, y6);
+			'
+        		)
+
         ## ,
     	## "matrix_plus" = list(signature(x = "numeric"),
 	## 		'
@@ -84,7 +99,7 @@
 test.vector.scalar.logical <- function( ){
     fx <- .rcpp.sugarOps$vector_scalar_logical
     x <- rnorm(10) + 2
-    checkEquals(fx(x), list(x < 2, 2 > x, x <= 2, 2 != x), "sugar vector scalara logical operations")
+    checkEquals(fx(x), list(x < 2, 2 > x, x <= 2, 2 != x), "sugar vector scalar logical operations")
 }
 
 test.vector.vector.ops <- function( ){
@@ -94,6 +109,13 @@
     checkEquals(fx(x,y), list(x + y, y - x, x * y, y / x), "sugar vector vector operations")
 }
 
+test.vector.vector.logical <- function( ){
+    fx <- .rcpp.sugarOps$vector_vector_logical
+    x <- rnorm(10)
+    y <- runif(10)
+    checkEquals(fx(x,y), list(x < y, x > y, x <= y, x >= y, x == y, x != y), "sugar vector vector operations")
+}
+
 ## test.matrix.plus <- function( ){
 ##     fx <- .rcpp.sugarOps$matrix_plus
 ##     x <- matrix(rnorm(10), 5, 2)



More information about the Rcpp-commits mailing list