Re: [Rcpp-devel] int double multiplication

2016-06-22 Thread Andreas Prescher
Thanks a lot for the helpful answers!! Andreas Am 21.06.2016 um 22:19 schrieb Matt D.: > Hi, > > On 6/21/2016 16:33, Andreas Prescher wrote: >> void f(double d) { >> int i = vector.size() * d; >> } > A quick note to add to the other answers: You don&#

Re: [Rcpp-devel] int double multiplication

2016-06-21 Thread Andreas Prescher
ope its more clear now. Andreas Am 21.06.2016 um 16:49 schrieb Dirk Eddelbuettel: > > On 21 June 2016 at 16:33, Andreas Prescher wrote: > | Hello, > | > | calling my function from R with > | f(1/3) gives different results > | on ubuntu 12.04 32 bit > | and 14.04 64 bit,

[Rcpp-devel] int double multiplication

2016-06-21 Thread Andreas Prescher
Hello, calling my function from R with f(1/3) gives different results on ubuntu 12.04 32 bit and 14.04 64 bit, e.g: void f(double d) { int i = vector.size() * d; } Given vector of size 75 I get 25 on 14.04 64 bit and 24 on 12.04 32 bit. Size of int is 4 byte, double 8 byte on both system

Re: [Rcpp-devel] OpenMp and IntegerVector

2014-03-12 Thread Andreas Prescher
resultList[i] = Rcpp::List::create(/*...put tuple stuff inside here*/); } return resultList; } (Don't be confused why vector and so on, I shortened my function in the postings) Puh, made me headaches Andreas Am 11.03.2014 20:56, schrieb Dirk Eddelbuettel: Andreas

[Rcpp-devel] OpenMp and IntegerVector

2014-03-11 Thread Andreas Prescher
Hello, I got strange behaviour when using OpenMp and IntegerVector (without OpenMp all works fine!!) From my package (Rcpp 0.10.4 used, let some unimportant arguments out) Rcpp::List PsiMinRContainer::parInit(const Rcpp::List& seedList) { Rcpp::List resultList(m_psiMinRVec.size() - 1);

Re: [Rcpp-devel] named and default arguments in exposed C++ classes

2014-03-06 Thread Andreas Prescher
kind of "hooked method", that will be always called when the module is unloaded. I only found the finalize method in the modules/class context. (Maybe a question for a new thread) Andreas Am 05.03.2014 16:36, schrieb Dirk Eddelbuettel: On 5 March 2014 at 16:26, Andreas Prescher wro

[Rcpp-devel] named and default arguments in exposed C++ classes

2014-03-05 Thread Andreas Prescher
Hello, I wrote a R package using Rcpp (0.10.4) modules to expose my C++ classes. All works fine, but for convenient using from R, it would be great to use the class methods with named arguments and default arguments. At the moment I have to use all class methods as declared in the corresponding

[Rcpp-devel] Rcpp.package.skeleton testmod

2013-06-03 Thread Andreas Prescher
Hello, Any help would be greatly appreciated I am trying to use the example testmod package by using: Rcpp.package.skeleton( "testmod", module = TRUE ) and: R CMD INSTALL testmod system information: R version 3.0.1 (2013-05-16) Platform: x86_64-pc-linux-gnu (64-bit), ubuntu 12.04 LTS /usr