Re: [Rcpp-devel] R/Rcpp/RcppEigen Optimization WAS: NumericVector Double mismatch when indexing an array

2012-10-23 Thread Darren Cook
> What gives? What I found that does speed up the code dramatically > is the -march switch. I guess that can't be repo-ed because it is > CPU dependent, right? Here's the important settings that I used to > compile R from source: > > CC="gcc" > CFLAGS="-g -O2 -march=amdfam10" > CXX="g++" > CXXF

Re: [Rcpp-devel] Slices of 3d arrays as matrices

2012-10-23 Thread Giovanni Petris
Thank you Doug and Dirk. I was afraid I had to move to Eigen... The problem now is that in the transition I am working with matrices both of type NumericMatrix and Map. The following snippet is a loop that is giving me troubles... wz1 <- lapply(1:K, function(k) matrix(0.0, N, M)) # this is

Re: [Rcpp-devel] Slices of 3d arrays as matrices

2012-10-23 Thread Douglas Bates
On Tue, Oct 23, 2012 at 12:56 PM, Giovanni Petris wrote: > Hello, > > I have a 3d array and I want to compute the eigendecomposition of each slice > [,, k]. I am trying to make Rcpp see the relevant slice of the 3d array as a > matrix. My experiments, along the lines illustrated below, have so f

Re: [Rcpp-devel] Slices of 3d arrays as matrices

2012-10-23 Thread Dirk Eddelbuettel
Hi Giovanni, On 23 October 2012 at 17:56, Giovanni Petris wrote: | Hello, | | I have a 3d array and I want to compute the eigendecomposition of each slice [,, k]. I am trying to make Rcpp see the relevant slice of the 3d array as a matrix. My experiments, along the lines illustrated below, hav

[Rcpp-devel] Slices of 3d arrays as matrices

2012-10-23 Thread Giovanni Petris
Hello, I have a 3d array and I want to compute the eigendecomposition of each slice [,, k]. I am trying to make Rcpp see the relevant slice of the 3d array as a matrix. My experiments, along the lines illustrated below, have so far been unsuccessful. Does anybody have a suggestion? Thank you in

Re: [Rcpp-devel] modules feature added (rev 3814)

2012-10-23 Thread Romain Francois
I continued this, and now we can also expose free functions returning pointers. For example: Foo* make_foo(){ return new Foo(3, 4) ; } See svn version of RcppBDT for a real example. Romain Le 23/10/12 15:55, Romain Francois a écrit : Hello, I've added the possibility for exposed classes to

Re: [Rcpp-devel] R/Rcpp/RcppEigen Optimization WAS: NumericVector Double mismatch when indexing an array

2012-10-23 Thread Dirk Eddelbuettel
On 23 October 2012 at 09:46, Rodney Sparapani wrote: | On 09/25/2012 04:45 PM, Dirk Eddelbuettel wrote: | > | > I use and recommend ~/.R/Makevars for that --- as setting certain values at | > the package level is very verboten ("non portable code" and all that) as far | > as CRAN is concerned. | >

[Rcpp-devel] R/Rcpp/RcppEigen Optimization WAS: NumericVector Double mismatch when indexing an array

2012-10-23 Thread Rodney Sparapani
On 09/25/2012 04:45 PM, Dirk Eddelbuettel wrote: I use and recommend ~/.R/Makevars for that --- as setting certain values at the package level is very verboten ("non portable code" and all that) as far as CRAN is concerned. Now, that's the "how do you" part. As for "does it matter" that is a d

[Rcpp-devel] modules feature added (rev 3814)

2012-10-23 Thread Romain Francois
Hello, I've added the possibility for exposed classes to expose a method that returns a pointer of the class. That is not easy to explain in a sentence, here is an example code: class Foo{ public: Foo( double x_, double y_) : x(x_), y(y_){} Foo* clone(){

Re: [Rcpp-devel] Odd-seeming behaviour of [[ and $

2012-10-23 Thread North, Ben
Hi Romain, > > Because `$` doesn't evaluate its field-name argument, is > > > > field.name <- "value" > > do.call(`$`, list(x, field.name)) > > > > the recommended way of accessing methods whose names are computed at > > run-time? It does work; just wondering if there's a better way. >