How to improve performance in a function that repeatedly defines and multiplies matrices

Indeed, in most cases you don’t want to use inv, but there are cases where you do. For example, if you plan to re-use the same inv(A) over and over many times, then the one-time cost of inversion may be worth it (though, then you may still be better off using some matrix factorization). Or perhaps the inverse is of interest in its own right, not just as an intermediate step while solving equations.

It’s related to software licenses, MKL’s license is not fully compatible with the MIT license favored in the Julia community. You are free to use it, though.

1 Like