[Rcpp-commits] r1839 - in pkg/Rcpp/inst/include/Rcpp: sugar/functions vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 8 15:39:53 CEST 2010


Author: romain
Date: 2010-07-08 15:39:53 +0200 (Thu, 08 Jul 2010)
New Revision: 1839

Modified:
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/lapply.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/sapply.h
   pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h
   pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
Log:
don't use invalid identifiers (with thanks to Simon)

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h	2010-07-08 13:35:09 UTC (rev 1838)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/is_na.h	2010-07-08 13:39:53 UTC (rev 1839)
@@ -25,11 +25,11 @@
 namespace Rcpp{
 namespace sugar{
 
-template <int RTYPE, bool _NA_, typename VEC_TYPE>
-class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,_NA_,VEC_TYPE> > {
+template <int RTYPE, bool NA, typename VEC_TYPE>
+class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,NA,VEC_TYPE> > {
 public:
 	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
-	typedef Rcpp::VectorBase<RTYPE,_NA_,VEC_TYPE> BASE ;
+	typedef Rcpp::VectorBase<RTYPE,NA,VEC_TYPE> BASE ;
 	
 	IsNa( const BASE& obj_) : obj(obj_){}
 	
@@ -69,9 +69,9 @@
 	
 } // sugar
 
-template <int RTYPE, bool _NA_, typename T>
-inline sugar::IsNa<RTYPE,_NA_,T> is_na( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
-	return sugar::IsNa<RTYPE,_NA_,T>( t ) ;
+template <int RTYPE, bool NA, typename T>
+inline sugar::IsNa<RTYPE,NA,T> is_na( const Rcpp::VectorBase<RTYPE,NA,T>& t){
+	return sugar::IsNa<RTYPE,NA,T>( t ) ;
 }
 
 } // Rcpp

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/functions/lapply.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/lapply.h	2010-07-08 13:35:09 UTC (rev 1838)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/lapply.h	2010-07-08 13:39:53 UTC (rev 1839)
@@ -50,10 +50,10 @@
 	
 } // sugar
 
-template <int RTYPE, bool _NA_, typename T, typename Function >
-inline sugar::Lapply<RTYPE,_NA_,T,Function> 
-lapply( const Rcpp::VectorBase<RTYPE,_NA_,T>& t, Function fun ){
-	return sugar::Lapply<RTYPE,_NA_,T,Function>( t, fun ) ;
+template <int RTYPE, bool NA, typename T, typename Function >
+inline sugar::Lapply<RTYPE,NA,T,Function> 
+lapply( const Rcpp::VectorBase<RTYPE,NA,T>& t, Function fun ){
+	return sugar::Lapply<RTYPE,NA,T,Function>( t, fun ) ;
 }
 
 } // Rcpp

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/functions/sapply.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/sapply.h	2010-07-08 13:35:09 UTC (rev 1838)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/sapply.h	2010-07-08 13:39:53 UTC (rev 1839)
@@ -56,10 +56,10 @@
 	
 } // sugar
 
-template <int RTYPE, bool _NA_, typename T, typename Function >
-inline sugar::Sapply<RTYPE,_NA_,T,Function> 
-sapply( const Rcpp::VectorBase<RTYPE,_NA_,T>& t, Function fun ){
-	return sugar::Sapply<RTYPE,_NA_,T,Function>( t, fun ) ;
+template <int RTYPE, bool NA, typename T, typename Function >
+inline sugar::Sapply<RTYPE,NA,T,Function> 
+sapply( const Rcpp::VectorBase<RTYPE,NA,T>& t, Function fun ){
+	return sugar::Sapply<RTYPE,NA,T,Function>( t, fun ) ;
 }
 
 } // Rcpp

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h	2010-07-08 13:35:09 UTC (rev 1838)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/functions/seq_along.h	2010-07-08 13:39:53 UTC (rev 1839)
@@ -40,8 +40,8 @@
 	
 } // sugar
 
-template <int RTYPE, bool _NA_, typename T>
-inline sugar::SeqLen seq_along( const Rcpp::VectorBase<RTYPE,_NA_,T>& t){
+template <int RTYPE, bool NA, typename T>
+inline sugar::SeqLen seq_along( const Rcpp::VectorBase<RTYPE,NA,T>& t){
 	return sugar::SeqLen( t.size() ) ;
 }
 

Modified: pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-07-08 13:35:09 UTC (rev 1838)
+++ pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-07-08 13:39:53 UTC (rev 1839)
@@ -85,17 +85,17 @@
 		init() ;
     }
     
-    template <bool __NA__, typename __VEC__>
-    Vector( const VectorBase<RTYPE,__NA__,__VEC__>& other ) : RObject() {
+    template <bool NA, typename VEC>
+    Vector( const VectorBase<RTYPE,NA,VEC>& other ) : RObject() {
     	int n = other.size() ;
     	RObject::setSEXP( Rf_allocVector( RTYPE, n ) ) ;
-    	import_expression<__NA__,__VEC__>( other, n ) ;
+    	import_expression<NA,VEC>( other, n ) ;
 	}
     
 private:
 	
-	template <bool __NA__, typename __VEC__>
-    void import_expression( const VectorBase<RTYPE,__NA__,__VEC__>& other, int n ){
+	template <bool NA, typename VEC>
+    void import_expression( const VectorBase<RTYPE,NA,VEC>& other, int n ){
     	iterator start = begin() ; 
 		for( int i=0; i<n; i++, ++start){
 			*start = other[i] ;



More information about the Rcpp-commits mailing list