[Rcpp-commits] r1013 - pkg/Rcpp/inst/include/Rcpp/traits

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 6 12:33:00 CEST 2010


Author: romain
Date: 2010-04-06 12:33:00 +0200 (Tue, 06 Apr 2010)
New Revision: 1013

Modified:
   pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
Log:
support for containers of 'short' 

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-04-06 10:28:53 UTC (rev 1012)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
@@ -50,6 +50,11 @@
 */
 template<> struct r_sexptype_traits<long double>{ enum{ rtype = REALSXP } ; } ;
 
+/* short are represented as integer vector in R
+*/
+template<> struct r_sexptype_traits<short>{ enum{ rtype = INTSXP } ; } ;
+
+
 /**
  * Indicates if a primitive type needs a static_cast
  */

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-04-06 10:28:53 UTC (rev 1012)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
@@ -95,10 +95,15 @@
 template<> struct r_type_traits<long>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,long> >{ typedef r_type_primitive_tag r_category ; } ;
 
-/* long */
+/* long double */
 template<> struct r_type_traits<long double>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,long double> >{ typedef r_type_primitive_tag r_category ; } ;
 
+/* short */
+template<> struct r_type_traits<short>{ typedef r_type_primitive_tag r_category ; } ;
+template<> struct r_type_traits< std::pair<const std::string,short> >{ typedef r_type_primitive_tag r_category ; } ;
+
+
 } // traits
 } // Rcpp
 

Modified: pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-04-06 10:28:53 UTC (rev 1012)
+++ pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
@@ -64,8 +64,8 @@
 template <> struct wrap_type_traits< std::complex<double> > { typedef wrap_type_primitive_tag wrap_category; } ;
 
 template <> struct wrap_type_traits<long> { typedef wrap_type_primitive_tag wrap_category; } ;
-
 template <> struct wrap_type_traits<long double> { typedef wrap_type_primitive_tag wrap_category; } ;
+template <> struct wrap_type_traits<short> { typedef wrap_type_primitive_tag wrap_category; } ;
 
 } // namespace traits
 } // namespace Rcpp



More information about the Rcpp-commits mailing list