SRC/cpocon.f(3)

πŸ¦‹ SRC/cpocon.f πŸ¦‹

Okay bestie, buckle up and grab your iced coffee because we're about to get intimate with some linear algebra realness. This is a Fortran subroutine from the LAPACK library, and honestly? It's kind of iconic.


✨ NAME ✨

SRC/cpocon.f β€” the file you're looking at, and yes, the .f is giving classic Fortran main character energy πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

So here's the whole function and subroutine situation in all its glory:

subroutine cpocon (uplo, n, a, lda, anorm, rcond, work, rwork, info)
    CPOCON

🌸 Function/Subroutine Documentation 🌸

πŸ’– The Signature πŸ’–

subroutine cpocon (character uplo, integer n, complex, dimension( lda, * )
    a, integer lda, real anorm, real rcond, complex, dimension( * ) work,
    real, dimension( * ) rwork, integer info)

Okay so this is CPOCON. Say it with me: C-P-O-C-O-N. Lowkey sounds like a Pokémon but it's actually a real-deal LAPACK routine. 🌈


πŸ”₯ Purpose πŸ”₯

Bestie, listen. CPOCON is out here estimating the reciprocal of the condition number β€” in the 1-norm, no less β€” of a complex Hermitian positive definite matrix. Like, that's a whole lot of adjectives and every single one matters.

The way it does this? It uses the Cholesky factorization that was already computed by CPOTRF, specifically:

  • A = U**H*U
  • A = L*L**H

One of those. Depends on the vibe. 🫢

Then it gets an estimate for norm(inv(A)), and computes the reciprocal condition number like so:

RCOND = 1 / (ANORM * norm(inv(A)))

No cap, that's the whole formula. Copy it. Save it. Live by it. ✨


πŸ‘‘ Parameters πŸ‘‘

Okay, this is the part where we go through every single argument, and I mean every single one. No skipping. Periodt.

πŸ’… UPLO

UPLO is CHARACTER*1. It's literally just telling you which triangle of A is stored. Cute, right?

  • = 'U': Upper triangle of A is stored 🌸
  • = 'L': Lower triangle of A is stored πŸ¦‹

That's it. That's the whole option set. Pick your fighter.

πŸ’œ N

N is INTEGER. It's the order of the matrix A. So like, if A is NΓ—N, this is the N. And bestie, N >= 0. Always. No negative orders. Not today.

πŸ’– A

A is a COMPLEX array, dimension (LDA,N). This is the main character right here β€” the triangular factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H, as computed by CPOTRF.

In other words: CPOTRF did the hard work, and CPOCON is here to evaluate the vibe of it. Iconic teamwork, honestly.

πŸŽ€ LDA

LDA is INTEGER β€” the leading dimension of the array A. And the rule is:

LDA >= max(1,N)

You cannot mess this up. Do not try it. The max is there for a reason. πŸ™ˆ

⭐ ANORM

ANORM is REAL. This one is the 1-norm (or infinity-norm) of the Hermitian matrix A. That's it. That's the assignment.

🌈 RCOND

RCOND is REAL. This is where the magic number lives:

The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an estimate of the 1-norm of inv(A) computed in this routine.

So like, AINVNM is the estimate, and RCOND is you dividing 1 by stuff. Math. Slay.

🧚 WORK

WORK is a COMPLEX array, dimension (2*N).

Two times N. Not N. Not 3*N. 2*N. Write that down. πŸ’€

πŸ“ RWORK

RWORK is a REAL array, dimension (N).

Just N this time. Don't get it twisted with WORK. They're different. They are not the same array. πŸ™…β€β™€οΈ

πŸ”₯ INFO

INFO is INTEGER, and it's the whole status report of the operation. Here's the full tea:

  • = 0: successful exit β€” like, we ate, no crumbs 🌟
  • < 0: if INFO = -i, the i-th argument had an illegal value β€” somebody messed up and INFO is telling on them, gently but firmly πŸ’…

πŸ‘‘ Author πŸ‘‘

This masterpiece was brought to you by a whole collab of big-brain institutions:

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

And it is defined at line 119 of file cpocon.f. Yes, they counted the lines, don't @ me. πŸ’–


🌟 Author (the other one, lmao) 🌟

This documentation was generated automatically by Doxygen for LAPACK from the source code. So like, no human typed this for fun (except me, right now, for you). The robots handled it. πŸ€–βœ¨


Okay bestie, that's the whole thing. LAPACK, Version 3.12.0, from SRC/cpocon.f(3). Now go forth and estimate those condition numbers. You've got this. πŸ’œπŸ¦‹πŸŒΈβœ¨
πŸ“¦ where this page comes from