BALANC

Indicates how the input matrix will be diagonally scaled and/or permuted to try to improve the conditioning of its eigenvalues. The legal values for BALANC are listed below. Any values not listed below are illegal.


'N' or 'n'

Do not diagonally scale or permute A.


'P' or 'p'

Permute A to make it more nearly upper triangular, but do not diagonally scale A.


'S' or 's'

Diagonally scale A, i.e. replace A by DAD1 for a diagonal matrix D chosen to make the rows and columns of A more equal in norm.


'B' or 'b'

Both diagonally scale and permute A.


Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change the condition number (in exact arithmetic), but balancing does.

JOBVL

Indicates whether or not the left eigenvectors will be computed. The legal values for JOBVL are listed below. Any values not listed below are illegal.


'N' or 'n'

Left eigenvectors will not be computed.


'V' or 'v'

Left eigenvectors will be computed.


If SENSE = 'E', 'e', 'B', or 'b' then JOBVL must be 'V' or 'v'.

JOBVR

Indicates whether or not the right eigenvectors will be computed. The legal values for JOBVR are listed below. Any values not listed below are illegal.


'N' or 'n'

Right eigenvectors will not be computed.


'V' or 'v'

Right eigenvectors will be computed.


If SENSE = 'E', 'e', 'B', or 'b' then JOBVR must be 'V' or 'v'.

SENSE

Indicates which reciprocal condition numbers will be computed, if any. The legal values for SENSE are shown below. Any values not listed below are illegal.


'N' or 'n'

None computed.


'E' or 'e'

Computed for eigenvalues only.


'V' or 'v'

Computed for right eigenvectors only.


'B' or 'b'

Computed for eigenvalues and right eigenvectors.


If SENSE = 'E', 'e', 'B', or 'b' then both left and right eigenvectors must be computed, so both JOBVL and JOBVR must be set to 'V' or 'v'.

N

Order of the matrix A. N 0.

xA

On entry, the matrix A. On exit, xA has been overwritten. If either JOBVL or JOBVR contain 'V' or 'v' then xA contains the Schur form of the balanced A.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA max(1, N).

xWR, xWI

(For real subroutines) On exit, WR and WI contain the real and imaginary parts, respectively, of the N computed eigenvalues. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first.

xW

(For complex subroutines) Computed eigenvalues of A.

xVL

On exit, if JOBVL = 'V' or 'v' then the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If the jth eigenvalue is real, then u(j) = VL(*, j). If the jth and (j+1)th eigenvalues form a complex conjugate pair, then u(j) = VL(*, j) + i × VL(*, j+1) and u(j+1) = VL(*, j) + i × VL(*, j+1). If JOBVL = 'N' or 'n' then VL is not used.

LDVL

Leading dimension of the array VL as specified in a dimension or type statement. LDVL 1. If JOBVL = 'V' or 'v' then LDVL max(1, N).

xVR

On exit, if JOBVR = 'V' or 'v' then the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If the jth eigenvalue is real, then


v(j) = VR(*, j). If the jth and (j+1)th eigenvalues form a complex conjugate pair, then v(j) = VR(*, j) + i × VR(*, j+1) and v(j+1) = VR(*, j) + i × VR(*, j+1). If JOBVR = 'N' or 'n' then VR is not used.

LDVR

Leading dimension of the array VR as specified in a dimension or type statement. LDVR 1. If JOBVR = 'V' or 'v' then LDVR max(1, N).

ILO, IHI

On exit, ILO and IHI contain integer values determined when A was balanced. The balanced A(i,j) = 0 for i > j, 1 j ILO1, and IHI+1 i N.

xSCALE

On exit, details of the permutations and scaling factors applied when balancing A. If P(j) is the index of the row and column interchanged with row and column j, and D(j) is the scaling factor applied to row and column j, then


SCALE(j) = P(j)

for 1 j ILO1


SCALE(j) = D(j)

for ILO j IHI


SCALE(j) = P(j)

for IHI+1 j N


The order in which the interchanges are made is N through IHI+1, then 1 through ILO1.

xABNRM

On exit, the 1norm of the balanced matrix.

xRCONE

On exit, if SENSE = 'E', 'e', 'B', or 'b', then RCONE(j) for 1 j N is the reciprocal condition number of the jth eigenvalue. Otherwise RCONE is not used.

xRCONV

On exit, if SENSE = 'E', 'e', 'B', or 'b', then RCONV(j) for 1 j N is the reciprocal condition number of the jth right eigenvector. Otherwise RCONV is not used.

xWORK

Scratch array with a dimension of LDWORK.

LDWORK

Leading dimension of the array WORK as specified in a dimension or type statement. If SENSE = 'N', 'n', 'E', or 'e', then LDWORK max(1, 2 × N). Otherwise:


For real subroutines:


If JOBVL = 'V' or 'v', then LDWORK max(1, 3 × N).


If SENSE = 'V', 'v', 'B', or 'b' then LDWORK N × (N + 6).


For complex subroutines:


If SENSE = 'V', 'v', 'B', or 'b' then LDWORK N × N + 2 × N.

xWORK2

Scratch array with the following dimension:


For real subroutines: 2 × N  2. If SENSE = 'N', 'n', 'E', or 'e' then WORK2 is not used.


For complex subroutines: 2 × N.

INFO

On exit:


INFO = 0

Subroutine completed normally.


INFO < 0

The ith argument, where i = INFO, had an illegal value.


INFO > 0

The QR algorithm failed to compute all the eigenvalues, and no eigenvectors or condition numbers have been computed. Elements 1 through ILO1 and i+1 through N of WR and WI (or of W), where i = INFO contain eigenvalues that have converged.
