Bartels–Stewart algorithm (source code)

= Bartels–Stewart algorithm
{wiki=Bartels–Stewart_algorithm}

The Bartels–Stewart algorithm is a numerical method used for solving the matrix equation of the form: \\\[ AX + XB = C \\\] where \\(A\\), \\(B\\), and \\(C\\) are given matrices, and \\(X\\) is the unknown matrix to be determined. This type of equation is known as a Lyapunov equation when \\(B\\) is skew-symmetric or a Sylvester equation in general.