Re: [Rcpp-devel] Rcpp::ListOf.size() returns signed int?

2014-09-01 Thread Kevin Ushey
Hi Christian, Thanks for catching this. I think this is an oversight -- this should return `R_len_t` as well. Or, when long vector support is implemented, `R_xlen_t` should be used instead (especially since `ListOf` is more-or-less a fancy interface over a `List` object) Just pushed a correspondi

[Rcpp-devel] Rcpp::ListOf.size() returns signed int?

2014-09-01 Thread Christian Gunning
Minor implementation question - As a learning exercise, I'm working through g++ warnings. After reading SO posts r.e. int vs size_t, I've set all variables that hold or compare object size information to type std::size_t. This fixes compiler warnings for Vector.size(), which doxygen shows have re

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Gregory Jefferis
Gregory Jefferis On 1 Sep 2014, at 22:29, "Dr Gregory Jefferis" wrote: > RCPP_EXPOSED_CLASS_NODECL(MyClassD) > RCPP_MODULE(class_MyClassF) { > class_( "MyClassF" ) > .constructor >() > // other methods ... > ; > } Hmm already spotted a typo. That second block should of course have starte

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dr Gregory Jefferis
Dear Dirk, On 1 Sep 2014, at 21:19, Dirk Eddelbuettel wrote: These very useful RCPP_EXPOSED_CLASS* macros are a tad underdocumented. Greg, would you be interested in writing up a simple Rcpp Gallery post on that? I would be happy to help if you'd prefer that. Many thanks for the invitatio

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 19:45, Dr Gregory Jefferis wrote: | On 1 Sep 2014, at 17:32, Romain Francois wrote: | | > This looks related to what RCPP_EXPOSED_CLASS does, perhaps because | > your class comes from a template, you could try | > RCPP_EXPOSED_CLASS_NODECL instead. The only difference is

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dr Gregory Jefferis
Dear Romain, On 1 Sep 2014, at 17:32, Romain Francois wrote: This looks related to what RCPP_EXPOSED_CLASS does, perhaps because your class comes from a template, you could try RCPP_EXPOSED_CLASS_NODECL instead. The only difference is that it does not add the class forward declaration, so you

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Romain Francois
Le 1 sept. 2014 à 11:48, Dr Gregory Jefferis a écrit : > Hello, > > I have a more or less complete Rcpp(Eigen) dependent package that exposes a > pair of C++ classes to R using RcppModules;the C++ classes (which implement k > nearest neighbour search trees) differ only in their scalar storag

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dr Gregory Jefferis
On 1 Sep 2014, at 14:09, Dirk Eddelbuettel wrote: And I think I was trying to explain to you that - becase _R_ only knows double and - does dispatch by _name_ only there is no clean way in which _Rcpp_ can maintain these as two distinct versions under the same name. In short, just because you

Re: [Rcpp-devel] only LinkingTo: RcppEigen gives compileAttributes warning

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 08:06, Dirk Eddelbuettel wrote: | Ok, I think we are once again rehashing a previous thread. The (spurious) | Rcpp warning you saw: | |Warning message: |The following packages are referenced using Rcpp::depends attributes |however are not listed in the Depends

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 13:40, Dr Gregory Jefferis wrote: | I'm not sure that I understand this point, but it may be what I have | already tried. What I was trying to do was write templated code, typedef | two separate types one for double, one for float and then export each of | them separately

Re: [Rcpp-devel] only LinkingTo: RcppEigen gives compileAttributes warning

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 13:43, Dr Gregory Jefferis wrote: | Dear Dirk, | | On 1 Sep 2014, at 13:22, Dirk Eddelbuettel wrote: | | > You need both LinkingTo: statements as they give us the -I flags | > needed for | > compilation. | > | > These days you need only one Import: statement to instantiat

Re: [Rcpp-devel] only LinkingTo: RcppEigen gives compileAttributes warning

2014-09-01 Thread Dr Gregory Jefferis
Dear Dirk, On 1 Sep 2014, at 13:22, Dirk Eddelbuettel wrote: You need both LinkingTo: statements as they give us the -I flags needed for compilation. These days you need only one Import: statement to instantiate Rcpp. Just to be clear, the relevant part of my DESCRIPTION looks like this: I

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dr Gregory Jefferis
Dear Dirk, Many thanks for your quick (as ever) response. On 1 Sep 2014, at 13:27, Dirk Eddelbuettel wrote: But in this case consider that a) R itself only knows double so at some point both variants need to be promoted up Yes, the code presently includes a static cast to the template scal

Re: [Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 10:48, Dr Gregory Jefferis wrote: | Hello, | | I have a more or less complete Rcpp(Eigen) dependent package that | exposes a pair of C++ classes to R using RcppModules;the C++ classes | (which implement k nearest neighbour search trees) differ only in their | scalar stor

Re: [Rcpp-devel] only LinkingTo: RcppEigen gives compileAttributes warning

2014-09-01 Thread Dirk Eddelbuettel
On 1 September 2014 at 10:42, Dr Gregory Jefferis wrote: | I have package that depends on Rcpp(Eigen). Originally I imported and | linked to Rcpp and RcppEigen. However sending the package to the | winbuilder server, r-devel complains that I only need to link to | RcppEigen: | | * checking pac

[Rcpp-devel] RcppModules with templated class

2014-09-01 Thread Dr Gregory Jefferis
Hello, I have a more or less complete Rcpp(Eigen) dependent package that exposes a pair of C++ classes to R using RcppModules;the C++ classes (which implement k nearest neighbour search trees) differ only in their scalar storage type (float vs double) and are called WKNND and WKNNF. For futur

[Rcpp-devel] only LinkingTo: RcppEigen gives compileAttributes warning

2014-09-01 Thread Dr Gregory Jefferis
Hello, I have package that depends on Rcpp(Eigen). Originally I imported and linked to Rcpp and RcppEigen. However sending the package to the winbuilder server, r-devel complains that I only need to link to RcppEigen: * checking package dependencies ... NOTE Package in Depends/Imports which