?ggbal
?ggbal
Balances a pair of general real or complex matrices.
Syntax
lapack_int LAPACKE_sggbal
(
int
matrix_layout
,
char
job
,
lapack_int
n
,
float*
a
,
lapack_int
lda
,
float*
b
,
lapack_int
ldb
,
lapack_int*
ilo
,
lapack_int*
ihi
,
float*
lscale
,
float*
rscale
);
lapack_int LAPACKE_dggbal
(
int
matrix_layout
,
char
job
,
lapack_int
n
,
double*
a
,
lapack_int
lda
,
double*
b
,
lapack_int
ldb
,
lapack_int*
ilo
,
lapack_int*
ihi
,
double*
lscale
,
double*
rscale
);
lapack_int LAPACKE_cggbal
(
int
matrix_layout
,
char
job
,
lapack_int
n
,
lapack_complex_float*
a
,
lapack_int
lda
,
lapack_complex_float*
b
,
lapack_int
ldb
,
lapack_int*
ilo
,
lapack_int*
ihi
,
float*
lscale
,
float*
rscale
);
lapack_int LAPACKE_zggbal
(
int
matrix_layout
,
char
job
,
lapack_int
n
,
lapack_complex_double*
a
,
lapack_int
lda
,
lapack_complex_double*
b
,
lapack_int
ldb
,
lapack_int*
ilo
,
lapack_int*
ihi
,
double*
lscale
,
double*
rscale
);
Include Files
- mkl.h
Description
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 onAandB. Must be'N'or'P'or'S'or'B'.If, then no operations are done; simply setjob='N ',ilo=1,ihi=nandlscale[=1.0i]forrscale[=1.0i].i= 0,...,n- 1If, then permute only.job='P'If, then scale only.job='S'If, then both permute and scale.job='B'
- n
- The order of the matricesAandB(n≥0).
- a,b
- Arrays:a(size max(1,contains the matrixlda*n))A.b(size max(1,contains the matrixldb*n))B.If,job='N'aandbare not referenced.
- lda
- The leading dimension ofa; at least max(1,n).
- ldb
- The leading dimension ofb; at least max(1,n).
Output Parameters
- a,b
- Overwritten by the balanced matricesAandB, respectively.
- ilo,ihi
- iloandihiare set to integers such that on exitA= 0 andi,jB= 0 ifi,jandi>jorj=1,...,ilo-1.i=ihi+1,...,nIforjob='N''S', thenandilo= 1.ihi=n
- lscale,rscale
- Arrays, size at least max(1,n).lscalecontains details of the permutations and scaling factors applied to the left side ofAandB.IfPis the index of the row interchanged with rowjj, andDis the scaling factor applied to rowjj, then, forlscale[=j- 1]Pjj= 1,...,ilo-1=, forDjj=ilo,...,ihi=, forPj.j=ihi+1,...,nrscalecontains details of the permutations and scaling factors applied to the right side ofAandB.IfPis the index of the column interchanged with columnjj, andDis the scaling factor applied to columnjj, then, forrscale[=j- 1]Pjj= 1,...,ilo-1=, forDjj=ilo,...,ihi=, forPjj=ihi+1,...,nThe order in which the interchanges are made isntoihi+1, then 1 toilo-1.
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the
info
= -i
i
-th parameter had an illegal value.