Re: [Rcpp-devel] Significant difference in performance when computing Ax

2014-04-27 Thread Avraham Adler
I understand and agree that it is a feature; I just should have realized that crossprod using a fast BLAS is an unfair comparison to non-BLAS using routines. Then again, it's another reason to use fast BLAS's. I wish that R for windows would allow the use of an optimized LAPACK too. Oh well. Thank

Re: [Rcpp-devel] Significant difference in performance when computing Ax

2014-04-27 Thread Dirk Eddelbuettel
On 27 April 2014 at 14:34, Avraham Adler wrote: | I feel foolish now. I forgot to note that I build R using a Win64 | version of OpenBLAS (see | | for more). I'm certain that the speed in tcrossprod is coming from an | op

Re: [Rcpp-devel] Significant difference in performance when computing Ax

2014-04-27 Thread Avraham Adler
luate_0.5.3 formatR_0.10 httr_0.3 > memoise_0.1 parallel_3.1.0 > > [8] RCurl_1.95-4.1 stringr_0.6.2 tools_3.1.0whisker_0.3-2 > > > > > > > > > > > > From: Avraham Adler [mailto:avraham.ad...@gmail.com] > Sent: 25. april 2014 19:43 > To: S

Re: [Rcpp-devel] Significant difference in performance when computing Ax

2014-04-25 Thread Avraham Adler
There is actually one other command to test, `crossprod`, or in this case `tcrossprod(x, A)`. Following your code, first run and ensure TRUE is returned. d <- 2000 A <- matrix(1.0*(1:d^2),nrow=d) x <- 1.0*(1:d) all.equal(A%*%x, tcrossprod(x, A), mvprod1(A,x), mvprod2(A,x)) Now, using an i7-3740Q

[Rcpp-devel] Significant difference in performance when computing Ax

2014-04-25 Thread Søren Højsgaard
Dear all, When forming the matrix-vector-product one can form the inner products between As rows and x (mvprod1 below) or form a linear combination of As columns (mvprod2 below). The difference in computing time is striking (at least for me) for large matrices and it really illustrates the "cach