ZGGBAL(3)
π ZGGBAL(3) β like, the zggbal.f page but make it make sense
okay so real talk, this is zggbal.f, and it lives in the Library Functions Manual (that's the (3) on the tin, bestie β the 3 is giving "compiled library subroutine"). The full glow-up path is:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zggbal.f
lowkey that /home/abui... shortie in the header is just the terminal being dramatic and eliding the path. the real one is above, no cap.
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine ZGGBAL (job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
work, info)
ZGGBAL β that's her. that's the name. π
πΈ Function/Subroutine Documentation πΈ
subroutine ZGGBAL (character job, integer n, complex*16, dimension( lda, * )
a, integer lda, complex*16, dimension( ldb, * ) b, integer ldb, integer
ilo, integer ihi, double precision, dimension( * ) lscale, double
precision, dimension( * ) rscale, double precision, dimension( * ) work,
integer info)
ZGGBAL π (yes, she gets her own heading, she's the main character)
π¦ Purpose π¦
ZGGBAL balances a pair of general 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 = lambda*B*x.
okay so literally what she does is take your two matrices (A,B) and give them a little self-care session π§ β first she permutes them (similarity transformations, so the eigenvalues stay exactly the same, she's not out here changing your math) to isolate eigenvalues into the first 1 to ILO-1 and last IHI+1 to N spots on the diagonal. then she applies a diagonal similarity transformation to rows and columns ILO to IHI so the rows and columns are as close in norm as possible. both steps are optional, she's flexible like that π«Ά.
and why do we care?? because balancing can reduce the 1-norm of the matrices, and that improves the accuracy of the eigenvalues and/or eigenvectors you compute in the generalized eigenvalue problem A*x = lambda*B*x. iconic behavior tbh. β¨
π Parameters π
JOBβ it'sCHARACTER*1, and it picks which operations get performed onAandB:= 'N': none β she just setsILO = 1,IHI = N,LSCALE(I) = 1.0andRSCALE(I) = 1.0fori=1,...,N;= 'P': permute only;= 'S': scale only;= 'B': both permute and scale. π―ββοΈ
NβINTEGER, the order of the matricesAandB. constraint:N >= 0.AβCOMPLEX*16array, dimension(LDA,N). on entry, it's your input matrixA. on exit,Ais overwritten by the balanced matrix. ifJOB = 'N',Ais not referenced π (she doesn't even look at it).LDAβINTEGER, the leading dimension of the arrayA.LDA >= max(1,N).BβCOMPLEX*16array, dimension(LDB,N). on entry, your input matrixB. on exit,Bis overwritten by the balanced matrix. ifJOB = 'N',Bis not referenced π.LDBβINTEGER, the leading dimension of the arrayB.LDB >= max(1,N).ILOβINTEGER.IHIβINTEGER.ILOandIHIare set to integers such that on exitA(i,j) = 0andB(i,j) = 0ifi > jandj = 1,...,ILO-1ori = IHI+1,...,N. ifJOB = 'N'or'S', thenILO = 1andIHI = N.LSCALEβDOUBLE PRECISIONarray, dimension(N). the deets of the permutations and scaling factors applied to the left side ofAandB. ifP(j)is the index of the row interchanged with rowj, andD(j)is the scaling factor applied to rowj, then:
LSCALE(j) = 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. β
RSCALEβDOUBLE PRECISIONarray, dimension(N). same energy but for the right side ofAandB. ifP(j)is the index of the column interchanged with columnj, andD(j)is the scaling factor applied to columnj, then:
RSCALE(j) = P(j) for J = 1,...,ILO-1
= D(j) for J = ILO,...,IHI
= P(j) for J = IHI+1,...,N.
and again, the order in which the interchanges are made is N to IHI+1, then 1 to ILO-1. π
WORKβDOUBLE PRECISIONarray, dimension(lwork).lworkmust be at leastmax(1,6*N)whenJOB = 'S'or'B', and at least1whenJOB = 'N'or'P'.INFOβINTEGER:= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value. π
π§ Author π§
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
(the whole squad, fr fr π«Ά)
π₯ Further Details: π₯
See R.C. WARD, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
like, go read the receipts if you want the full lore, iykyk π
Definition at line 175 of file zggbal.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (yes bestie, a robot wrote the skeleton β the β¨vibesβ¨ are all mine tho)
π sign-off time π LAPACK, Version 3.12.0 β that's the source + version, and the page itself is /home/abui...RC/zggbal.f(3) (the elided-path version of the header line, keeping it cute). date's folded into that footer line too. mwah. π go balance something. π
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms