CGBT02(3)
๐ 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 aCHARACTER*1and 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 matrixA. and the rule isM >= 0, always. ๐NโINTEGER, the number of columns of the matrixA. same energy:N >= 0. ๐KLโINTEGER, the number of subdiagonals within the band ofA.KL >= 0or don't even talk to me. ๐ฆKUโINTEGER, the number of superdiagonals within the band ofA.KU >= 0, same rules apply. โจNRHSโINTEGER, the number of columns ofB.NRHS >= 0. we love a consistent queen. ๐AโCOMPLEXarray, dimension(LDA,N). it's the original matrixAin band storage, stored in rows 1 toKL+KU+1. band storage is that girl, it saves so much space fr fr. ๐LDAโINTEGER, the leading dimension of the arrayA. gotta beLDA >= max(1,KL+KU+1). don't skimp on the leading dimension bestie, she will know. ๐XโCOMPLEXarray, 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 arrayX. so: ifTRANS = 'N', thenLDX >= max(1,N); ifTRANS = 'T'or'C', thenLDX >= max(1,M). got it? got it. ๐ซถBโCOMPLEXarray, 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:
Bis overwritten with the differenceB - A*X(yes, she repurposes it, iconic behaviour, no notes) ๐ฅ
LDBโINTEGER, the leading dimension of the arrayB.IF TRANS = 'N', thenLDB >= max(1,M); ifTRANS = 'T'or'C', thenLDB >= max(1,N). ๐RWORKโREALarray, dimension(MAX(1,LRWORK)), whereLRWORK >= MwhenTRANS = 'T'or'C'. otherwise,RWORKis 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
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms