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, N is INTEGER: the order of the matrix A. And it's gotta be N >= 0. Periodt.
  • A β€” A is COMPLEX*16 array, dimension (LDA,N): the N-by-N Hermitian positive definite matrix whose scaling factors are being computed. Heads up though β€” only the diagonal elements of A are referenced. The rest are just there vibing. πŸ™ˆ
  • LDA β€” LDA is INTEGER: the leading dimension of the array A. Requirement? LDA >= max(1,N). Respect the constraint, okay?
  • S β€” S is DOUBLE PRECISION array, dimension (N): if INFO = 0, S contains the scale factors for A. She's the star of the show. ⭐
  • SCOND β€” SCOND is DOUBLE PRECISION: if INFO = 0, S contains the ratio of the smallest S(i) to the largest S(i). And listen β€” if SCOND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by S. So like, don't do extra work for no reason.
  • AMAX β€” AMAX is DOUBLE PRECISION: the absolute value of the largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled. Wrap it up and protect your numbers, bestie. 😭
  • INFO β€” INFO is INTEGER:
    • = 0: successful exit β€” we love a happy ending 🫢
    • < 0: if INFO = -i, the i-th argument had an illegal value β€” not cute, fix it
    • > 0: if INFO = i, the i-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