[Rcpp-commits] r2237 - papers/rjournal

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 29 00:52:26 CEST 2010


Author: edd
Date: 2010-09-29 00:52:26 +0200 (Wed, 29 Sep 2010)
New Revision: 2237

Modified:
   papers/rjournal/EddelbuettelFrancois.tex
Log:
add Rcpp:: prefixes in two Perf Comp examples


Modified: papers/rjournal/EddelbuettelFrancois.tex
===================================================================
--- papers/rjournal/EddelbuettelFrancois.tex	2010-09-28 22:40:13 UTC (rev 2236)
+++ papers/rjournal/EddelbuettelFrancois.tex	2010-09-28 22:52:26 UTC (rev 2237)
@@ -747,11 +747,11 @@
 #include <Rcpp.h>
 
 RcppExport SEXP convolve4cpp(SEXP a, SEXP b)\{
-    NumericVector xa(a), xb(b);
+    Rcpp::NumericVector xa(a), xb(b);
     int n_xa = xa.size(), n_xb = xb.size();
-    NumericVector xab(n_xa + n_xb - 1);
+    Rcpp::NumericVector xab(n_xa + n_xb - 1);
     
-    typedef NumericVector::iterator 
+    typedef Rcpp::NumericVector::iterator 
         vec_iterator;
     vec_iterator ia = xa.begin(), 
                  ib = xb.begin();
@@ -773,13 +773,15 @@
 #include <Rcpp.h>
 
 RcppExport SEXP convolve11cpp(SEXP a, SEXP b) \{
-    NumericVector xa(a); int n_xa = xa.size();
-    NumericVector xb(b); int n_xb = xb.size();
-    NumericVector xab(n_xa + n_xb - 1,0.0);
+    Rcpp::NumericVector xa(a); 
+    Rcpp::NumericVector xb(b); 
+    int n_xa = xa.size(), n_xb = xb.size();
+    Rcpp::NumericVector xab(n_xa+n_xb-1,0.0);
     
-    Range r( 0, n_xb-1 );
+    Rcpp::Range r( 0, n_xb-1 );
     for (int i=0; i<n_xa; i++, r++)
-        xab[ r ] += nona(xa[i]) * nona(xb);
+        xab[ r ] += Rcpp::nona(xa[i]) 
+                    * Rcpp::nona(xb);
     return xab ;
 \}
 \end{example}



More information about the Rcpp-commits mailing list