We revisit the two standard dense methods for matrix
Sylvester and Lyapunov equations: the Bartels-Stewart method for
$\mathbf{A}_{1}\mathbf{X}+ \mathbf{XA}_{2}+\mathbf{D}=\mathbf{0}$ and Hammarling's method for
$\mathbf{AX}+\mathbf{XA}^{T}+\mathbf{BB}^{T}=\mathbf{0}$ with $\mathbf{A}$ stable. We construct three schemes for solving the unitarily reduced
quasitriangular systems. We also construct a new rank-1 updating
scheme in Hammarling's method. This new scheme is able to
accommodate a $\mathbf{B}$ with more columns than rows as well as the
usual case of a $\mathbf{B}$ with more rows than columns, while
Hammarling's original scheme needs to separate these two cases.
We compared all of our schemes with the Matlab Sylvester and
Lyapunov solver lyap.m; the results show that our
schemes are much more efficient. We also compare our schemes with
the Lyapunov solver sllyap in the currently possibly the
most efficient control library package SLICOT; numerical results
show our scheme to be competitive.