MATLAB: Further improvement of matrix inversion

efficiencymatrix inversionmex filespeed

Using A\b instead of A^(-1) can be used to speed up a code. 1) How can we further speed up this inversion if we know from the beginning that Cholesky decomposition can apply in our matrix? 2)If we are about to use the inverse matrix to multiply it for more than one b vectors then A\b is still faster or we should save the inverse A^(-1) and then only do the multiplications? Is there a general rule for the number of inversions that one way is faster than the other? 3)If we create a mex file from a function that only contains the A\b command can we speed up the code execution or A\b is fully optimized?
Thank you in advance!

Best Answer

How can we further speed up this inversion if we know from the beginning that Cholesky decomposition can apply in our matrix?
You could possibly speed things up by a small fraction by skipping some of the up-front checking, but I don't know if the effort would be worth it.
If we are about to use the inverse matrix to multiply it for more than one b vectors then A\b is still faster or we should save the inverse A^(-1) and then only do the multiplications? Is there a general rule for the number of inversions that one way is faster than the other?
It would be faster to simply combine all of your b vectors into one matrix and then do A\bcombined.
If we create a mex file from a function that only contains the A\b command can we speed up the code execution or A\b is fully optimized?
For speed & accuracy the mex file would likely simply call the exact same BLAS and LAPACK library routines that MATLAB is already calling. So no speed improvement would be expected.