Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sys.setenv("PKG_LIBS" = "$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)")
- Rcpp::sourceCpp("eigen_sym_cpp.cpp")
- n_row <- 1e4L
- n_col <- 5e1L
- A <- matrix(rnorm(n_row * n_col), n_row, n_col)
- S <- cov(A)
- library(microbenchmark)
- microbenchmark(
- Rcpp_BLAS = eigen_sym_cpp(S),
- R = eigen(S),
- times = 100L)
- # Unit: microseconds
- # expr min lq mean median uq max neval
- # Rcpp_BLAS 789.644 874.196 904.5647 891.4575 943.974 1545.057 100
- # R 1194.267 1344.793 1444.1375 1404.7695 1516.385 3655.062 100
Advertisement
Add Comment
Please, Sign In to add comment