Solving two sparse linear systems one is the transpose of the other

I’m solving two sparse linear systems (A^T) * x_1 = b_1 and A * x_2 = b_2.
where A^T is the transpose of A and b_1, b_2 are different.
With a direct LU solver. How can I factorize once and use it to solve the two linear systems.

you can use

p = lu(A)
pt = p'
x_1 = pt\b_1
x_2 = p\b_2
4 Likes

thank you :slight_smile:

1 Like