[Rcpp-devel] Differences between RcppEigen and RcppArmadillo
hilbertspaces at gmail.com
Thu Jun 14 00:05:55 CEST 2012
I agree that RcppEigen is a little bit faster, but ease of use is important
to me, so I feel like RcppArmadillo might win out in my application.
| RcppArmadillo will use the very same LAPACK and BLAS libs your R session
| uses. So MKL, OpenBlas, ... are all options. Eigen actually has its own
| outperforming LAPACK, so it doesn't as much there.
Why do you think R outperforms RcppArmadillo in this example below? Anyway
to speed this up?
arma.code <- '
using namespace arma;
int n = Xr.nrow(), k = Xr.ncol();
mat X(Xr.begin(), n, k, false);
svd(U, s, V, X);
rcppsvd <- cxxfunction(signature(Xs="numeric"),
user system elapsed
1992.406 4.862 1988.737
user system elapsed
652.496 2.641 652.614
On Wed, Jun 13, 2012 at 11:43 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
> On 13 June 2012 at 10:57, Julian Smith wrote:
> | I've been toying with both RcppArmadillo and RcppEigen the past few days
> | don't know which library to continue using. RcppEigen seems really
> slick, but
> | appears to be lacking some of the decompositions I want and isn't nearly
> | fast to code. RcppArmadillo seems about as fast, easier to code up etc.
> | are some of the advantages/disadvantages of both?
> That's pretty close. I have been a fan of [Rcpp]Armadillo which I find
> easier to get my head around. Doug, however, moved from [Rcpp]Armadillo to
> [Rcpp]Eigen as it has some things he needs. Eigen should have a "larger"
> than Armadillo, but I find the code and docs harder to navigate.
> And you should find Eigen to be a little faster. Andreas Alfons went as far
> as building 'robustHD' using RcppArmadillo with a drop-in for RcppEigen (in
> package 'sparseLTSEigen'; both package names from memmory and I may have
> mistyped). He reported a performance gain of around 25% for his problem
> sets. On the 'fastLm' benchmark, we find the fast Eigen-based
> to be much faster than Armadillo.
> | Can you call LAPACK or BLAS from either? Is there a wrapper in RcppEigen
> | call LAPACK functions? Want some other decomposition methods, dont like
> | JacobiSVD method in Eigen.
> You need to differentiate between the Eigen and Armadillo docs _for their
> libraries_ and what happens when you access the Rcpp* variant from R.
> RcppArmadillo will use the very same LAPACK and BLAS libs your R session
> uses. So MKL, OpenBlas, ... are all options. Eigen actually has its own
> outperforming LAPACK, so it doesn't as much there.
> Hope this helps, Dirk (at useR!)
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel