Re: [Rcpp-devel] Rcpp ISNAN slower than C ISNAN?

2016-12-14 Thread Christian Gunning
On Wed, Dec 14, 2016 at 12:23 PM, Johannes Kruisselbrink wrote: > > Good point. Actually, I didn't even realize there were so many is-nan > functions to choose from. But indeed, we used the R-core ISNAN function on > doubles accessed via Rcpp. Me either :) Of course, the above isn't particular to

Re: [Rcpp-devel] Rcpp ISNAN slower than C ISNAN?

2016-12-14 Thread Johannes Kruisselbrink
Take care to distinguish the R-core ISNAN macro, the R_IsNaN function, and the Rcpp::isNaN template function. Asides from sugar-stuff, all the examples discussed here so far address the performance of R-core ISNAN, given doubles that are accessed via Rcpp, correct? Good point. Actually, I didn

Re: [Rcpp-devel] a variable for loop

2016-12-14 Thread Avraham Adler
Hello, Amina. Firstly, why are you even passing in a if b contains the proper dimensions. It's not like you are using a. Secondly, and more importantly, once you provided the r code, you can see that this is **EXACTLY** the problem you asked on September 26 of this year, see http://lists.r-forge.

Re: [Rcpp-devel] a variable for loop

2016-12-14 Thread Serguei Sokol
Hi Amina, Looks like you want us to do your homework, right? ;) Pay attention to subscript translation from R to C: c[i-1, j, k-1] * b[i, j] vs c(i-1, j, k) *b(i, j) Can you see the difference? Best, Serguei. Le 14/12/2016 à 07:46, Amina Shahzadi a écrit : Oh sorry. No. of columns in b and

Re: [Rcpp-devel] Rcpp ISNAN slower than C ISNAN?

2016-12-14 Thread Christian Gunning
> so skipping the entire object is not really an option. Understood - just wanted to highlight the existence of Rcpp::is_nan / Rcpp::any in case they were broadly relevant. > Nevertheless, the question still remains why the rcpp isNaN call is so > much slower. Take care to distinguish the R-core