fast linear solvers

625 Views Asked by At

I have a linear system $Ax=b$ that is solved in each time step of a code. the point is that matrix $A$ is constant. only the right hand side $b$ is changing every time step. matrix $A$ is sparse with a size of order $10^6$.

is there a way i can perform just one expensive computation on matrix $A$ once at the beginning of the code to fasten solving the linear system repeatedly after that? this one expensive computation should not be at the expense of storage.

thanks for help

1

There are 1 best solutions below

4
On

So basically you will solve the least squares problem by calculating the pseudo-inverse. This will be $O(n^3)$ complexity and will be your expensive calculation at the beginning. The other operation will be a matrix-vector multiplication $x = A^\dagger b$ which is normally expensive $O(n^2)$ but if your pseudoinverse matrix is sparse then you could use a different way of representing the matrix and multiplying as shown here (https://www.cs.cmu.edu/~scandal/cacm/node9.html). This could greatly speed up your processing.

However, I stumbled across this post (https://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/) that claims that you should just solve the system and save the factorisation and that this would be faster for sparse matrices. Apparently if the matrix is sparse and banded (non-zeros along the diagonals) then it is possible to speed up some of the operations. I hope this helps.