Le 15/06/10 23:06, Douglas Bates a écrit :

Suppose I want to iterate over the values of a NumericVector x.  If
one wants to "future-proof" one's code a bit, I presume the preferred
idiom is

for(R_len_t i = 0; i<  x.size(); ++i) x[i] = ...

as opposed to declaring i to be an int or a size_t.  Is that correct?

yep ... although some of the code in Rcpp is not correct, this is probably the best type to use.

--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/98Uf7u : Rcpp 0.8.1
|- http://bit.ly/c6YnCi : graph gallery collage
`- http://bit.ly/bZ7ltC : inline 0.3.5


_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to