CGBT02(3)

๐Ÿ“ฆ version 3.12.0, in opensuse-leap 16.0

๐Ÿ’… CGBT02(3) โ€” like, the iconic LAPACK banded-residual checker ๐ŸŽ€

okay bestie, so you've stumbled into the Library Functions Manual (yes, that's the manual name, hi, welcome, make yourself comfy โœจ) and the star of the show is a little Fortran file living its best life at:

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/LIN/cgbt02.f

that's the whole NAME section, no notes ๐Ÿ’€ she's literally just a path and a dream.


โœจ SYNOPSIS โœจ

Functions/Subroutines ๐Ÿฆ‹

subroutine CGBT02 (trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb,
    rwork, resid)
CGBT02

yeah that's it. that's the vibe check. ๐Ÿ‘‘


๐ŸŒธ Function/Subroutine Documentation ๐ŸŒธ

subroutine CGBT02 (character trans, integer m, integer n, integer kl,
    integer ku, integer nrhs, complex, dimension( lda, * ) a, integer lda,
    complex, dimension( ldx, * ) x, integer ldx, complex, dimension( ldb, *
    ) b, integer ldb, real, dimension( * ) rwork, real resid)

CGBT02 โ€” she's back, she's serving, she's the same girl as above ๐Ÿ’–

๐ŸŽฏ Purpose

so here's the tea, and it's literally in a !> block in the original so you know it's official:

!>
!> CGBT02 computes the residual for a solution of a banded system of
!> equations op(A)*X = B:
!>    RESID = norm(B - op(A)*X) / ( norm(op(A)) * norm(X) * EPS ),
!> where op(A) = A, A**T, or A**H, depending on TRANS, and EPS is the
!> machine epsilon.
!>

translation bestie: she checks how wrong your answer is. RESID = the size of B - op(A)*X, divided by norm(op(A)) * norm(X) * EPS. and op(A) is whatever TRANS tells her to be โ€” plain A, A**T, or A**H. EPS is machine epsilon, no cap. ๐Ÿงฎโœจ


๐Ÿ’… Parameters

  • TRANS โ€” girl, this one's a CHARACTER*1 and she picks the form of the system:
= 'N':  A    * X = B  (No transpose)
= 'T':  A**T * X = B  (Transpose)
= 'C':  A**H * X = B  (Conjugate transpose)

that's it, that's the whole menu ๐Ÿ“

  • M โ€” INTEGER, the number of rows of the matrix A. and the rule is M >= 0, always. ๐Ÿ™
  • N โ€” INTEGER, the number of columns of the matrix A. same energy: N >= 0. ๐Ÿ’œ
  • KL โ€” INTEGER, the number of subdiagonals within the band of A. KL >= 0 or don't even talk to me. ๐Ÿฆ‹
  • KU โ€” INTEGER, the number of superdiagonals within the band of A. KU >= 0, same rules apply. โœจ
  • NRHS โ€” INTEGER, the number of columns of B. NRHS >= 0. we love a consistent queen. ๐Ÿ‘‘
  • A โ€” COMPLEX array, dimension (LDA,N). it's the original matrix A in band storage, stored in rows 1 to KL+KU+1. band storage is that girl, it saves so much space fr fr. ๐ŸŽ€
  • LDA โ€” INTEGER, the leading dimension of the array A. gotta be LDA >= max(1,KL+KU+1). don't skimp on the leading dimension bestie, she will know. ๐Ÿ’€
  • X โ€” COMPLEX array, dimension (LDX,NRHS). the computed solution vectors for the system of linear equations. she's the answer, allegedly. ๐Ÿ˜ญ
  • LDX โ€” INTEGER, the leading dimension of the array X. so: if TRANS = 'N', then LDX >= max(1,N); if TRANS = 'T' or 'C', then LDX >= max(1,M). got it? got it. ๐Ÿซถ
  • B โ€” COMPLEX array, dimension (LDB,NRHS). this one's doing a whole costume change:
    • on entry: the right hand side vectors for the system of linear equations ๐Ÿงš
    • on exit: B is overwritten with the difference B - A*X (yes, she repurposes it, iconic behaviour, no notes) ๐Ÿ”ฅ
  • LDB โ€” INTEGER, the leading dimension of the array B. IF TRANS = 'N', then LDB >= max(1,M); if TRANS = 'T' or 'C', then LDB >= max(1,N). ๐Ÿ’–
  • RWORK โ€” REAL array, dimension (MAX(1,LRWORK)), where LRWORK >= M when TRANS = 'T' or 'C'. otherwise, RWORK is not referenced โ€” she's off the clock, do not disturb. ๐Ÿ™ˆ
  • RESID โ€” REAL, and this is the main character right here: the maximum over the number of right hand sides of
norm(B - op(A)*X) / ( norm(op(A)) * norm(X) * EPS ).

like, the final score. the report card. the whole point of the exercise โญ๐Ÿ‘‘


๐Ÿ‘‘ Author

all of these absolute legends:

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

Definition at line 146 of file cgbt02.f. ๐Ÿ“ (iykyk โ€” if you need the exact line, now you have it, you're welcome)


๐ŸŒˆ Author (again, but the meta one)

Generated automatically by Doxygen for LAPACK from the source code. our robot overlord wrote this one, slay. ๐Ÿค–โœจ


๐Ÿ’€ psst โ€” this is test code (TESTING/LIN/), it computes residuals, it does not solve your system for you. don't @ me, that's literally just what the path says.

okay that's the whole page bestie!! ๐ŸŽ€โœจ

cute little sign-off: this gorgeous document came from LAPACK, Version 3.12.0, and it's dated /home/abui...IN/cgbt02.f(3) โ€” yes the date field is a truncated path, we don't question it, we just vibe ๐Ÿฆ‹๐Ÿ’œ

๐Ÿ“ฆ where this page comes from