TESTING/LIN/sqrt17.f(3)

๐Ÿ“ฆ
version 3.12.1 ยท 3 versions
, in arch rolling

๐ŸŒธ TESTING/LIN/sqrt17.f(3) ๐ŸŒธ

okay bestie, so this one's a page from Library Functions Manual โ€” yes, we're in the mood, we're reading a Fortran manpage ๐Ÿ’… and honestly? she kinda ate. Let's get into it.


โœจ NAME โœจ

TESTING/LIN/sqrt17.f โ€” like, that's literally her. that's the whole name. no notes. ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

Functions/Subroutines

  • real function sqrt17 (trans, iresid, m, n, nrhs, a, lda, x, ldx, b, ldb, c, work, lwork) โ€” SQRT17 ๐Ÿ‘‘

๐Ÿ’– Function/Subroutine Documentation ๐Ÿ’–

๐ŸŒŸ the signature (copy it exactly, i'm not kidding) ๐ŸŒŸ

   real function sqrt17 (character trans, integer iresid, integer m, integer n,
       integer nrhs, real, dimension( lda, * ) a, integer lda, real, dimension(
       ldx, * ) x, integer ldx, real, dimension( ldb, * ) b, integer ldb, real,
       dimension( ldb, * ) c, real, dimension( lwork ) work, integer lwork)

SQRT17 โ€” that's her name, that's her whole vibe. ๐Ÿซถ


๐Ÿงฎ Purpose ๐Ÿงฎ

okay so listen, this function is out here computing a ratio, and it's giving very much "math girlboss":

   norm(R**T * op(A)) / ( norm(A) * alpha * max(M,N,NRHS) * EPS ),

where the residual R = B - op(A)*X, and op(A) is either A or A**T depending on TRANS. EPS is the machine epsilon (slay ๐Ÿ’…), and then:

   alpha = norm(B) if IRESID = 1 (zero-residual problem)
   alpha = norm(R) if IRESID = 2 (otherwise).

and the norm in question? the 1-norm. iconic. periodt. ๐Ÿ”ฅ


๐ŸŽ€ Parameters ๐ŸŽ€

  • TRANS โ€” she's a CHARACTER*1 and she decides whether the transpose of A gets used or not:
    • = 'N': no transpose, so op(A) = A. easy. ๐Ÿ’œ
    • = 'T': transpose, so op(A) = A**T. spicy. ๐ŸŒถ๏ธ
  • IRESID โ€” an INTEGER, and honestly she's just here to label your situation:
    • IRESID = 1 means zero-residual problem ๐Ÿ“
    • IRESID = 2 means non-zero residual ๐Ÿ˜ญ
  • M โ€” INTEGER, the number of rows of the matrix A. but also, plot twist:
    • if TRANS = 'N', it's the number of rows of the matrix B
    • if TRANS = 'T', it's the number of rows of the matrix X
  • N โ€” INTEGER, the number of columns of the matrix A. and again, the plot thickens:
    • if TRANS = 'N', it's the number of rows of the matrix X
    • if TRANS = 'T', it's the number of rows of the matrix B
  • NRHS โ€” INTEGER, the number of columns of the matrices X and B. that's it. that's her job. ๐ŸŒˆ
  • A โ€” REAL array, dimension (LDA,N) โ€” the m-by-n matrix A. main character energy, honestly. ๐Ÿ‘‘
  • LDA โ€” INTEGER, the leading dimension of the array A. constraint: LDA >= M. don't test her. โญ
  • X โ€” REAL array, dimension (LDX,NRHS):
    • if TRANS = 'N', it's the n-by-nrhs matrix X
    • if TRANS = 'T', it's the m-by-nrhs matrix X
  • LDX โ€” INTEGER, the leading dimension of the array X:
    • if TRANS = 'N', then LDX >= N
    • if TRANS = 'T', then LDX >= M
  • B โ€” REAL array, dimension (LDB,NRHS):
    • if TRANS = 'N', it's the m-by-nrhs matrix B
    • if TRANS = 'T', it's the n-by-nrhs matrix B
  • LDB โ€” INTEGER, the leading dimension of the array B:
    • if TRANS = 'N', then LDB >= M
    • if TRANS = 'T', then LDB >= N
  • C โ€” REAL array, dimension (LDB,NRHS). no further commentary from the source, she's mysterious like that. ๐Ÿ™ˆ
  • WORK โ€” REAL array, dimension (LWORK). the workspace. the grind. ๐Ÿ’€
  • LWORK โ€” INTEGER, the length of the array WORK. constraint: LWORK >= NRHS*(M+N). respect it. ๐Ÿ”ฅ
ngl bestie, those dimension constraints are not a suggestion. if you get LDA, LDX, LDB or LWORK wrong you're gonna have a bad time. ๐Ÿ˜ญ

๐Ÿ‘‘ Author ๐Ÿ‘‘

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

Definition at line 151 of file sqrt17.f. (yes, line one-fifty-one, we checked ๐Ÿ’…)


๐ŸŒธ Author ๐ŸŒธ

Generated automatically by Doxygen for LAPACK from the source code. she's auto-generated but she's still that girl. โœจ


okay and finally, the cute sign-off you asked for ๐Ÿซถ โ€” this whole thing is from LAPACK, Version 3.12.0, and the page is TESTING/LIN/sqrt17.f(3). go forth and compute your ratios, bestie. ๐Ÿ’œ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from