- A
- (
*input/output*)**REAL**or**COMPLEX**square array, shape .

On entry, the matrix .

On exit,**A**has been overwritten. If the left, the right or both generalized eigenvectors are computed, then**A**contains the first part of the real/complex Schur form of the "balanced" versions of the matrix pair (). - B
- (
*input/output*)**REAL**or**COMPLEX**square array, shape with .

On entry, the matrix .

On exit,**B**has been overwritten. If the left, the right or both generalized eigenvectors are computed, then**B**contains the second part of the real/complex Schur form of the "balanced" versions of the matrix pair (). *alpha*- (
*output*)**REAL**or**COMPLEX**array, shape with .

The values of .

::=**ALPHAR(:), ALPHAI(:)****ALPHA(:)**,

where**ALPHAR(:), ALPHAI(:)**are of**REAL***type*(for the real and imaginary parts) and**ALPHA(:)**is of**COMPLEX***type*. - BETA
- (
*output*)**REAL**or**COMPLEX**array, shape with (**BETA**) (**A**,1).

The values of .

Note: The generalized eigenvalues of the pair are the scalars . These quotients may easily over- or underflow, and may even be zero. Thus, the user should avoid computing them naively.

Note: If A and B are real then complex eigenvalues occur in complex conjugate pairs. Each pair is stored consecutively. Thus a complex conjugate pair is given by

where

- VL
*Optional*(*output*)**REAL**or**COMPLEX**square array, shape with (**VL**, 1) (**A**, 1).

The left generalized eigenvectors are stored in the columns of**VL**in the order of their eigenvalues. Each eigenvector is scaled so the largest component has , except that for eigenvalues with , a zero vector is returned as the corresponding eigenvector.

Note: If and are real then complex eigenvectors, like their eigenvalues, occur in complex conjugate pairs. The real and imaginary parts of the first eigenvector of the pair are stored in**VL**and**VL**. Thus a complex conjugate pair is given by

- VR
*Optional*(*output*)**REAL**or**COMPLEX**square array, shape with (**VR**, 1) (**A**, 1).

The right generalized eigenvectors are stored in the columns of**VR**in the order of their eigenvalues. Each eigenvector is scaled so the largest component has , except that for eigenvalues with , a zero vector is returned as the corresponding eigenvector.

Note: If and are real then complex eigenvectors, like their eigenvalues, occur in complex conjugate pairs. The real and imaginary parts of the first eigenvector of the pair are stored in**VR**and**VR**. Thus a complex conjugate pair is given by

- BALANC
*Optional*(*input*)**CHARACTER(LEN=1)**.

Specifies the balance option to be performed.

Default value: 'N'.

**Note:**Computed reciprocal condition numbers will be for the matrices after balancing. Permuting does not change condition numbers (in exact arithmetic), but scaling does.- ILO,IHI
*Optional*(*output*)**INTEGER**.**ILO**and**IHI**are integer values such that on exit and if and or .

If**BALANC**= 'N' or 'S', then and .- LSCALE
*Optional*(*output*)**REAL**array, shape with .

Details of the permutations and scaling factors applied to the left side of and . If is the index of the row interchanged with row , and is the scaling factor applied to row , then

and

.- RSCALE
*Optional*(*output*)**REAL**array, shape , .

Details of the permutations and scaling factors applied to the right side of and . If is the index of the column interchanged with column , and is the scaling factor applied to column , then

and

.- ABNRM
*Optional*(*output*)**REAL**.

The norm of after balancing.- BBNRM
*Optional*(*output*)**REAL**.

The norm of after balancing.- RCONDE
*Optional*(*output*)**REAL**array, shape with .

The reciprocal condition numbers of the eigenvalues.- RCONDV
*Optional*(*output*)**REAL**array, shape with .

The estimated reciprocal condition numbers of the right eigenvectors. If the eigenvalues cannot be reordered to compute**RCONDV**then**RCONDV**is set to . This can only occur when the true value would be very small.- INFO
*Optional*(*output*)**INTEGER**.

If**INFO**is not present and an error occurs, then the program is terminated with an error message.