Solve for X sandwiched between 2 lower triangular matrix

99 Views Asked by At

Given $L, K$ are n by n are lower triangular matrix. $B$ is general n by n matrix. How can I write an algorithm for solving for $X$ in $LXK = B $. I have written an algorithm for simple $Lx = b$ using back substitution and solving for x. Is there a way I can relate that to the current problem at hand: $LXK = B$ ?

2

There are 2 best solutions below

1
On

For $Lx=b$

For simplicity lets take an example and solve it in the case $n=3$

$L=\begin{pmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ 0 & 2 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix}$

Thus we solve it by multiplying what is on the left hand side by each other and we get that

$\begin{aligned} x_1 &=1 \\ -x_1+x_2 &= 2 \\ 2x_2 +x_3 &=3 \end{aligned} $

1
On

Using vectorization and Kronecker product $LXK=B$ is equivalent to solving $$(K^T\otimes L)\mathrm{vec}(X)=\mathrm{vec}(B).$$ Thanks to the structure of $L$ and $K$, the matrix $K^T\otimes L$ has also a special structure (upper block triangular with lower triangular blocks).