[Rcpp-commits] r1006 - in pkg/Rcpp: . inst inst/include/Rcpp/traits
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Apr 6 09:55:51 CEST 2010
Author: romain
Date: 2010-04-06 09:55:50 +0200 (Tue, 06 Apr 2010)
New Revision: 1006
Modified:
pkg/Rcpp/DESCRIPTION
pkg/Rcpp/inst/ChangeLog
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:
added support for long
Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION 2010-04-06 07:31:13 UTC (rev 1005)
+++ pkg/Rcpp/DESCRIPTION 2010-04-06 07:55:50 UTC (rev 1006)
@@ -1,6 +1,6 @@
Package: Rcpp
Title: Rcpp R/C++ interface package
-Version: 0.7.11.2
+Version: 0.7.11.3
Date: $Date$
Author: Dirk Eddelbuettel and Romain Francois, with contributions
by Simon Urbanek, David Reiss and Douglas Bates; based on code written during
Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog 2010-04-06 07:31:13 UTC (rev 1005)
+++ pkg/Rcpp/inst/ChangeLog 2010-04-06 07:55:50 UTC (rev 1006)
@@ -1,3 +1,7 @@
+2010-04-6 Romain Francois <romain at r-enthusiasts.com>
+
+ * inst/include/Rcpp/traits/*.h: added support for long
+
2010-04-4 Romain Francois <romain at r-enthusiasts.com>
* inst/include/* : headers are moved to inst/include so that they are
Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h 2010-04-06 07:31:13 UTC (rev 1005)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h 2010-04-06 07:55:50 UTC (rev 1006)
@@ -41,6 +41,9 @@
template<> struct r_sexptype_traits<unsigned int>{ enum{ rtype = INTSXP } ; } ;
template<> struct r_sexptype_traits<float>{ enum{ rtype = REALSXP } ; } ;
+/* long are represented as numeric vectors which allows more precision
+ to be preserved than int */
+template<> struct r_sexptype_traits<long>{ enum{ rtype = REALSXP } ; } ;
/**
* 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 07:31:13 UTC (rev 1005)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h 2010-04-06 07:55:50 UTC (rev 1006)
@@ -91,6 +91,10 @@
template<> struct r_type_traits<float>{ typedef r_type_primitive_tag r_category ; } ;
template<> struct r_type_traits<const char*>{ typedef r_type_string_tag r_category ; } ;
+/* long */
+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 ; } ;
+
} // 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 07:31:13 UTC (rev 1005)
+++ pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h 2010-04-06 07:55:50 UTC (rev 1006)
@@ -63,6 +63,7 @@
template <> struct wrap_type_traits< std::complex<float> > { typedef wrap_type_primitive_tag wrap_category; } ;
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; } ;
} // namespace traits
} // namespace Rcpp
More information about the Rcpp-commits
mailing list