0

Can anyone help me to make an Rcpp for fast matrix multiplication of a matrix A and its transpose in R?

It seems that the built-in function crossprod is stable. But it seems that it does not take an advantage of the fact that here we don't actually need to compute all entries due to the symmetry of the matrix.

Can anyone help me?

  • Welcome to StackOverflow. You will not beat `crossprod()` (by much) with simple Rcpp code: it alread goes directly from R to (compiled, optimised, possible parallel) libraries: BLAS/LAPACK (and when you use RcppArmadilllo it does just that for you too). You can maybe help yourself by installing the Intel MKL as fastest BLAS/LAPACK. These topics have all been discussed so poke around with some searches. – Dirk Eddelbuettel Mar 11 '21 at 04:20
  • The underlying BLAS routine is detailed here: https://stackoverflow.com/questions/47013581/blas-matrix-by-matrix-transpose-multiply The question is if any of the existing entry points in, say, Armadillo, dispatches to DSYRK. I'd have to look... – Dirk Eddelbuettel Mar 11 '21 at 04:23

0 Answers0