[Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Toni Giorgino
Dears, I am a newbie to Rcpp. I may have found an off-by-one inconsistency in the handling of List::erase(iter1,iter2) operation with respect to its homologous in the STL (which I suppose is intended to mimic). In STL, iter2 can be the container's .end(); in Rcpp, the same gives an out of bound

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Dirk Eddelbuettel
Hi Toni, Nice example -- we'll take a look. Probably a buglet at our end. The STL are just for convenience: each operation requires _a full copy_ underneath (as we work on R memory) so they are hogs, which is why nobody may have found this bug yet. Two minor comments: The BEGIN and END macro

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Romain Francois
Thanks. I'll have a look. Le 05/06/13 14:09, Toni Giorgino a écrit : Dears, I am a newbie to Rcpp. I may have found an off-by-one inconsistency in the handling of List::erase(iter1,iter2) operation with respect to its homologous in the STL (which I suppose is intended to mimic). In STL, iter

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Dirk Eddelbuettel
On 5 June 2013 at 14:50, Romain Francois wrote: | Thanks. I'll have a look. Thank you! If you return the (partially) erased object, it looks dodgy too. Dirk -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com ___ Rcpp-devel mailing

[Rcpp-devel] Fwd: Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Toni Giorgino
Dears, thanks. In fact I've found the problem while looking for a workaround to the push_back() slowness (used here for convenience only). The workaround was to preallocate the List, then discard the unneeded portion, for which I looked into erase(). This was many orders of magnitude faster. The

Re: [Rcpp-devel] Fwd: Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Dirk Eddelbuettel
On 5 June 2013 at 15:37, Toni Giorgino wrote: | Dears, | | thanks. In fact I've found the problem while looking for a workaround to the | push_back() slowness (used here for convenience only). The workaround was to | preallocate the List, then discard the unneeded portion, for which I looked | in

[Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Simon Zehnder
Hi Rcpp-Users and Rcpp-Devels, I just build an RcppArmadillo project on my computer using gcc-4.8.1 and the newest Version of RcppArmadillo. I got some warnings I cannot explain to myself. It builds the library and installs it. Nevertheless I would like to know more about my warnings: In file

[Rcpp-devel] RcppArmadillo 0.3.900.0

2013-06-05 Thread Dirk Eddelbuettel
A new RcppArmadillo release is now out, below is a text copy (without links) of what is at http://dirk.eddelbuettel.com/blog/ RcppArmadillo 0.3.900.0 A Armadillo release 3.900.0 was provided by Conrad yeste

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Romain Francois
Most of these are in fact happening in armadillo's code base. Le 05/06/13 16:23, Simon Zehnder a écrit : Hi Rcpp-Users and Rcpp-Devels, I just build an RcppArmadillo project on my computer using gcc-4.8.1 and the newest Version of RcppArmadillo. I got some warnings I cannot explain to myself.

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Romain Francois
This is now fixed in rev 4330. I'm looking at the other issue you reported. Le 05/06/13 14:50, Romain Francois a écrit : Thanks. I'll have a look. Le 05/06/13 14:09, Toni Giorgino a écrit : Dears, I am a newbie to Rcpp. I may have found an off-by-one inconsistency in the handling of List::

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Simon Zehnder
Hi Romain, thanks for the fast reply! So nothing to worry about. taking flags "-Wunused-local-typedefs" away from compilation should let the warnings vanish from output? Best Simon On Jun 5, 2013, at 4:30 PM, Romain Francois wrote: > Most of these are in fact happening in armadillo's code

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Romain Francois
The change affects Rcpp, not RcppArmadillo. Le 05/06/13 16:45, Simon Zehnder a écrit : Hi Romain, is revision 4331 already in RcppArmadillo 3.9.0? Best Simon On Jun 5, 2013, at 4:30 PM, Romain Francois wrote: Most of these are in fact happening in armadillo's code base. Le 05/06/13 16:2

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Simon Zehnder
Hi Romain, is revision 4331 already in RcppArmadillo 3.9.0? Best Simon On Jun 5, 2013, at 4:30 PM, Romain Francois wrote: > Most of these are in fact happening in armadillo's code base. > > Le 05/06/13 16:23, Simon Zehnder a écrit : >> Hi Rcpp-Users and Rcpp-Devels, >> >> I just build an R

Re: [Rcpp-devel] Warnings in build of RcppArmadillo project

2013-06-05 Thread Simon Zehnder
Ah, I see. Thanks for the explanation! Best Simon On Jun 5, 2013, at 4:48 PM, Romain Francois wrote: > The change affects Rcpp, not RcppArmadillo. > > Le 05/06/13 16:45, Simon Zehnder a écrit : >> Hi Romain, >> >> is revision 4331 already in RcppArmadillo 3.9.0? >> >> Best >> >> Simon >>

Re: [Rcpp-devel] Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Dirk Eddelbuettel
On 5 June 2013 at 16:32, Romain Francois wrote: | This is now fixed in rev 4330. Make it rev 4332 which now does the right thing: R> sourceCpp("/tmp/toni.cpp") R> truncateTest() STL Rcpp 1 11 2 22 3 33 4 44 5 55 R> Dirk PS Once-more modified 'tony.cpp' below

Re: [Rcpp-devel] Fwd: Possible inconsistency in Rcpp vs stl in erase(iterator, iterator)

2013-06-05 Thread Romain Francois
Le 05/06/13 15:37, Toni Giorgino a écrit : Dears, thanks. In fact I've found the problem while looking for a workaround to the push_back() slowness (used here for convenience only). The workaround was to preallocate the List, then discard the unneeded portion, for which I looked into erase(). Th

Re: [Rcpp-devel] How to include "Rcpp.h" in code

2013-06-05 Thread Yanping Liu
Hi Dirk, Thanks for your reply. I just confuse how to compile "Rcpp" codes under Window platform. Is there simple guidance example (such as "hellowworld") that success in Windows? Thank you very much! Yanping On Wed, Jun 5, 2013 at 12:39 AM, Dirk Eddelbuettel wrote: > > Yanping, > > On 5 June

Re: [Rcpp-devel] How to include "Rcpp.h" in code

2013-06-05 Thread Dirk Eddelbuettel
On 6 June 2013 at 10:00, Yanping Liu wrote: | Hi Dirk, | | Thanks for your reply. I just confuse how to compile "Rcpp" codes under Window | platform. Is there simple guidance example (such as "hellowworld") that success | in Windows? Thank you very much! Yes there is. Try "Writing R Extension