SRC/cptcon.f(3)

πŸ’… SRC/cptcon.f πŸ’…

okay so this is a page from the Library Functions Manual, and it's literally all about one lil subroutine that does one very specific slay. let's get into it 🫢


✨ NAME ✨

SRC/cptcon.f β€” bestie, that's the whole name, that's the file, that's the vibe πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

Functions/Subroutines

  • subroutine cptcon (n, d, e, anorm, rcond, rwork, info) β€” this is the one, this is CPTCON herself πŸ‘‘

🌸 Function/Subroutine Documentation 🌸

subroutine cptcon (integer n, real, dimension( * ) d, complex, dimension( * ) e, real anorm, real rcond, real, dimension( * ) rwork, integer info)

CPTCON β€” icon behavior, no notes πŸ”₯

πŸŽ€ Purpose:

okay so here's the whole point of her existence, pay attention bestie:

!>
!> CPTCON computes the reciprocal of the condition number (in the
!> 1-norm) of a complex Hermitian positive definite tridiagonal matrix
!> using the factorization A = L*D*L**H or A = U**H*D*U computed by
!> CPTTRF.
!>
!> Norm(inv(A)) is computed by a direct method, and the reciprocal of
!> the condition number is computed as
!>                  RCOND = 1 / (ANORM * norm(inv(A))).
!>

so like. it takes a complex Hermitian positive definite tridiagonal matrix, uses the factorization A = L*D*L**H or A = U**H*D*U that CPTTRF already did, computes norm(inv(A)) by a direct method (no games), and then hits you with RCOND = 1 / (ANORM * norm(inv(A))). periodt. πŸ’…

✨ Parameters ✨

  • N β€” N is INTEGER, and it's the order of the matrix A. the rule is N >= 0, we do not do negative orders here πŸ™ˆ
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!>
  • D β€” D is a REAL array, dimension (N). it's holding the n diagonal elements of the diagonal matrix D from the factorization of A, exactly as CPTTRF computed them πŸ“
!>          D is REAL array, dimension (N)
!>          The n diagonal elements of the diagonal matrix D from the
!>          factorization of A, as computed by CPTTRF.
!>
  • E β€” E is a COMPLEX array, dimension (N-1). the (n-1) off-diagonal elements of the unit bidiagonal factor U or L from the factorization of A, as computed by CPTTRF. note the N-1, she's one shorter, that's not a typo bestie πŸ¦‹
!>          E is COMPLEX array, dimension (N-1)
!>          The (n-1) off-diagonal elements of the unit bidiagonal factor
!>          U or L from the factorization of A, as computed by CPTTRF.
!>
  • ANORM β€” ANORM is REAL. it's the 1-norm of the original matrix A. like, the original original, not the factored one πŸ’œ
!>          ANORM is REAL
!>          The 1-norm of the original matrix A.
!>
  • RCOND β€” RCOND is REAL, and this is the output moment, the main character reveal πŸ‘‘ it's the reciprocal of the condition number of the matrix A, computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is the 1-norm of inv(A) computed in this routine. she's computed right here, in this routine, homegrown πŸŽ€
!>          RCOND is REAL
!>          The reciprocal of the condition number of the matrix A,
!>          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is the
!>          1-norm of inv(A) computed in this routine.
!>
  • RWORK β€” RWORK is a REAL array, dimension (N). that's it, that's the whole description, she's a workspace, she works, respect her 🌈
!>          RWORK is REAL array, dimension (N)
!>
  • INFO β€” INFO is INTEGER, aka the vibe check on whether it worked:
    • = 0 β†’ successful exit, we love a win πŸ’–
    • < 0 β†’ if INFO = -i, the i-th argument had an illegal value. so like, you broke it, that's on you 😭
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>

πŸ’€ Author

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

(the whole squad, iconic collab 🫢)

πŸ”₯ Further Details:

!>
!>  The method used is described in Nicholas J. Higham, , SIAM J. Sci. Stat. Comput., Vol. 7, No. 1, January 1986.
!>

yes bestie, there's a paper, the method is cited, we love a documented algorithm, iykyk πŸ“š

⭐ Definition at line 118 of file cptcon.f.


🌸 Author 🌸

Generated automatically by Doxygen for LAPACK from the source code. (she didn't write herself, a robot did, but she's still slaying ✨)


ngl, if RCOND comes back looking crusty, that matrix is lowkey ill-conditioned and you should maybe rethink some things πŸ™ˆ

that's the page bestie, go forth and condition some numbers πŸ’…πŸ’–

LAPACK β€” Version 3.12.0 β€” SRC/cptcon.f(3) β€” mwah, catch you on the next manpage πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from