[Rcpp-devel] added raw support in RcppSexp

Romain François francoisromain at free.fr
Tue Dec 22 14:08:05 CET 2009


On 12/22/2009 01:39 PM, Dirk Eddelbuettel wrote:
>
> On 22 December 2009 at 12:15, Romain François wrote:
> |>  I've long wondered why/how/if we could assign more efficiently -- but STL
> |>  Vectors don't let us just 'memcpy' a chunk.
> |
> | I don't think you are guaranteed that the elements are contiguous, so I
> | would not go down there.
>
> Right. I R they are, in STL not necessarily.
>
> |>  Would this 'more iterator like' assign(a,b) work for the types INTEGER, REAL
> |>  too?
> |
> | yep. I derived this from reading item 5 of Effective STL, and how the
> | author is rambling about using range functions rather than looping around.
> |
> | a and be can be int* which is what INTEGER(x) would give you.
>
> Maybe I'll peek and poke. Though I had hope to put work on Rcpp to rest for
> it to get to other stuff :)
>
> Saw that CPP is on R-Forge. Makes sense for now; we'll get to revisit CPP and
> Rcpp and all that with RProtoBuf a few times over anyway...
>
> Dirk

I'll commit what I have : vector<int>, vector<double>, vector<raw> and 
set<int> later today.

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/HlX9 : new package : bibtex
|- http://tr.im/Gq7i : ohloh
`- http://tr.im/FtUu : new package : highlight





More information about the Rcpp-devel mailing list