p?gebal
p?gebal
Balances a general real/complex matrix.
Syntax
void psgebal
(
char*
job
,
MKL_INT*
n
,
float*
a
,
MKL_INT*
desca
,
MKL_INT*
ilo
,
MKL_INT*
ihi
,
float*
scale
,
MKL_INT*
info
);
void pdgebal
(
char*
job
,
MKL_INT*
n
,
double*
a
,
MKL_INT*
desca
,
MKL_INT*
ilo
,
MKL_INT*
ihi
,
double*
scale
,
MKL_INT*
info
);
void pcgebal
(
char*
job
,
MKL_INT*
n
,
complex float*
a
,
MKL_INT*
desca
,
MKL_INT*
ilo
,
MKL_INT*
ihi
,
float*
scale
,
MKL_INT*
info
);
void pzgebal
(
char*
job
,
MKL_INT*
n
,
complex double*
a
,
MKL_INT*
desca
,
MKL_INT*
ilo
,
MKL_INT*
ihi
,
double*
scale
,
MKL_INT*
info
);
Include Files
- mkl_scalapack.h
Description
p?gebal
balances a general real/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.
Input Parameters
- job
- (global )Specifies the operations to be performed ona:= 'N': none: simply setilo= 1,ihi=n,;scale[i] = 1.0 fori= 0,...,n-1= 'P': permute only;= 'S': scale only;= 'B': both permute and scale.
- n
- (global )The order of the matrixA(n≥0).
- a
- (local ) Pointer into the local memory to an array of sizelld_a* LOC(cn)This array contains the local pieces of global input matrixA.
- desca
- (global and local) array of sizedlen_.The array descriptor for the distributed matrixA.
OUTPUT Parameters
- a
- On exit,ais overwritten by the balanced matrix.AIfjob= 'N',ais not referenced.See Notes for further details.
- ilo,ihi
- (global )iloandihiare set to integers such that on exit matrix elementsA(i,j) are zero ifi>jandj= 1,...,ilo-1 ori=ihi+1,...,n.Ifjob= 'N' or 'S',ilo= 1 andihi=n.
- scale
- (global ) array of sizen.Details of the permutations and scaling factors applied toa. Ifpjis the index of the row and column interchanged with row and columnjanddjis the scaling factor applied to row and columnj, thenscale[j-1] =pjforj= 1,...,ilo-1,ihi+1,..., nscale[j-1] =djforj=ilo,...,ihiThe order in which the interchanges are made isntoihi+1, then 1 toilo-1.
- info
- (global )= 0: successful exit.< 0: ifinfo= -i, thei-th argument had an illegal value.
Application Notes
The permutations consist of row and column interchanges which put the matrix in the form

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 D
-1
B
D
to make the 1-norms of each row of B
and its corresponding column nearly equal. The output matrix is 
Information about the permutations
P
and the diagonal matrix D
is returned in the vector scale
.