XLPack 6.1
Excel VBA Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ Zgebal()

Sub Zgebal ( Job As  String,
N As  Long,
A() As  Complex,
Ilo As  Long,
Ihi As  Long,
Scal() As  Double,
Info As  Long 
)

Balancing of a complex general matrix

Purpose
This routine balances a general complex matrix A. This involves, first, permuting A by a similarity transformation to isolate eigenvalues in the first 1 to Ilo-1 and last Ihi+1 to N elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns Ilo to Ihi to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrix, and improve the accuracy of the computed eigenvalues and/or eigenvectors.
Parameters
[in]JobSpecifies the operations to be performed on A.
= "N": None: Simply set Ilo = 1, Ihi = N, Scal(i) = 1.0 for i = 0, ..., N-1.
= "P": Permute only.
= "S": Scal only.
= "B": Both permute and scale.
[in]NOrder of the matrix A. (N >= 0) (If N = 0, returns without computation)
[in,out]A()Array A(LA1 - 1, LA2 - 1) (LA1 >= N, LA2 >= N)
[in] The input matrix A.
[out] A() is overwritten by the balanced matrix. If Job = "N", A() is not referenced. See Further Details.
[out]Ilo
[out]IhiIlo and Ihi are set to integers such that on exit
Aij = 0 if i > j and j = 1, ..., Ilo-1 or i = Ihi+1, ..., N.
If Job = "N" or "S", Ilo = 1 and Ihi = N.
[out]Scal()Array Scal(LScal - 1) (LScal >= N) Details of the permutations and scaling factors applied to 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
Scal(j-1) = P(j) for j = 1, ..., Ilo-1
= D(j) for j = Ilo, ..., Ihi
= P(j) for j = Ihi+1, ..., N.
The order in which the interchanges are made is N to Ihi+1, then 1 to Ilo-1.
[out]Info= 0: Successful exit.
= -1: The argument Job had an illegal value. (Job <> "N", "P", "S" nor "B")
= -2: The argument N had an illegal value. (N < 0)
= -3: The argument A() is invalid.
= -6: The argument Scal() is invalid.
Further Details
The permutations consist of row and column interchanges which put the matrix in the form
( T1 X Y )
P A P = ( 0 B Z )
( 0 0 T2 )
where T1 and T2 are upper triangular matrices whose eigenvalues lie along the diagonal. The column indices Ilo and Ihi mark the starting and ending columns of the submatrix B.

Balancing consists of applying a diagonal similarity transformation inv(D) * B * D to make the 1-norms of each row of B and its corresponding column nearly equal. The output matrix is
( T1 X*D Y )
( 0 inv(D)*B*D inv(D)*Z ).
( 0 0 T2 )
Information about the permutations P and the diagonal matrix D is returned in the vector Scal().

This subroutine is based on the EISPACK routine BALANC. Modified by Tzu-Yi Chen, Computer Science Division, University of California at Berkeley, USA
Reference
LAPACK