SRC/clangb.f(3)

πŸ’… SRC/clangb.f β€” from the Library Functions Manual ✨

okay bestie, gather round, because today we're talking about clangb from <pink>LAPACK</pink> πŸŽ€ (that's the Library Functions Manual, for the record β€” yes I read the header, I'm not a monster). This is a Fortran function living its best life in SRC/clangb.f, and it's honestly so useful it's giving main character energy. 🌈


✨ SYNOPSIS ✨

πŸ¦‹ Functions/Subroutines

  • real function clangb (norm, n, kl, ku, ab, ldab, work) β€” CLANGB returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general band matrix. that's it, that's the whole vibe πŸ’–

🧚 Function/Subroutine Documentation 🧚

okay so picture this signature:

real function clangb (character norm, integer n, integer kl, integer ku,
    complex, dimension( ldab, * ) ab, integer ldab, real, dimension( * )
    work)

CLANGB returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general band matrix. literally what more could you want. ✨

🌸 Purpose:

!>
!> CLANGB  returns the value of the one norm,  or the Frobenius norm, or
!> the  infinity norm,  or the element of  largest absolute value  of an
!> n by n band matrix  A,  with kl sub-diagonals and ku super-diagonals.
!>

so yeah β€” an n by n band matrix A, with kl sub-diagonals and ku super-diagonals, and you get to pick which norm you want. iconic behavior, no notes. πŸ‘‘

πŸŽ€ Returns

CLANGB. like, that's the return value, bestie. here's the whole menu verbatim:

!>
!>    CLANGB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
!>             (
!>             ( norm1(A),         NORM = '1', 'O' or 'o'
!>             (
!>             ( normI(A),         NORM = 'I' or 'i'
!>             (
!>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
!>
!> where  norm1  denotes the  one norm of a matrix (maximum column sum),
!> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
!> normF  denotes  the  Frobenius norm of a matrix (square root of sum of
!> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
!>
⚠️ important lore drop: max(abs(A(i,j))) is not a consistent matrix norm. the original said it, I'm saying it, we're all saying it together. πŸ’€

πŸ’œ Parameters

  • NORM β€” NORM is CHARACTER*1. specifies the value to be returned in CLANGB, as described above. so like, the whole menu from the Returns bit. pick your fighter. πŸ™ˆ
  • N β€” N is INTEGER. the order of the matrix A. N >= 0. and when N = 0, CLANGB is set to zero β€” zero crumbs, respectfully. πŸ“
  • KL β€” KL is INTEGER. the number of sub-diagonals of the matrix A. KL >= 0. 🫢
  • KU β€” KU is INTEGER. the number of super-diagonals of the matrix A. KU >= 0. ⭐
  • AB β€” AB is COMPLEX array, dimension (LDAB,N). the band matrix A, stored in rows 1 to KL+KU+1. the j-th column of A is stored in the j-th column of the array AB as follows:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).

copy that formula exactly, it's load-bearing. πŸ’…

  • LDAB β€” LDAB is INTEGER. the leading dimension of the array AB. LDAB >= KL+KU+1. respect the bound or catch these hands (the hands are a segfault). 😭
  • WORK β€” WORK is REAL array, dimension (MAX(1,LWORK)), where LWORK >= N when NORM = 'I'; otherwise, WORK is not referenced. so if you're not doing the infinity norm, she's just sitting there. unbothered. πŸ’–

πŸ‘‘ Author

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

(the legends themselves, fr fr 🫢)

Definition at line 123 of file clangb.f. β€” yes, line 123, we love a numerically cute line number. ✨


🌟 Author (again, technically)

Generated automatically by Doxygen for LAPACK from the source code. so blame the robot, not me. πŸ€–πŸ’…


and that's the whole page, bestie! πŸŽ€ this beauty is LAPACK, Version 3.12.0, and it lives at SRC/clangb.f(3) β€” go forth, compute your norms, and slay. periodt. πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from