Developer Reference for Intel® oneAPI Math Kernel Library for C
?ggbal
Balances a pair of general real or complex matrices.
Syntax
lapack_int LAPACKE_sggbal ( intmatrix_layout , charjob , lapack_intn , float*a , lapack_intlda , float*b , lapack_intldb , lapack_int*ilo , lapack_int*ihi , float*lscale , float*rscale );
lapack_int LAPACKE_dggbal ( intmatrix_layout , charjob , lapack_intn , double*a , lapack_intlda , double*b , lapack_intldb , lapack_int*ilo , lapack_int*ihi , double*lscale , double*rscale );
lapack_int LAPACKE_cggbal ( intmatrix_layout , charjob , lapack_intn , lapack_complex_float*a , lapack_intlda , lapack_complex_float*b , lapack_intldb , lapack_int*ilo , lapack_int*ihi , float*lscale , float*rscale );
lapack_int LAPACKE_zggbal ( intmatrix_layout , charjob , lapack_intn , lapack_complex_double*a , lapack_intlda , lapack_complex_double*b , lapack_intldb , lapack_int*ilo , lapack_int*ihi , double*lscale , double*rscale );
Include Files
mkl.h
Description
sggbal dggbal cggbal zggbal ggbal
The routine balances a pair of general real/complex matrices ( A , B ). This involves, first, permuting A and B by similarity transformations 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 matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = λ*B*x .
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
job
Specifies the operations to be performed on A and B . Must be ‘N’ or ‘P’ or ‘S’ or ‘B’ .
If job = 'N ' , then no operations are done; simply set ilo =1 , ihi=n , lscale(i)[i] =1.0 and rscale(i)[i]=1.0 for
i = 1,..., n . i = 0,..., n - 1 . If job = 'P' , then permute only. If job = 'S' , then scale only. If job = 'B' , then both permute and scale.
n
The order of the matrices A and B ( n ≥ 0).
- a , b
-
REAL for sggbal DOUBLE PRECISION for dggbal COMPLEX for cggbal DOUBLE COMPLEX for zggbal . Arrays:
a (size max(1, lda * n )) contains the matrix A .
b (size max(1, ldb * n )) contains the matrix B .
If job = 'N' , a and b are not referenced.
lda
The leading dimension of a ; at least max(1, n ).
ldb
The leading dimension of b ; at least max(1, n ).
- work
-
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. Workspace array, size at least max(1, 6n) when job = 'S' or 'B' , or at least 1 when job = 'N' or 'P' .
Output Parameters
- a , b
-
Overwritten by the balanced matrices A and B , respectively.
ilo , ihi
ilo and ihi are set to integers such that on exit Ai, j = 0 and Bi, j = 0 if i>j and j=1,...,ilo-1 or i=ihi+1,..., n .
If job = 'N' or ‘S’ , then ilo = 1 and ihi = n .
- lscale , rscale
-
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. Arrays, size at least max(1, n ). lscale contains details of the permutations and scaling factors applied to the left side of A and B . If Pj is the index of the row interchanged with row j , and Dj is the scaling factor applied to row j , then
lscale(j) [ j - 1] :code:` = ` Pj , for j = 1,..., ilo-1
= D_{j} , for j = ilo,...,ihi= P_{j} , for j = ihi+1,..., n . rscale contains details of the permutations and scaling factors applied to the right side of A and B . If Pj is the index of the column interchanged with column j , and Dj is the scaling factor applied to column j , then
rscale(j) [ j - 1] :code:` = ` Pj , 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.
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = -i , the i -th parameter had an illegal value.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.