gbequ(3)
π¦ gbequ β the equilibration girlies β¨
okay so bestie, listen: this is gbequ from the Library Functions Manual, and she is literally the glow-up artist for band matrices. four routines, one job. let's get into it π
πΈ SYNOPSIS
the four icons in question, all queued up:
subroutine cgbequ (m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
CGBEQU
subroutine dgbequ (m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
DGBEQU
subroutine sgbequ (m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
SGBEQU
subroutine zgbequ (m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info)
ZGBEQU
like yes, the names are just one letter off from each other and that's the whole bit π β one for each precision, same energy.
π₯ DETAILED DESCRIPTION
no cap, this page is basically four copies of the same function wearing different outfits. same purpose, same parameters, same author credits β the only thing that changes is whether your numbers are REAL, DOUBLE PRECISION, or COMPLEX. we love a consistent queen π
π FUNCTION DOCUMENTATION
subroutine cgbequ</p>
subroutine cgbequ (integer m, integer n, integer kl, integer ku, complex,
dimension( ldab, * ) ab, integer ldab, real, dimension( * ) r, real,
dimension( * ) c, real rowcnd, real colcnd, real amax, integer info)
CGBEQU
β¨ Purpose
okay so here's the tea, straight from the source:
!>
!> CGBEQU computes row and column scalings intended to equilibrate an
!> M-by-N band matrix A and reduce its condition number. R returns the
!> row scale factors and C the column scale factors, chosen to try to
!> make the largest element in each row and column of the matrix B with
!> elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
!>
!> R(i) and C(j) are restricted to be between SMLNUM = smallest safe
!> number and BIGNUM = largest safe number. Use of these scaling
!> factors is not guaranteed to reduce the condition number of A but
!> works well in practice.
!>
translation, bestie: she picks scale factors R and C so that B(i,j)=R(i)*A(i,j)*C(j) has the biggest element in every row and column sitting at absolute value 1. it's giving "make the matrix presentable". πΈ
and the vibe check: R(i) and C(j) are clamped between SMLNUM = smallest safe number and BIGNUM = largest safe number. β οΈ important caveat though β using these factors is not guaranteed to reduce the condition number of A. it just works well in practice, iykyk. no lies told.
π Parameters
MβM is INTEGER. the number of rows of the matrixA.M >= 0.NβN is INTEGER. the number of columns of the matrixA.N >= 0.KLβKL is INTEGER. the number of subdiagonals within the band ofA.KL >= 0.KUβKU is INTEGER. the number of superdiagonals within the band ofA.KU >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). the band matrixA, stored in rows 1 toKL+KU+1. and here's exactly how the j-th column ofAlands in the j-th column ofAB:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
LDABβLDAB is INTEGER. the leading dimension of the arrayAB.LDAB >= KL+KU+1.RβR is REAL array, dimension (M). ifINFO = 0, orINFO > M,Rcontains the row scale factors forA.CβC is REAL array, dimension (N). ifINFO = 0,Ccontains the column scale factors forA.ROWCNDβROWCND is REAL. ifINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). ifROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDβCOLCND is REAL. ifINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). ifCOLCND >= 0.1, it is not worth scaling byC.AMAXβAMAX is REAL. absolute value of largest matrix element. ifAMAXis very close to overflow or very close to underflow, the matrix should be scaled.INFOβINFO is INTEGER.
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, and i is
<= M: the i-th row of A is exactly zero
> M: the (i-M)-th column of A is exactly zero
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 152 of file cgbequ.f.
subroutine dgbequ
subroutine dgbequ (integer m, integer n, integer kl, integer ku, double
precision, dimension( ldab, * ) ab, integer ldab, double precision,
dimension( * ) r, double precision, dimension( * ) c, double precision
rowcnd, double precision colcnd, double precision amax, integer info)
DGBEQU
β¨ Purpose
same purpose text, double the precision, same slay:
!>
!> DGBEQU computes row and column scalings intended to equilibrate an
!> M-by-N band matrix A and reduce its condition number. R returns the
!> row scale factors and C the column scale factors, chosen to try to
!> make the largest element in each row and column of the matrix B with
!> elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
!>
!> R(i) and C(j) are restricted to be between SMLNUM = smallest safe
!> number and BIGNUM = largest safe number. Use of these scaling
!> factors is not guaranteed to reduce the condition number of A but
!> works well in practice.
!>
so: R = row scale factors, C = column scale factors, B(i,j)=R(i)*A(i,j)*C(j) should have max absolute value 1 in each row and column, and R(i)/C(j) stay inside SMLNUM β BIGNUM. π«Ά and again β not guaranteed to reduce the condition number of A, just works well in practice. periodt.
π Parameters
MβM is INTEGER. the number of rows of the matrixA.M >= 0.NβN is INTEGER. the number of columns of the matrixA.N >= 0.KLβKL is INTEGER. the number of subdiagonals within the band ofA.KL >= 0.KUβKU is INTEGER. the number of superdiagonals within the band ofA.KU >= 0.ABβAB is DOUBLE PRECISION array, dimension (LDAB,N). the band matrixA, stored in rows 1 toKL+KU+1, and the j-th column ofAlives in the j-th column ofABlike so:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
LDABβLDAB is INTEGER. the leading dimension of the arrayAB.LDAB >= KL+KU+1.RβR is DOUBLE PRECISION array, dimension (M). ifINFO = 0, orINFO > M,Rcontains the row scale factors forA.CβC is DOUBLE PRECISION array, dimension (N). ifINFO = 0,Ccontains the column scale factors forA.ROWCNDβROWCND is DOUBLE PRECISION. ifINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). ifROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDβCOLCND is DOUBLE PRECISION. ifINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). ifCOLCND >= 0.1, it is not worth scaling byC.AMAXβAMAX is DOUBLE PRECISION. absolute value of largest matrix element. ifAMAXis very close to overflow or very close to underflow, the matrix should be scaled.INFOβINFO is INTEGER.
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, and i is
<= M: the i-th row of A is exactly zero
> M: the (i-M)-th column of A is exactly zero
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 151 of file dgbequ.f.
subroutine sgbequ
subroutine sgbequ (integer m, integer n, integer kl, integer ku, real,
dimension( ldab, * ) ab, integer ldab, real, dimension( * ) r, real,
dimension( * ) c, real rowcnd, real colcnd, real amax, integer info)
SGBEQU
β¨ Purpose
you already know the words, but here they are again because every detail matters:
!>
!> SGBEQU computes row and column scalings intended to equilibrate an
!> M-by-N band matrix A and reduce its condition number. R returns the
!> row scale factors and C the column scale factors, chosen to try to
!> make the largest element in each row and column of the matrix B with
!> elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
!>
!> R(i) and C(j) are restricted to be between SMLNUM = smallest safe
!> number and BIGNUM = largest safe number. Use of these scaling
!> factors is not guaranteed to reduce the condition number of A but
!> works well in practice.
!>
single precision this time, same mission: pick R (rows) and C (columns) so B(i,j)=R(i)*A(i,j)*C(j) tops out at absolute value 1, keep R(i) and C(j) in the SMLNUM β¦ BIGNUM safe range, and β οΈ remember the scaling isn't guaranteed to bring the condition number down β it's just good in practice, fr fr.
π Parameters
MβM is INTEGER. the number of rows of the matrixA.M >= 0.NβN is INTEGER. the number of columns of the matrixA.N >= 0.KLβKL is INTEGER. the number of subdiagonals within the band ofA.KL >= 0.KUβKU is INTEGER. the number of superdiagonals within the band ofA.KU >= 0.ABβAB is REAL array, dimension (LDAB,N). the band matrixA, stored in rows 1 toKL+KU+1, with the j-th column ofAsitting in the j-th column ofABas:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
LDABβLDAB is INTEGER. the leading dimension of the arrayAB.LDAB >= KL+KU+1.RβR is REAL array, dimension (M). ifINFO = 0, orINFO > M,Rcontains the row scale factors forA.CβC is REAL array, dimension (N). ifINFO = 0,Ccontains the column scale factors forA.ROWCNDβROWCND is REAL. ifINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). ifROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDβCOLCND is REAL. ifINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). ifCOLCND >= 0.1, it is not worth scaling byC.AMAXβAMAX is REAL. absolute value of largest matrix element. ifAMAXis very close to overflow or very close to underflow, the matrix should be scaled.INFOβINFO is INTEGER.
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, and i is
<= M: the i-th row of A is exactly zero
> M: the (i-M)-th column of A is exactly zero
ok bestie that's where this part wraps β the rest of the icons are still queued up π
INFOβINFO is INTEGER. bestie this is the β¨vibe reportβ¨, read it before you trust anything else:= 0:successful exit π slay, we're done here< 0:ifINFO = -i, the i-th argument had an illegal value π someone passed nonsense, go check argument number i> 0:ifINFO = i, and i is<= M:the i-th row of A is exactly zero π like, entirely zero, no thoughts head empty> M:the (i-M)-th column of A is exactly zero π same energy, but a column
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 151 of file sgbequ.f.
π ZGBEQU π
Okay so now we do the complex version, and honestly? It's the same girl just with better jewelry. Here's the whole signature, no cap:
subroutine zgbequ (integer m, integer n, integer kl, integer ku, complex*16,
dimension( ldab, * ) ab, integer ldab, double precision, dimension( * )
r, double precision, dimension( * ) c, double precision rowcnd, double
precision colcnd, double precision amax, integer info)
ZGBEQU
β¨ Purpose β¨
!>!>ZGBEQU computes row and column scalings intended to equilibrate an!>M-by-N band matrix A and reduce its condition number. R returns the!>row scale factors and C the column scale factors, chosen to try to!>make the largest element in each row and column of the matrix B with!>elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.!>!>R(i) and C(j) are restricted to be between SMLNUM = smallest safe!>number and BIGNUM = largest safe number. Use of these scaling!>factors is not guaranteed to reduce the condition number of A but!>works well in practice.!>
Translating from nerd: it hands you back row scalers R and column scalers C so that every entry of B(i,j)=R(i)*A(i,j)*C(j) lands at absolute value 1 β main character energy for every single element. π¦
Two receipts though, because accuracy is the moment: R(i) and C(j) are clamped between SMLNUM = the smallest safe number and BIGNUM = the largest safe number. And no, this is not guaranteed to actually shrink the condition number of A β it just works well in practice. It's giving "trust me bestie, empirically iconic." π
π Parameters π
MβM is INTEGER, the number of rows of the matrixA. Constraint:M >= 0. Zero rows is legal, we don't judge. πNβN is INTEGER, the number of columns of the matrixA. Constraint:N >= 0. Same deal. πΈKLβKL is INTEGER, the number of subdiagonals within the band ofA. Constraint:KL >= 0. That's the stuff hanging below the main diagonal. β¬οΈKUβKU is INTEGER, the number of superdiagonals within the band ofA. Constraint:KU >= 0. And that's the stuff floating above it. β¬οΈABβAB is COMPLEX*16 array, dimension (LDAB,N). This is the band matrixAitself, packed into rows1toKL+KU+1. The j-th column ofAlives in the j-th column ofAB, and the mapping is literally:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
Memorize the offset ku+1+i-j, iykyk. π₯
LDABβLDAB is INTEGER, the leading dimension of the arrayAB. Must satisfyLDAB >= KL+KU+1. Do not skimp on this one, it's load-bearing. πRβR is DOUBLE PRECISION array, dimension (M). On the way out: ifINFO = 0, orINFO > M, thenRis holding the row scale factors forA. πCβC is DOUBLE PRECISION array, dimension (N). On the way out: ifINFO = 0,Ccontains the column scale factors forA. πROWCNDβROWCND is DOUBLE PRECISION. IfINFO = 0orINFO > M, this is the ratio of the smallestR(i)to the largestR(i). And here's the vibe check: ifROWCND >= 0.1andAMAXis neither too large nor too small, then it is not worth scaling by R. Save yourself the trouble bestie. πCOLCNDβCOLCND is DOUBLE PRECISION. IfINFO = 0, this holds the ratio of the smallestC(i)to the largestC(i). And ifCOLCND >= 0.1, it is not worth scaling byC. Same energy, column edition. β¨AMAXβAMAX is DOUBLE PRECISION, the absolute value of the largest matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled. No debate, it's a whole emergency. π¨INFOβINFO is INTEGER. The finale, the receipts, the group chat read-receipt:= 0:successful exit π< 0:ifINFO = -i, the i-th argument had an illegal value π go fix argument i> 0:ifINFO = i, and i is<= M:the i-th row of A is exactly zero π> M:the (i-M)-th column of A is exactly zero π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 152 of file zgbequ.f.
π Author
Generated automatically by Doxygen for LAPACK from the source code. Not a human, just a very diligent little robot doing its thing. π€
That's the whole page babes β LAPACK, Version 3.12.0, gbequ(3) β go forth and equilibrate responsibly, mwah ππ«Ά
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms