SLAHILB(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

✨ SLAHILB(3) ✨ β€” the scaled Hilbert matrix generator, bestie edition πŸ’…

okay so you found SLAHILB(3) in the LAPACK manual β€” it lives at /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/MATGEN/slahilb.f and it's literally the main character of matrix generators. no cap. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Functions/Subroutines

subroutine SLAHILB (n, nrhs, a, lda, x, ldx, b, ldb, work, info)
SLAHILB β€” she's the whole function, periodt.

πŸ’– Function/Subroutine Documentation πŸ’–

subroutine SLAHILB (integer n, integer nrhs, real, dimension(lda, n) a,
    integer lda, real, dimension(ldx, nrhs) x, integer ldx, real,
    dimension(ldb, nrhs) b, integer ldb, real, dimension(n) work, integer
    info)

SLAHILB 🫢

Purpose:

!>
!> SLAHILB generates an N by N scaled Hilbert matrix in A along with
!> NRHS right-hand sides in B and solutions in X such that A*X=B.
!>
!> The Hilbert matrix is scaled by M = LCM(1, 2, ..., 2*N-1) so that all
!> entries are integers.  The right-hand sides are the first NRHS
!> columns of M * the identity matrix, and the solutions are the
!> first NRHS columns of the inverse Hilbert matrix.
!>
!> The condition number of the Hilbert matrix grows exponentially with
!> its size, roughly as O(e ** (3.5*N)).  Additionally, the inverse
!> Hilbert matrices beyond a relatively small dimension cannot be
!> generated exactly without extra precision.  Precision is exhausted
!> when the largest entry in the inverse Hilbert matrix is greater than
!> 2 to the power of the number of bits in the fraction of the data type
!> used plus one, which is 24 for single precision.
!>
!> In single, the generated solution is exact for N <= 6 and has
!> small componentwise error for 7 <= N <= 11.
!>

so basically: she builds you an N Γ— N scaled Hilbert matrix in A, plus NRHS right-hand sides in B and the matching solutions in X, all satisfying A*X=B. iconique. πŸ”₯

the scaling factor is M = LCM(1, 2, ..., 2*N-1) so every entry stays an integer β€” no messy fractions, we love a clean queen. πŸ’… the right-hand sides are the first NRHS columns of M * the identity matrix, and the solutions are the first NRHS columns of the inverse Hilbert matrix.

⚠️ real talk: the condition number of the Hilbert matrix grows exponentially with N, roughly O(e ** (3.5*N)). and inverse Hilbert matrices past a relatively small dimension cannot be generated exactly without extra precision. precision is exhausted when the largest entry in the inverse Hilbert matrix is greater than 2 to the power of the number of bits in the fraction of the data type used plus one β€” which is 24 for single precision. 😭

in single precision, the generated solution is exact for N <= 6 and has small componentwise error for 7 <= N <= 11. so cute, so fragile. πŸ¦‹


🌸 Parameters 🌸

  • N β€” N is INTEGER. the dimension of the matrix A. slay. πŸ‘‘
  • NRHS β€” NRHS is INTEGER. the requested number of right-hand sides. the more the merrier, bestie. πŸ’–
  • A β€” A is REAL array, dimension (LDA, N). the generated scaled Hilbert matrix. she's the moment. ✨
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= N. keep it valid or it's giving illegal. πŸ’€
  • X β€” X is REAL array, dimension (LDX, NRHS). the generated exact solutions. currently, the first NRHS columns of the inverse Hilbert matrix. lowkey iconic. πŸŽ€
  • LDX β€” LDX is INTEGER. the leading dimension of the array X. LDX >= N. periodt. 🫢
  • B β€” B is REAL array, dimension (LDB, NRHS). the generated right-hand sides. currently, the first NRHS columns of LCM(1, 2, ..., 2*N-1) times the identity matrix. no cap. 🌈
  • LDB β€” LDB is INTEGER. the leading dimension of the array B. LDB >= N. don't play with it. πŸ’…
  • WORK β€” WORK is REAL array, dimension (N). just vibes and workspace. 🧚
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit. we ate. πŸ“
    • = 1: N is too large; the data is still generated but may not be not exact. (yes, the original says "may not be not exact" β€” we're just relaying the message, bestie. πŸ™ˆ)
    • < 0: if INFO = -i, the i-th argument had an illegal value. red flag fr fr. πŸ’€

πŸ‘‘ Author πŸ‘‘

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

πŸ“Œ (definition at line 123 of file slahilb.f.)


πŸ’œ Author (of this doc) πŸ’œ

Generated automatically by Doxygen for LAPACK from the source code. our little documentation fairy did that. 🧚✨


LAPACK β€” Version 3.12.0 β€” and the source file path to remember: /home/abui...N/slahilb.f(3) 🌸

okay bye bestie, go generate some scaled Hilbert matrices responsibly. πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from