[Rcpp-commits] r2239 - in pkg/Rcpp/inst: examples/ConvolveBenchmarks include/Rcpp/sugar/nona

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 29 03:16:58 CEST 2010


Author: edd
Date: 2010-09-29 03:16:58 +0200 (Wed, 29 Sep 2010)
New Revision: 2239

Modified:
   pkg/Rcpp/inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp
   pkg/Rcpp/inst/examples/ConvolveBenchmarks/exampleRCode.r
   pkg/Rcpp/inst/include/Rcpp/sugar/nona/nona.h
Log:
nona() is now noNA()


Modified: pkg/Rcpp/inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp
===================================================================
--- pkg/Rcpp/inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp	2010-09-28 22:53:30 UTC (rev 2238)
+++ pkg/Rcpp/inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp	2010-09-29 01:16:58 UTC (rev 2239)
@@ -14,7 +14,7 @@
     
     Range r( 0, n_xb-1 );
     for(int i=0; i<n_xa; i++, r++){
-    	xab[ r ] += nona(xa[i]) * nona(xb) ;
+    	xab[ r ] += noNA(xa[i]) * noNA(xb) ;
     }
     return xab ;
 }

Modified: pkg/Rcpp/inst/examples/ConvolveBenchmarks/exampleRCode.r
===================================================================
--- pkg/Rcpp/inst/examples/ConvolveBenchmarks/exampleRCode.r	2010-09-28 22:53:30 UTC (rev 2238)
+++ pkg/Rcpp/inst/examples/ConvolveBenchmarks/exampleRCode.r	2010-09-29 01:16:58 UTC (rev 2239)
@@ -30,7 +30,7 @@
 #Rcpp_New_std_inside <- function(n,a,b) .Call("convolve3cpp__loop", n, a, b, PACKAGE = "Rcpp" )
 Rcpp_New_ptr <- function(n,a,b) .Call("convolve4cpp__loop", n, a, b)
 Rcpp_New_sugar <- function(n,a,b) .Call("convolve5cpp__loop", n, a, b)
-Rcpp_New_sugar_nona <- function(n,a,b) .Call("convolve11cpp__loop", n, a, b)
+Rcpp_New_sugar_noNA <- function(n,a,b) .Call("convolve11cpp__loop", n, a, b)
 R_API_naive <- function(n,a,b) .Call("convolve7__loop", n, a, b)
 Rcpp_New_std_2 <- function(n,a,b) .Call("convolve8cpp__loop", n, a, b)
 #Rcpp_New_std_3 <- function(n,a,b) .Call("convolve9cpp__loop", n, a, b)
@@ -45,7 +45,7 @@
 v4 <- Rcpp_New_ptr(1L, a, b)
 v5 <- Rcpp_New_sugar(1L, a, b )
 v7 <- R_API_naive(1L, a, b)
-v11 <- Rcpp_New_sugar_nona(1L, a, b)
+v11 <- Rcpp_New_sugar_noNA(1L, a, b)
 
 stopifnot(all.equal(v1, v2))
 stopifnot(all.equal(v1, v3))
@@ -64,7 +64,7 @@
 #                Rcpp_New_std_inside(REPS,a,b),
                 Rcpp_New_ptr(REPS,a,b),
                 Rcpp_New_sugar(REPS,a,b),
-                Rcpp_New_sugar_nona(REPS,a,b),
+                Rcpp_New_sugar_noNA(REPS,a,b),
                 Rcpp_New_std_2(REPS,a,b),
 #                Rcpp_New_std_3(REPS,a,b),
 #                Rcpp_New_std_4(REPS,a,b),
@@ -90,11 +90,11 @@
                 Rcpp_New_std(REPS,a,b),
                 Rcpp_New_ptr(REPS,a,b),
                 Rcpp_New_sugar(REPS,a,b),
-                Rcpp_New_sugar_nona(REPS,a,b),
+                Rcpp_New_sugar_noNA(REPS,a,b),
                 columns=c("test", "elapsed", "relative", "user.self", "sys.self"),
                 order="relative",
                 replications=1)
-     
+
      cat( "  done\n" )
      bm
 } )
@@ -102,7 +102,7 @@
     timings[[i]]$size <- sizes[i]
 }
 timings <- do.call( rbind, timings )
- 
+
 require( lattice )
 png( "elapsed.png", width = 800, height = 600 )
 xyplot( elapsed ~ size, groups = test, data = timings, auto.key = TRUE, type = "l", lwd = 2 )
@@ -110,4 +110,4 @@
 png( "relative.png", width = 800, height = 600 )
 xyplot( relative ~ size, groups = test, data = timings, auto.key = TRUE, type = "l", lwd = 2 )
 dev.off()
-   
+

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/nona/nona.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/nona/nona.h	2010-09-28 22:53:30 UTC (rev 2238)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/nona/nona.h	2010-09-29 01:16:58 UTC (rev 2239)
@@ -1,6 +1,6 @@
 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
 //
-// nona.h: Rcpp R/C++ interface class library -- 
+// nona.h: Rcpp R/C++ interface class library -- noNA handling
 //
 // Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
 //
@@ -71,14 +71,14 @@
 }
 
 template <int RTYPE, bool NA, typename VECTOR>
-inline sugar::Nona<RTYPE,NA,VECTOR> nona( const Rcpp::VectorBase<RTYPE,NA,VECTOR>& vec ){
+inline sugar::Nona<RTYPE,NA,VECTOR> noNA( const Rcpp::VectorBase<RTYPE,NA,VECTOR>& vec ){
     return sugar::Nona<RTYPE,NA,VECTOR>( vec ) ;
 }
 
-inline sugar::NonaPrimitive<double> nona( double x ){
+inline sugar::NonaPrimitive<double> noNA( double x ){
     return sugar::NonaPrimitive<double>( x ) ; 
 }
-inline sugar::NonaPrimitive<int> nona( int x ){
+inline sugar::NonaPrimitive<int> noNA( int x ){
     return sugar::NonaPrimitive<int>( x ) ; 
 }
 



More information about the Rcpp-commits mailing list