Skip to main content
2 of 2
making things clearer, adding comment on solvers
Federico Poloni
  • 20.2k
  • 2
  • 82
  • 120

Another method to update the solution is using the Sherman-Morrison formula: http://en.wikipedia.org/wiki/Sherman%E2%80%93Morrison_formula in your case, $u$ and $v$ are canonical basis vectors.

So basically you have to solve two linear systems with $A$ and then you can update the solution for all possible values of $A$ with little work. Solve $2n$ linear systems, and you can update as many times as you want every entry of $A$ (only one at a time though).

Not sure that this is really your best option though --- all depends on how many "modified systems" you have to solve with the same starting matrix $A$. We need more information from you to decide this.

[By the way, as already pointed out, you'd better use a linear system solver which is suitable for sparse matrices: sparse LU or iterative methods.]

Federico Poloni
  • 20.2k
  • 2
  • 82
  • 120