SRC/zpoequ.f(3)
β¨ SRC/zpoequ.f β the glow-up edition β¨
Okay so bestie, let me tell you about this little icon from the Library Functions Manual. It's a Fortran subroutine that does some serious main-character math, and honestly? It's giving "quietly brilliant." Let's get into it. π
π SYNOPSIS π
Functions/Subroutines
subroutine zpoequ (n, a, lda, s, scond, amax, info)β the one and only ZPOEQU, slaying as usual.
π Function/Subroutine Documentation π
subroutine zpoequ (integer n, complex*16, dimension( lda, * ) a, integer lda, double precision, dimension( * ) s, double precision scond, double precision amax, integer info)
ZPOEQU β yes, that's her name, no notes. π
πΈ Purpose πΈ
!>!> ZPOEQU computes row and column scalings intended to equilibrate a!> Hermitian positive definite matrix A and reduce its condition number!> (with respect to the two-norm). S contains the scale factors,!> S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with!> elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal. This!> choice of S puts the condition number of B within a factor N of the!> smallest possible condition number over all possible diagonal!> scalings.!>
Okay so lowkey this subroutine is out here doing a full vibe check on your matrix A. It's computing row and column scalings to equilibrate a Hermitian positive definite matrix and bring that condition number down (two-norm style, obviously). The scale factors live in S, and they're literally S(i) = 1/sqrt(A(i,i)) β chosen so the scaled matrix B (with elements B(i,j) = S(i)*A(i,j)*S(j), no cap) ends up with ones on the diagonal. Iconic behavior. This choice of S keeps the condition number of B within a factor N of the smallest possible condition number over all possible diagonal scalings. Slay. π₯
π¦ Parameters π¦
Nβ bestie,NisINTEGER: the order of the matrixA. And it's gotta beN >= 0. Periodt.AβAisCOMPLEX*16 array, dimension (LDA,N): theN-by-NHermitian positive definite matrix whose scaling factors are being computed. Heads up though β only the diagonal elements ofAare referenced. The rest are just there vibing. πLDAβLDAisINTEGER: the leading dimension of the arrayA. Requirement?LDA >= max(1,N). Respect the constraint, okay?SβSisDOUBLE PRECISION array, dimension (N): ifINFO = 0,Scontains the scale factors forA. She's the star of the show. βSCONDβSCONDisDOUBLE PRECISION: ifINFO = 0,Scontains the ratio of the smallestS(i)to the largestS(i). And listen β ifSCOND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byS. So like, don't do extra work for no reason.AMAXβAMAXisDOUBLE PRECISION: the absolute value of the largest matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled. Wrap it up and protect your numbers, bestie. πINFOβINFOisINTEGER:= 0: successful exit β we love a happy ending π«Ά< 0: ifINFO = -i, thei-th argument had an illegal value β not cute, fix it> 0: ifINFO = i, thei-th diagonal element is nonpositive β also not it, bestie
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 112 of file zpoequ.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (Doxygen did its thing, no cap.)
And that's the whole page, bestie β LAPACK, Version 3.12.0, SRC/zpoequ.f(3). Now go forth and scale those matrices responsibly. π
β¨π
π¦ 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