[Rcpp-devel] more generic vector code

Dirk Eddelbuettel edd at debian.org
Sun Feb 28 18:46:06 CET 2010


On 28 February 2010 at 15:02, Romain Francois wrote:
| 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.

Awesome!
 
| 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)

Really nice work.

Dirk

-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!


More information about the Rcpp-devel mailing list