Solution of the Equation $AX + XB = C$ by Inversion of an $M \times M$ or $N \times N$ Matrix