[Rcpp-commits] r1539 - pkg/Rcpp/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 14 19:25:39 CEST 2010


Author: romain
Date: 2010-06-14 19:25:39 +0200 (Mon, 14 Jun 2010)
New Revision: 1539

Added:
   pkg/Rcpp/inst/unitTests/runit.sugar.any.R
Removed:
   pkg/Rcpp/inst/unitTests/runit.sugar.R
Log:
rename file

Deleted: pkg/Rcpp/inst/unitTests/runit.sugar.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.R	2010-06-14 17:24:50 UTC (rev 1538)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.R	2010-06-14 17:25:39 UTC (rev 1539)
@@ -1,132 +0,0 @@
-#!/usr/bin/r -t
-#
-# Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
-#
-# This file is part of Rcpp.
-#
-# Rcpp is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# Rcpp is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
-
-test.sugar.any.less <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx < yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( ! fx( 1, 0 ) )
-	checkTrue( fx( 1:10, 2:11 ) )
-	checkTrue( fx( 0, 1 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-
-test.sugar.any.greater <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx > yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( fx( 1, 0 ) )
-	checkTrue( fx( 2:11, 1:10 ) )
-	checkTrue( ! fx( 0, 1 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-
-test.sugar.any.less.or.equal <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx <= yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( fx( 1, 1 ) )
-	checkTrue( fx( 1:2, c(1,1) ) )
-	checkTrue( fx( 0, 1 ) )
-	checkTrue( ! fx( 1, 0 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-
-test.sugar.any.greater.or.equal <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx >= yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( fx( 1, 1 ) )
-	checkTrue( fx( 1:2, c(1,1) ) )
-	checkTrue( ! fx( 0, 1 ) )
-	checkTrue( fx( 1, 0 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-
-
-test.sugar.any.equal <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx == yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( fx( 1, 1 ) )
-	checkTrue( fx( 1:2, c(1,1) ) )
-	checkTrue( ! fx( 0, 1 ) )
-	checkTrue( ! fx( 1, 0 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-
-test.sugar.any.not.equal <- function( ){
-
-	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
-	
-		NumericVector xx(x) ;
-		NumericVector yy(y) ;
-		
-		return any( xx != yy ) ;
-	
-	', plugin = "Rcpp" )
-	
-	checkTrue( ! fx( 1, 1 ) )
-	checkTrue( fx( 1:2, c(1,1) ) )
-	checkTrue( fx( 0, 1 ) )
-	checkTrue( fx( 1, 0 ) )
-	checkTrue( is.na( fx( NA, 1 ) ) )
-	
-}
-

Copied: pkg/Rcpp/inst/unitTests/runit.sugar.any.R (from rev 1534, pkg/Rcpp/inst/unitTests/runit.sugar.R)
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.any.R	                        (rev 0)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.any.R	2010-06-14 17:25:39 UTC (rev 1539)
@@ -0,0 +1,132 @@
+#!/usr/bin/r -t
+#
+# Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+#
+# This file is part of Rcpp.
+#
+# Rcpp is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# Rcpp is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+test.sugar.any.less <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx < yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( ! fx( 1, 0 ) )
+	checkTrue( fx( 1:10, 2:11 ) )
+	checkTrue( fx( 0, 1 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+
+test.sugar.any.greater <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx > yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( fx( 1, 0 ) )
+	checkTrue( fx( 2:11, 1:10 ) )
+	checkTrue( ! fx( 0, 1 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+
+test.sugar.any.less.or.equal <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx <= yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( fx( 1, 1 ) )
+	checkTrue( fx( 1:2, c(1,1) ) )
+	checkTrue( fx( 0, 1 ) )
+	checkTrue( ! fx( 1, 0 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+
+test.sugar.any.greater.or.equal <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx >= yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( fx( 1, 1 ) )
+	checkTrue( fx( 1:2, c(1,1) ) )
+	checkTrue( ! fx( 0, 1 ) )
+	checkTrue( fx( 1, 0 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+
+
+test.sugar.any.equal <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx == yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( fx( 1, 1 ) )
+	checkTrue( fx( 1:2, c(1,1) ) )
+	checkTrue( ! fx( 0, 1 ) )
+	checkTrue( ! fx( 1, 0 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+
+test.sugar.any.not.equal <- function( ){
+
+	fx <- cxxfunction( signature( x = "numeric", y = "numeric" ), '
+	
+		NumericVector xx(x) ;
+		NumericVector yy(y) ;
+		
+		return any( xx != yy ) ;
+	
+	', plugin = "Rcpp" )
+	
+	checkTrue( ! fx( 1, 1 ) )
+	checkTrue( fx( 1:2, c(1,1) ) )
+	checkTrue( fx( 0, 1 ) )
+	checkTrue( fx( 1, 0 ) )
+	checkTrue( is.na( fx( NA, 1 ) ) )
+	
+}
+



More information about the Rcpp-commits mailing list