[Rcpp-devel] more generic vector code

Romain Francois romain at r-enthusiasts.com
Sun Feb 28 15:02:27 CET 2010


Hello,

I've commited some reorganization of Rcpp so that the code to deal with 
vectors is fully generic.

Before, where we had the template SimpleVector<int RTYPE>, the class 
CharacterVector and the template SEXP_Vector<int RTYPE>, we now have a 
single template Rcpp::Vector<int RTYPE> to generate all vector types.

This still passes all unit tests, but there might be some instabilities, 
so if someone finds that something (e.g. involving another package) is 
broken, I'd like to know about it.

In addition, the Vector template uses the curiously recurring template 
pattern, :

template <int RTYPE>
class Vector : public VectorBase< Vector<RTYPE> >

This is to accomodate future plans about expression templates.

As part of this commit, we have now more methods for all vectors, for 
example simple vectors, e.g IntegerVector now have push_back, 
push_front, etc ... (see the runit.IntegerVector.R file for examples)

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7
`- http://tr.im/O1wO : highlight 0.1-5





More information about the Rcpp-devel mailing list