Assume 2 n x ntwo $n \times n$ matrices A$A$ and B$B$ are known before hand and any precomputation can be done on them. Is there an efficient way to solve a set of linear problems: (A+w1 B) x1 = y1, (A+w2 B) x2 = y2, ...$$ \begin{split} (A+w_1 B) x_1 &= y_1, \\ (A+w_2 B) x_2 &= y_2, \\ &\vdots \end{split} $$ where w1, w2, ...$w_1, w_2, \dotsc$ are diagonal matrices (weights of a set of constraints), x1, x2, ...$x_1, x_2, \dotsc$ are unknown vectors and y1, y2, ...$y_1, y_2, \dotsc$ are right hand side vectors.
If w1 = w2 = ... = w$w_1 = w_2 = \dotsb = w$, then we can LU decompose (A+w B)$A+w B$ and simply solve for all (x, y) pairs$x_i$. Now the problem is that w1, w2, ...$w_1, w_2, \dotsc$ are different. So do I have to solve each problem individually or is there a more efficient way?