# b?laexc

Swaps adjacent diagonal blocks of a real upper quasi-triangular matrix in Schur canonical form, by an orthogonal similarity transformation.

## Syntax

call bslaexc( n, t, ldt, j1, n1, n2, itraf, dtraf, work, info )

call bdlaexc( n, t, ldt, j1, n1, n2, itraf, dtraf, work, info )

## Description

b?laexc swaps adjacent diagonal blocks T11 and T22 of order 1 or 2 in an upper quasi-triangular matrix T by an orthogonal similarity transformation.

In contrast to the LAPACK routine ?laexc, the orthogonal transformation matrix Q is not explicitly constructed but represented by parameters contained in the arrays itraf and dtraf. See the description of b?trexc for more details.

T must be in Schur canonical form, that is, block upper triangular with 1-by-1 and 2-by-2 diagonal blocks; each 2-by-2 diagonal block has its diagonal elements equal and its off-diagonal elements of opposite sign.

## Input Parameters

n

INTEGER

The order of the matrix T. n 0.

t

REAL for bslaexc

DOUBLE PRECISION for bdlaexc

Array of size (ldt,n).

The upper quasi-triangular matrix T, in Schur canonical form.

ldt

INTEGER

The leading dimension of the array t. ldt max(1,n).

j1

INTEGER

The index of the first row of the first block T11.

n1

INTEGER

The order of the first block T11. n1 = 0, 1 or 2.

n2

INTEGER

The order of the second block T22. n2 = 0, 1 or 2.

work

REAL for bslaexc

DOUBLE PRECISION for bdlaexc

(Workspace) array of size n.

## OUTPUT Parameters

t

The updated matrix T, in Schur canonical form.

itraf

INTEGER array, length k, where

k = 1, if n1+n2 = 2;

k = 2, if n1+n2 = 3;

k = 4, if n1+n2 = 4.

List of parameters for representing the transformation matrix Q, see b?trexc.

dtraf

REAL for bslaexc

DOUBLE PRECISION for bdlaexc

Array, length k, where

k = 2, if n1+n2 = 2;

k = 5, if n1+n2 = 3;

k = 10, if n1+n2 = 4.

List of parameters for representing the transformation matrix Q, see b?trexc.

info

INTEGER

= 0: successful exit

= 1: the transformed matrix T would be too far from Schur form; the blocks are not swapped and T and Q are unchanged.