Suppose I have two matrices $A$ and $B$ (let's assume that both $A$ and $B$ are invertible, as is their sum), and a scalar $g$.
I am interested in the matrix
$$M^{-1} = (A + gB)^{-1}$$
I am aware of various expressions for computing this inverse in general, but I am interested in whether, if I calculate $M^{-1}$ for some value of $g$, is there a way to quickly update $M^{-1}$ following an update to the value of $g$?
I am specifically interested in whether this can be done without performing any additional inversions after updating $g$, i.e. if I can just store $A$, $B$, $A^{-1}$, $B^{-1}$ (or some factorizations of them) and the previous value of $g$ in memory, and then somehow update $M^{-1}$ as a function of these?
I've just found this, which suggests a solution if $B=I$, but I fear I may be out of luck for the more general case where $B\neq I$. I would also potentially be interested in solutions which rely on sparsity of either $A$ or $B$, as I may have some cases in which this is true.