TESTING/LIN/sqrt02.f(3)

πŸ“¦
version 3.12.1 Β· 2 versions
, in arch rolling

πŸ’… TESTING/LIN/sqrt02.f β€” from the Library Functions Manual files, bestie πŸŽ€

okay so picture this: you're deep in LAPACK land, everybody's talking about QR factorizations, and somebody has to be the one to actually check that the Q matrix is behaving. that someone is sqrt02. she's the vibe check for SORGQR. periodt. ✨


🌸 SYNOPSIS 🌸

Functions/Subroutines

  • subroutine sqrt02 (m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result) β€” the whole squad, one call. this is what we call a full house πŸ’–
subroutine sqrt02 (m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)

πŸ¦‹ Function/Subroutine Documentation πŸ¦‹

the actual signature (yes, all of it, no skips πŸ’…)

subroutine sqrt02 (integer m, integer n, integer k, real, dimension( lda, * ) a, real, dimension( lda, * ) af, real, dimension( lda, * ) q, real, dimension( lda, * ) r, integer lda, real, dimension( * ) tau, real, dimension( lwork ) work, integer lwork, real, dimension( * ) rwork, real, dimension( * ) result)

SQRT02 πŸ‘‘ β€” main character subroutine, no notes.


✨ Purpose ✨

!> !> SQRT02 tests SORGQR, which generates an m-by-n matrix Q with !> orthonormal columns that is defined as the product of k elementary !> reflectors. !> !> Given the QR factorization of an m-by-n matrix A, SQRT02 generates !> the orthogonal matrix Q defined by the factorization of the first k !> columns of A; it compares R(1:n,1:k) with Q(1:m,1:n)'*A(1:m,1:k), !> and checks that the columns of Q are orthonormal. !>

so lowkey what she's doing: SQRT02 puts SORGQR through its paces. she builds that m-by-n matrix Q with the orthonormal columns β€” you know, the one that's defined as the product of k elementary reflectors β€” and then she does the receipts πŸ’€. given the QR factorization of an m-by-n matrix A, she generates the orthogonal matrix Q defined by the factorization of the first k columns of A, compares R(1:n,1:k) with Q(1:m,1:n)'*A(1:m,1:k), and then double checks that the columns of Q are actually orthonormal. she's thorough. she's that girl. 🫢


πŸ“ Parameters πŸ“

  • M β€” M is INTEGER. the number of rows of the matrix Q to be generated. requirement: M >= 0. ✨
  • N β€” N is INTEGER. the number of columns of the matrix Q to be generated. requirement: M >= N >= 0. πŸ’œ
  • K β€” K is INTEGER. the number of elementary reflectors whose product defines the matrix Q. requirement: N >= K >= 0. 🌸
  • A β€” A is REAL array, dimension (LDA,N). this is the m-by-n matrix A which was factorized by SQRT01. she's the original, the source material πŸ’–
  • AF β€” AF is REAL array, dimension (LDA,N). all the details of the QR factorization of A, as returned by SGEQRF. see SGEQRF for further details πŸ‘€
  • Q β€” Q is REAL array, dimension (LDA,N). (the star of the show, honestly β€” this is where the generated Q lives) ⭐
  • R β€” R is REAL array, dimension (LDA,N). 🌈
  • LDA β€” LDA is INTEGER. the leading dimension of the arrays A, AF, Q and R. requirement: LDA >= M. don't skimp on this one bestie 😭
  • TAU β€” TAU is REAL array, dimension (N). the scalar factors of the elementary reflectors corresponding to the QR factorization in AF. πŸŽ€
  • WORK β€” WORK is REAL array, dimension (LWORK). the workspace, doing workspace things ✨
  • LWORK β€” LWORK is INTEGER. the dimension of the array WORK. πŸ”₯
  • RWORK β€” RWORK is REAL array, dimension (M). πŸ’œ
  • RESULT β€” RESULT is REAL array, dimension (2). the test ratios, and they are:
    • RESULT(1) = norm( R - Q'*A ) / ( M * norm(A) * EPS )
    • RESULT(2) = norm( I - Q'*Q ) / ( M * EPS )

these two numbers are the whole personality of the routine ngl β€” they tell you if the factorization actually slayed or if it flopped πŸ’€


πŸ‘‘ Author πŸ‘‘

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

Definition at line 133 of file sqrt02.f. (iykyk πŸ“)


🧚 Author (the meta one) 🧚

Generated automatically by Doxygen for LAPACK from the source code.


and that's the whole page, bestie 🫢 LAPACK, Version 3.12.0 β€” written way back when, still out here validating your Q matrices today. go forth and be orthonormal πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from