SRC/dpoequ.f(3)

πŸ’… SRC/dpoequ.f(3) β€” dpoequ

okay so this is a page out of the Library Functions Manual bestie, and it's literally all about one iconic little subroutine named dpoequ and the exact flavor of math it does. she's from the LAPACK library (Version 3.12.0, if we're being specific πŸ‘‘). let's get into it πŸŽ€


✨ SYNOPSIS ✨

Functions/Subroutines

  • subroutine dpoequ (n, a, lda, s, scond, amax, info) β€” the one and only, DPOEQU 🌸

πŸ¦‹ Function/Subroutine Documentation πŸ¦‹

subroutine dpoequ (integer n, double precision, dimension( lda, * ) a,
    integer lda, double precision, dimension( * ) s, double precision scond,
    double precision amax, integer info)

DPOEQU β€” say her name, say it loud πŸ’–

🌟 Purpose 🌟

!> !> DPOEQU computes row and column scalings intended to equilibrate a !> symmetric 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. !>

so basically: she looks at your symmetric positive definite matrix A, and she's like "bestie your condition number is a little loud, let me fix that." she hands you back S, the scale factors, where each S(i) is literally 1/sqrt(A(i,i)) 🧚 and the whole point is that the scaled matrix B (built from B(i,j) = S(i)*A(i,j)*S(j)) ends up with ones on the diagonal. slay. and that particular choice of S gets the condition number of B within a factor N of the smallest possible condition number over all the possible diagonal scalings. main character energy, no cap πŸ‘‘


πŸ’œ Parameters πŸ’œ

  • N β€” N is INTEGER. it's the order of the matrix A, and N >= 0. that's it, that's the whole vibe 🫢
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,N). the N-by-N symmetric positive definite matrix whose scaling factors we're out here computing. heads up tho β€” only the diagonal elements of A are referenced. she does not read the rest of the matrix, she's not nosy πŸ™ˆ
  • LDA β€” LDA is INTEGER. it's the leading dimension of the array A, and it has to be LDA >= max(1,N). non-negotiable, respectfully πŸ’…
  • S β€” S is DOUBLE PRECISION array, dimension (N). if INFO = 0, S contains the scale factors for A. the stars 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 like β€” yes, the doc literally says S there and not SCOND, that's not me, i'm just the messenger 😭 β€” anyway: if SCOND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by S. so don't bother, save yourself the trouble fr fr
  • AMAX β€” AMAX is DOUBLE PRECISION. it's 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. like. please. do it πŸ”₯
  • INFO β€” INFO is INTEGER. the whole mood report:
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ’€
    • > 0: if INFO = i, the i-th diagonal element is nonpositive πŸ™ƒ

πŸ‘‘ Author πŸ‘‘

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

πŸ“– Definition at line 111 of file dpoequ.f.


πŸ“ Author (the meta one) πŸ“

Generated automatically by Doxygen for LAPACK from the source code. yes, a machine wrote this part. she's still iconic tho πŸ€–πŸ’–


aaand that's the whole page bestie, no notes, ate and left no crumbs 🌈 okay but fr β€” this was LAPACK, Version 3.12.0, and you just read SRC/dpoequ.f(3) πŸŽ€πŸ’…πŸ«Ά iykyk

πŸ“¦ where this page comes from