TESTING/LIN/sqrt02.f(3)
π
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βMisINTEGER. the number of rows of the matrix Q to be generated. requirement:M >= 0. β¨NβNisINTEGER. the number of columns of the matrix Q to be generated. requirement:M >= N >= 0. πKβKisINTEGER. the number of elementary reflectors whose product defines the matrix Q. requirement:N >= K >= 0. πΈAβAisREALarray, dimension(LDA,N). this is the m-by-n matrix A which was factorized bySQRT01. she's the original, the source material πAFβAFisREALarray, dimension(LDA,N). all the details of the QR factorization of A, as returned bySGEQRF. seeSGEQRFfor further details πQβQisREALarray, dimension(LDA,N). (the star of the show, honestly β this is where the generated Q lives) βRβRisREALarray, dimension(LDA,N). πLDAβLDAisINTEGER. the leading dimension of the arraysA,AF,QandR. requirement:LDA >= M. don't skimp on this one bestie πTAUβTAUisREALarray, dimension(N). the scalar factors of the elementary reflectors corresponding to the QR factorization inAF. πWORKβWORKisREALarray, dimension(LWORK). the workspace, doing workspace things β¨LWORKβLWORKisINTEGER. the dimension of the arrayWORK. π₯RWORKβRWORKisREALarray, dimension(M). πRESULTβRESULTisREALarray, 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
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms