Solving system of linear equations with unknowns in both the left and right hand side.

295 Views Asked by At

I need to solve linear system of the kind: $Lx=Ry$, where $L$ and $R$ are square matrices and $x$ and $y$ are vectors both with knowns and unknowns. The situation is so that for every unknown $x$ the corresponding $y$ is known and vice versa. The system has unique solution for sure. I know that I can solve this system with rearrangement, so that all unknowns are in left hand side and the knowns go to the right hand side. The problem is that I don't want to mess columns of $L$ with those of $R$. Could I use some matrix factorization to transform the system to this form: $Cx=y$. I was thinking of using QR factorization of both $L$ and $R$ but I don't know how efficient it is going to be.

The best solution I can think of (without rearrangement) is to find the QR factorization of $R$ and to use it to find $R^{-1}$ and to left multiply the system by $R^{-1}$. This way I'll end up with the desired form $[R^{-1}L]x = y$, which I know how to solve separately for $x$ and $y$, though this left product matrix could be very messy and it could even be more inefficient than the rearrangement approach.