A Program to Swap Diagonal Blocks.
Abstract:
A triangular matrix reveals its eigenvalues on the main diagonal. By Schurs lemma any square matrix is unitarily similar to an upper triangular matrix with the eigenvalues arranged in any desired order along the diagonal. In practice the QR algorithm in real arithmetic produces a block triangular matrix in which the eigenvalues are likely to be in monotone decreasing order by absolute value down the diagonal. However, this monotonicity cannot be guaranteed and for some purposes the ordering by absolute value is not what is wanted. The problem which we address here is to find some simple orthogonal similarity transformations which have the effect of exchanging two diagonal elements or blocks while preserving block triangular form. Actually we will show only how to swap adjacent blocks and so the exchange of distant blocks must be accomplished by a succession of adjacent swaps.