Re: [Rcpp-devel] tracking volatile bug

2014-11-23 Thread Sokol Serguei
Martin Morgan has written at Sun, 23 Nov 2014 14:09:27 -0800 On 11/23/2014 11:07 AM, Sokol Serguei wrote: Gabor Grothendieck has written at Sat, 22 Nov 2014 19:17:27 -0500 On Sat, Nov 22, 2014 at 1:43 PM, Sokol Serguei wrote: Let try to stick with regular rcpp code (file: matrix_norm.cpp):

Re: [Rcpp-devel] tracking volatile bug

2014-11-23 Thread Sokol Serguei
Gabor Grothendieck has written at Sun, 23 Nov 2014 17:57:48 -0500 On Sun, Nov 23, 2014 at 2:07 PM, Sokol Serguei wrote: Gabor Grothendieck has written at Sat, 22 Nov 2014 19:17:27 -0500 On Sat, Nov 22, 2014 at 1:43 PM, Sokol Serguei wrote: Let try to stick with regular rcpp code (file: mat

Re: [Rcpp-devel] tracking volatile bug

2014-11-23 Thread Gabor Grothendieck
On Sun, Nov 23, 2014 at 2:07 PM, Sokol Serguei wrote: > Gabor Grothendieck has written at Sat, 22 Nov 2014 19:17:27 -0500 > >> On Sat, Nov 22, 2014 at 1:43 PM, Sokol Serguei >> wrote: >>> >>> Let try to stick with regular rcpp code >>> (file: matrix_norm.cpp): >>> >>> //[[Rcpp::depends(RcppArmadi

Re: [Rcpp-devel] tracking volatile bug

2014-11-23 Thread William Dunlap
> In quickref, all examples pass just numbers without any prior conversion > to NumericVector or IntegerVector. Strings are exception to this? Strings are different than numbers in that they don't occupy a fixed amount of space, so some memory management is needed for them. Bill Dunlap TIBCO Sof

Re: [Rcpp-devel] tracking volatile bug

2014-11-23 Thread Sokol Serguei
Gabor Grothendieck has written at Sat, 22 Nov 2014 19:17:27 -0500 On Sat, Nov 22, 2014 at 1:43 PM, Sokol Serguei wrote: Let try to stick with regular rcpp code (file: matrix_norm.cpp): //[[Rcpp::depends(RcppArmadillo)]] #include using namespace Rcpp; using namespace arma; // [[Rcpp::export]

Re: [Rcpp-devel] tracking volatile bug

2014-11-22 Thread Gabor Grothendieck
On Sat, Nov 22, 2014 at 1:43 PM, Sokol Serguei wrote: > Let try to stick with regular rcpp code > (file: matrix_norm.cpp): > > //[[Rcpp::depends(RcppArmadillo)]] > #include > using namespace Rcpp; > using namespace arma; > > // [[Rcpp::export]] > double nmat(mat A) { >Function Matrix_norm_r_=

Re: [Rcpp-devel] tracking volatile bug

2014-11-22 Thread Sokol Serguei
Dirk Eddelbuettel has written at Sat, 22 Nov 2014 09:57:36 -0600 On 21 November 2014 at 23:50, Sokol Serguei wrote: | If I did not use the protection in my Rcpp code it's because | I did not see it in any example of quick ref guide: | http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-qu

Re: [Rcpp-devel] tracking volatile bug

2014-11-22 Thread Dirk Eddelbuettel
On 21 November 2014 at 23:50, Sokol Serguei wrote: | If I did not use the protection in my Rcpp code it's because | I did not see it in any example of quick ref guide: | http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf | I didn't see any mention of PROTECT necessity neither

Re: [Rcpp-devel] tracking volatile bug

2014-11-21 Thread Sokol Serguei
Thanks Martin, Your PROTECT did the job :) Martin Morgan has written at Fri, 21 Nov 2014 13:33:47 -0800 On 11/21/2014 09:23 AM, Serguei Sokol wrote: Well, I could narrow the issue but not yet resolve it. Le 18/11/2014 20:46, William Dunlap a écrit : I will try "gctorture(TRUE)" suggested by

Re: [Rcpp-devel] tracking volatile bug

2014-11-21 Thread Serguei Sokol
Well, I could narrow the issue but not yet resolve it. Le 18/11/2014 20:46, William Dunlap a écrit : I will try "gctorture(TRUE)" suggested by Martin. I'll start with this easy part. Unfortunately valgrind didn't detect any wrong access to memory. Now, the difficult part. The most reduced code

Re: [Rcpp-devel] tracking volatile bug

2014-11-18 Thread William Dunlap
> I will try "gctorture(TRUE)" suggested by Martin. Try running it under valgrind as well. E.g., % R --debugger=valgrind ==15338== Memcheck, a memory error detector ==15338== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==15338== Using Valgrind-3.7.0 and LibVEX; rerun w

Re: [Rcpp-devel] tracking volatile bug

2014-11-18 Thread Serguei Sokol
Le 18/11/2014 16:39, Romain François a écrit : Le 18 nov. 2014 à 14:42, Serguei Sokol a écrit : /* call this R command: source("FileName") */ int errorOccurred; SEXP e = lang2(install("source"), mkString("FileName")); /* mkChar instead of mkString would lead to this runtime er

Re: [Rcpp-devel] tracking volatile bug

2014-11-18 Thread Romain François
> Le 18 nov. 2014 à 14:42, Serguei Sokol a écrit : > > Hi everybody, > > I am facing a volatile bug which appears and disappears in > identical calls on identical data. > > My RcppArmadilla code is expm_cpp() (it is obtained by rex2arma tool > which I have presented before, cf. attached file).

Re: [Rcpp-devel] tracking volatile bug

2014-11-18 Thread Dirk Eddelbuettel
Serguei, First, I think we mentioned to you after your first post on rex2arma that all serious Rcpp development is generally done in packages. You should probably embrace that mode too. Many of us prefer it. Second, 'expm' does not need to be reimplemented. See my RcppKalman package (on GitHub

[Rcpp-devel] tracking volatile bug

2014-11-18 Thread Serguei Sokol
Hi everybody, I am facing a volatile bug which appears and disappears in identical calls on identical data. My RcppArmadilla code is expm_cpp() (it is obtained by rex2arma tool which I have presented before, cf. attached file). It is compared and benchmarked vs its R counterpart expm.higham() (a