[Rcpp-commits] r1307 - in pkg/RcppExamples: inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 25 09:49:21 CEST 2010


Author: romain
Date: 2010-05-25 09:49:20 +0200 (Tue, 25 May 2010)
New Revision: 1307

Modified:
   pkg/RcppExamples/inst/ChangeLog
   pkg/RcppExamples/src/RcppMatrixExample.cpp
   pkg/RcppExamples/src/RcppStringVectorExample.cpp
   pkg/RcppExamples/src/RcppVectorExample.cpp
Log:
use BEGIN_RCPP / END_RCPP 

Modified: pkg/RcppExamples/inst/ChangeLog
===================================================================
--- pkg/RcppExamples/inst/ChangeLog	2010-05-24 21:28:40 UTC (rev 1306)
+++ pkg/RcppExamples/inst/ChangeLog	2010-05-25 07:49:20 UTC (rev 1307)
@@ -1,3 +1,7 @@
+2010-05-25  Romain Francois <romain at r-enthusiasts.com
+
+	* src/*.cpp: use BEGIN_RCPP/END_RCPP in new api examples
+
 2010-03-10  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.1.0 for the first CRAN upload

Modified: pkg/RcppExamples/src/RcppMatrixExample.cpp
===================================================================
--- pkg/RcppExamples/src/RcppMatrixExample.cpp	2010-05-24 21:28:40 UTC (rev 1306)
+++ pkg/RcppExamples/src/RcppMatrixExample.cpp	2010-05-25 07:49:20 UTC (rev 1307)
@@ -25,6 +25,7 @@
 #include <cmath>
 
 RcppExport SEXP newRcppMatrixExample(SEXP matrix) {
+BEGIN_RCPP
 
     Rcpp::NumericMatrix orig(matrix);	// creates Rcpp matrix from SEXP
     Rcpp::NumericMatrix mat(orig.nrow(), orig.ncol());	
@@ -39,6 +40,7 @@
                        Rcpp::Named( "original", orig));
 
     return res;
+END_RCPP
 }
 
 RcppExport SEXP classicRcppMatrixExample(SEXP matrix) {

Modified: pkg/RcppExamples/src/RcppStringVectorExample.cpp
===================================================================
--- pkg/RcppExamples/src/RcppStringVectorExample.cpp	2010-05-24 21:28:40 UTC (rev 1306)
+++ pkg/RcppExamples/src/RcppStringVectorExample.cpp	2010-05-25 07:49:20 UTC (rev 1307)
@@ -24,6 +24,7 @@
 #include <Rcpp.h>
 
 RcppExport SEXP newRcppStringVectorExample(SEXP strvec) {
+BEGIN_RCPP
 
     Rcpp::StringVector orig(strvec);		// creates Rcpp string vector from SEXP
     Rcpp::StringVector vec(orig.size());	
@@ -36,6 +37,8 @@
     	Rcpp::Named( "original" ) = orig ) ;
 
     return res;
+
+END_RCPP
 }
 
 RcppExport SEXP classicRcppStringVectorExample(SEXP strvec) {

Modified: pkg/RcppExamples/src/RcppVectorExample.cpp
===================================================================
--- pkg/RcppExamples/src/RcppVectorExample.cpp	2010-05-24 21:28:40 UTC (rev 1306)
+++ pkg/RcppExamples/src/RcppVectorExample.cpp	2010-05-25 07:49:20 UTC (rev 1307)
@@ -25,6 +25,7 @@
 #include <cmath>
 
 RcppExport SEXP newRcppVectorExample(SEXP vector) {
+BEGIN_RCPP
 
     Rcpp::NumericVector orig(vector);			// keep a copy (as the classic version does)
     Rcpp::NumericVector vec(orig.size());		// create a target vector of the same size
@@ -39,6 +40,8 @@
                        Rcpp::Named( "original", orig));
 
     return res;
+
+END_RCPP
 }
 
 RcppExport SEXP classicRcppVectorExample(SEXP vector) {



More information about the Rcpp-commits mailing list