dirkschumacher / armacmp

🚀 Automatically compile linear algebra R code to C++ with Armadillo

Home Page:https://dirkschumacher.github.io/armacmp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

options to solve()

conradsnicta opened this issue · comments

"arma::solve(",

Using solve_opts::fast can provide considerable speedups here.

For users mainly focused on speed, it might be useful to allow the specification of a fast solve directly from R code. Perhaps at the function level, or globally (eg. as an option for armacmp).

@coatless - thoughts?

I am wondering what the best way forward is for arma specifc parameters. Maybe a general convetion to add it at the function level with namespaced parameters? E.g. sum(X, arma_solve_opts = c("fast", "opt2", "opt3")).

But then that produces invalid R code ... so not sure.

Global options would be another solution, but then you would set these flags for all solve operations in your code.

I think a global option would be needed instead of localized variants. Consider the plugin feature of Rcpp for triggering this kind of option.

I say this because the goal should be to ensure the written R code is as close to the original as possible. Anything higher will likely cause a decrease in engagement as this package really serves to bring new people into the world of C++ while simultaneously allowing experts a speedier translation.

This has been resolved upstream in Armadillo 9.800 (link). The solve() function no longer applies iterative refinement by default, leading to massive speedups.

Oh nice!