Recover the inverse after interative solution of a linear system I have solved the linear system $\mathbf{A} \mathbf{x} = \mathbf{b}$ with an iterative solver.  The problem is well-posed ($\mathbf{A}$ is invertible, $\mathbf{b} \ne \mathbf{0}$, blah blah blah).
The question: Is it possible to combine $\mathbf{A}$, $\mathbf{x}$, and $\mathbf{b}$  (all known), to get the inverse $\mathbf{A}^{-1}$?
The context: I am optimizing a function of $\mathbf{x}$, and the parameters that I am optimizing with respect to show up in $\mathbf{A}$ and $\mathbf{b}$.  I need to know the inverse of $\mathbf{A}$ to get the derivatives, i.e.,
$$
\frac{\partial \mathbf{x}}{\partial p} = \mathbf{A}^{-1} \left( \frac{\partial \mathbf{b}}{\partial p} - \frac{\partial \mathbf{A}}{\partial p} \mathbf{x} \right)  ,
$$
where $p$ is one of my parameters, and so on for the Hessian.  A direct solution is out of the question because the problem dimension is very large, so I can't store and re-use one of the triangular factors.  I'm not coming up with anything on my own or in my textbooks, so here I am.

Each columns of the inverse is the solution to $Ax = b$ when $b = e_1,e_2,\dots,e_n$, where $e_i$ are the standard basis vectors.
At the very least, finding $A^{-1}$ from the $x$'s would require that you choose $n$ linearly independent $b$s.  Perhaps you can optimize on which $b$'s you select.
