hetf2_rk(3)
π
hetf2_rk β so you found the triangular factor page, bestie
okay so real talk: the manual header says hetf2_rk(3) and it lives in the Library Functions Manual, and honestly it's the gateway page to the whole {he,sy}tf2_rk family β every single-precision/double-precision, real/complex, symmetric/Hermitian flavour of the level-2 triangular factorization. buckle up, it's a whole squad π«Ά
β¨ NAME β¨
hetf2_rk β {he,sy}tf2_rk: triangular factor, level 2
πΈ SYNOPSIS πΈ
Functions
subroutine chetf2_rk (uplo, n, a, lda, e, ipiv, info)βCHETF2_RKcomputes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). β¨subroutine csytf2_rk (uplo, n, a, lda, e, ipiv, info)βCSYTF2_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). πsubroutine dsytf2_rk (uplo, n, a, lda, e, ipiv, info)βDSYTF2_RKcomputes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). πsubroutine ssytf2_rk (uplo, n, a, lda, e, ipiv, info)βSSYTF2_RKcomputes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). π¦subroutine zhetf2_rk (uplo, n, a, lda, e, ipiv, info)βZHETF2_RKcomputes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). π₯subroutine zsytf2_rk (uplo, n, a, lda, e, ipiv, info)βZSYTF2_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). π
all six of them take the exact same argument list, which is lowkey iconic of them tbh. same vibes, different precision.
π Detailed Description π
Function Documentation
π§ subroutine chetf2_rk π
subroutine chetf2_rk (character uplo, integer n, complex, dimension( lda, * ) a, integer lda, complex, dimension( * ) e, integer, dimension( * ) ipiv, integer info)
CHETF2_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).
π― Purpose
bestie, here's the whole point:
!> CHETF2_RK computes the factorization of a complex Hermitian matrix A
!> using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
!>
!> A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
!>
!> where U (or L) is unit upper (or lower) triangular matrix,
!> U**H (or L**H) is the conjugate of U (or L), P is a permutation
!> matrix, P**T is the transpose of P, and D is Hermitian and block
!> diagonal with 1-by-1 and 2-by-2 diagonal blocks.
!>
!> This is the unblocked version of the algorithm, calling Level 2 BLAS.
!> For more information see Further Details section.
!>
so yeah β you hand it a Hermitian matrix, it hands you back P, U or L, and D. it's the unblocked version, which means it's calling Level 2 BLAS the whole time. slay.
π§Έ Parameters
UPLO
!> UPLO is CHARACTER*1
!> Specifies whether the upper or lower triangular part of the
!> Hermitian matrix A is stored:
!> = 'U': Upper triangular
!> = 'L': Lower triangular
!>
N
!> N is INTEGER
!> The order of the matrix A. N >= 0.
!>
A
!> A is COMPLEX array, dimension (LDA,N)
!> On entry, the Hermitian matrix A.
!> If UPLO = 'U': the leading N-by-N upper triangular part
!> of A contains the upper triangular part of the matrix A,
!> and the strictly lower triangular part of A is not
!> referenced.
!>
!> If UPLO = 'L': the leading N-by-N lower triangular part
!> of A contains the lower triangular part of the matrix A,
!> and the strictly upper triangular part of A is not
!> referenced.
!>
!> On exit, contains:
!> a) ONLY diagonal elements of the Hermitian block diagonal
!> matrix D on the diagonal of A, i.e. D(k,k) = A(k,k);
!> (superdiagonal (or subdiagonal) elements of D
!> are stored on exit in array E), and
!> b) If UPLO = 'U': factor U in the superdiagonal part of A.
!> If UPLO = 'L': factor L in the subdiagonal part of A.
!>
like, on entry it's your matrix; on exit it's wearing a whole different outfit. the diagonal is D(k,k) = A(k,k), the off-diagonal D bits went to live in E, and the rest is U or L. main character behavior honestly. π
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,N).
!>
E
!> E is COMPLEX array, dimension (N)
!> On exit, contains the superdiagonal (or subdiagonal)
!> elements of the Hermitian block diagonal matrix D
!> with 1-by-1 or 2-by-2 diagonal blocks, where
!> If UPLO = 'U': E(i) = D(i-1,i), i=2:N, E(1) is set to 0;
!> If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, E(N) is set to 0.
!>
!> NOTE: For 1-by-1 diagonal block D(k), where
!> 1 <= k <= N, the element E(k) is set to 0 in both
!> UPLO = 'U' or UPLO = 'L' cases.
!>
(read that NOTE again, bestie β the 1-by-1 case zeroes out E(k) either way. no exceptions.)
IPIV
this one's the long one. deep breath. π«Ά
!> IPIV is INTEGER array, dimension (N)
!> IPIV describes the permutation matrix P in the factorization
!> of matrix A as follows. The absolute value of IPIV(k)
!> represents the index of row and column that were
!> interchanged with the k-th row and column. The value of UPLO
!> describes the order in which the interchanges were applied.
!> Also, the sign of IPIV represents the block structure of
!> the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2
!> diagonal blocks which correspond to 1 or 2 interchanges
!> at each factorization step. For more info see Further
!> Details section.
!>
so the absolute value tells you which row/column got swapped with k, and the sign tells you the block structure. UPLO decides the order the interchanges happened in. iykyk.
If UPLO = 'U' β in factorization order, k decreases from N to 1:
!> a) A single positive entry IPIV(k) > 0 means:
!> D(k,k) is a 1-by-1 diagonal block.
!> If IPIV(k) != k, rows and columns k and IPIV(k) were
!> interchanged in the matrix A(1:N,1:N);
!> If IPIV(k) = k, no interchange occurred.
!>
!> b) A pair of consecutive negative entries
!> IPIV(k) < 0 and IPIV(k-1) < 0 means:
!> D(k-1:k,k-1:k) is a 2-by-2 diagonal block.
!> (NOTE: negative entries in IPIV appear ONLY in pairs).
!> 1) If -IPIV(k) != k, rows and columns
!> k and -IPIV(k) were interchanged
!> in the matrix A(1:N,1:N).
!> If -IPIV(k) = k, no interchange occurred.
!> 2) If -IPIV(k-1) != k-1, rows and columns
!> k-1 and -IPIV(k-1) were interchanged
!> in the matrix A(1:N,1:N).
!> If -IPIV(k-1) = k-1, no interchange occurred.
!>
!> c) In both cases a) and b), always ABS( IPIV(k) ) <= k.
!>
!> d) NOTE: Any entry IPIV(k) is always NONZERO on output.
!>
If UPLO = 'L' β in factorization order, k increases from 1 to N:
!> a) A single positive entry IPIV(k) > 0 means:
!> D(k,k) is a 1-by-1 diagonal block.
!> If IPIV(k) != k, rows and columns k and IPIV(k) were
!> interchanged in the matrix A(1:N,1:N).
!> If IPIV(k) = k, no interchange occurred.
!>
!> b) A pair of consecutive negative entries
!> IPIV(k) < 0 and IPIV(k+1) < 0 means:
!> D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
!> (NOTE: negative entries in IPIV appear ONLY in pairs).
!> 1) If -IPIV(k) != k, rows and columns
!> k and -IPIV(k) were interchanged
!> in the matrix A(1:N,1:N).
!> If -IPIV(k) = k, no interchange occurred.
!> 2) If -IPIV(k+1) != k+1, rows and columns
!> k-1 and -IPIV(k-1) were interchanged
!> in the matrix A(1:N,1:N).
!> If -IPIV(k+1) = k+1, no interchange occurred.
!>
!> c) In both cases a) and b), always ABS( IPIV(k) ) >= k.
!>
!> d) NOTE: Any entry IPIV(k) is always NONZERO on output.
!>
okay notice the flip: upper case bounds you by ABS( IPIV(k) ) <= k, lower case gives you ABS( IPIV(k) ) >= k. and negative entries in IPIV appear ONLY in pairs β that's not a suggestion, that's the structure of the 2-by-2 blocks. periodt. π₯
INFO
!> INFO is INTEGER
!> = 0: successful exit
!>
!> < 0: If INFO = -k, the k-th argument had an illegal value
!>
!> > 0: If INFO = k, the matrix A is singular, because:
!> If UPLO = 'U': column k in the upper
!> triangular part of A contains all zeros.
!> If UPLO = 'L': column k in the lower
!> triangular part of A contains all zeros.
!>
!> Therefore D(k,k) is exactly zero, and superdiagonal
!> elements of column k of U (or subdiagonal elements of
!> column k of L ) are all zeros. The factorization has
!> been completed, but the block diagonal matrix D is
!> exactly singular, and division by zero will occur if
!> it is used to solve a system of equations.
!>
!> NOTE: INFO only stores the first occurrence of
!> a singularity, any subsequent occurrence of singularity
!> is not stored in INFO even though the factorization
!> always completes.
!>
β οΈ bestie listen βINFO > 0meansDis exactly singular, and if you then try to solve a system with it, division by zero will occur. the factorization still completed, it's just unusable for solving. no cap, that's the cursed part.
also INFO has main character energy β it only remembers the first singularity. everything after that? not stored, even though the factorization always completes. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ Further Details:
!> TODO: put further details
!>
(they really left us on read with that one π)
π Contributors:
!>
!> December 2016, Igor Kozachenko,
!> Computer Science Division,
!> University of California, Berkeley
!>
!> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
!> School of Mathematics,
!> University of Manchester
!>
!> 01-01-96 - Based on modifications by
!> J. Lewis, Boeing Computer Services Company
!> A. Petitet, Computer Science Dept.,
!> Univ. of Tenn., Knoxville abd , USA
!>
(yes, abd β that's literally in the source, we do not touch it π)
Definition at line 240 of file chetf2_rk.f.
π subroutine csytf2_rk π
subroutine csytf2_rk (character uplo, integer n, complex, dimension( lda, * ) a, integer lda, complex, dimension( * ) e, integer, dimension( * ) ipiv, integer info)
CSYTF2_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).
π― Purpose:
okay so CSYTF2_RK is literally the moment π
β here's the whole vibe of what it does:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where:
U(orL) is the unit upper (or lower) triangular matrix,U**T(orL**T) is the transpose ofU(orL),Pis a permutation matrix, andP**Tis the transpose ofP,Dis symmetric and block diagonal, with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, bestie β it's out here calling Level 2 BLAS. For more info see the Further Details section β¨
π Parameters π
UPLO
UPLO is CHARACTER*1 and it specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
'U': upper triangular'L': lower triangular
N
N is INTEGER β the order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N).
On entry, it's the symmetric matrix A:
- If
UPLO = 'U': the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, it contains:
- a) only the diagonal elements of the symmetric block diagonal matrix
D, sitting on the diagonal ofA, i.e.D(k,k) = A(k,k)(the superdiagonal, or subdiagonal, elements ofDget stored on exit in arrayE), and - b) if
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N).
On exit, it contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where:
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N, andE(1)is set to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, andE(N)is set to0.
NOTE π«Ά For a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in both theUPLO = 'U'andUPLO = 'L'cases.
IPIV
IPIV is INTEGER array, dimension (N).
IPIV describes the permutation matrix P in the factorization of matrix A like this: the absolute value of IPIV(k) represents the index of the row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, which correspond to 1 or 2 interchanges at each factorization step. For more info see the Further Details section.
If UPLO = 'U' (in factorization order, k decreases from N to 1):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); ifIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: any entry
IPIV(k)is always NONZERO on output.
If UPLO = 'L' (in factorization order, k increases from 1 to N):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: any entry
IPIV(k)is always NONZERO on output.
INFO
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -k, the k-th argument had an illegal value π> 0: ifINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and the superdiagonal elements of column k of U (or the subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it's used to solve a system of equations. π
NOTE:INFOonly stores the first occurrence of a singularity β any subsequent occurrence of singularity is not stored inINFO, even though the factorization always completes.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ Further Details: β¨
The docs literally say:
TODO: put further details
and honestly? iconic. no notes. π«Ά
π¦ Contributors: π¦
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
- 01-01-96 β based on modifications by
- J. Lewis, Boeing Computer Services Company
- A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA
Definition at line 240 of file csytf2_rk.f.
π§ dsytf2_rk π§
subroutine dsytf2_rk (character uplo, integer n, double precision,
dimension( lda, * ) a, integer lda, double precision, dimension( * ) e,
integer, dimension( * ) ipiv, integer info)
DSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). slay π
Purpose:
DSYTF2_RK computes the factorization of a real symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where:
U(orL) is the unit upper (or lower) triangular matrix,U**T(orL**T) is the transpose ofU(orL),Pis a permutation matrix, andP**Tis the transpose ofP,Dis symmetric and block diagonal, with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see the Further Details section β
Parameters
UPLO
UPLO is CHARACTER*1 and it specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
'U': upper triangular'L': lower triangular
N
N is INTEGER β the order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N).
AβAisDOUBLE PRECISIONarray, dimension(LDA,N). Bestie, this is the main character of the whole function. On entry, it's the symmetric matrixA, and here's how she's read:- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
On exit, she's been transformed, and contains:
- ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k)β and yeah, the superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayEinstead, periodt. - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDAβLDAisINTEGER. It's the leading dimension of the arrayA, and the rule isLDA >= max(1,N). No cap, it's literally just a constraint. πEβEisDOUBLE PRECISIONarray, dimension(N). On exit, it contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where:- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to 0.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. Zeroed out, every time, no exceptions. π«Ά
IPIVβIPIVisINTEGERarray, dimension(N). Okay so this one is lowkey the whole lore drop of the page, stay with me. π§
IPIV describes the permutation matrix P in the factorization of matrix A as follows. The absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section β yes queen, there's a whole Further Details section, go look. π
If UPLO = 'U', (in factorization order, k decreases from N to 1 β note the direction, bestie):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); - If
IPIV(k) = k, no interchange occurred. Iconic, nothing moved.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs β they do not show up solo, ever. π) - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. Always. Nonzero. I said what I said. β¨
If UPLO = 'L', (in factorization order, k increases from 1 to N β opposite direction, keep up):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
INFOβINFOisINTEGER, the vibe report at the end. π= 0: successful exit. Slay, she ate, no notes. π< 0: IfINFO = -k, the k-th argument had an illegal value. Someone passed something cursed, go check your args.> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. Ma'am. That's a whole crisis. π
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. So it's a one-warning situation, not a running tally. Fr fr.
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details: π
TODO: put further details
Yeah bestie, they really left it like that. The whole section. A TODO. We move. π
π«Ά Contributors: π«Ά
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
- 01-01-96 - Based on modifications by J. Lewis, Boeing Computer Services Company, and A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd, USA
β¨ Definition at line 240 of file dsytf2_rk.f. β¨
Now we slide into the other subroutine on this page, and honestly she's the same energy but in single precision. π¦
subroutine ssytf2_rk (character uplo, integer n, real, dimension( lda, * )
a, integer lda, real, dimension( * ) e, integer, dimension( * ) ipiv,
integer info)
SSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).
π― Purpose: π―
SSYTF2_RK computes the factorization of a real symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. Look at her, fully decomposed. π
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see Further Details section.
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA.N >= 0. That's the rule, no negotiating.AβAisREALarray, dimension(LDA,N). Note theREAL, bestie β she's single precision now, theDOUBLE PRECISIONversion up above is her sister. π On entry, the symmetric matrixA:- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
On exit, contains:
- ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k)β and the superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE. - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). Same rule as before, she's consistent.EβEisREALarray, dimension(N). On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where:- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to 0.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. π
IPIV
Okay bestie, so IPIV is an INTEGER array, dimension (N) π
and it describes the permutation matrix P in the factorization of matrix A like this: the absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section.
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N).- If
-IPIV(k) = k, no interchange occurred.
- If
- 2) If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N).- If
-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is alwaysNONZEROon output.
If UPLO = 'L', ( in factorization order, k increases from 1 to N ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N).- If
-IPIV(k) = k, no interchange occurred.
- If
- 2) If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N).- If
-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is alwaysNONZEROon output.
INFO π
INFO is INTEGER:
= 0: successful exit π< 0: IfINFO = -k, the k-th argument had an illegal value> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.
β οΈ NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes.
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details: π
TODO: put further details
Contributors: π§
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
01-01-96- Based on modifications by- J. Lewis, Boeing Computer Services Company
- A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA
Definition at line 240 of file ssytf2_rk.f.
subroutine zhetf2_rk π
subroutine zhetf2_rk (character uplo, integer n, complex*16, dimension( lda,
* ) a, integer lda, complex*16, dimension( * ) e, integer, dimension( *
) ipiv, integer info)
ZHETF2_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).
Purpose: β¨
ZHETF2_RK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**H (or L**H) is the conjugate of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see Further Details section.
Parameters π
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the Hermitian matrix A.
- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, contains:
- a) ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX*16 array, dimension (N).
On exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where:
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in bothUPLO = 'U'orUPLO = 'L'cases.
IPIV π
IPIV
Okay bestie, this one's a chunky lil guy and it's lowkey giving "read me twice" π
IPIV is an INTEGER array, dimension (N), and it describes the permutation matrix P in the factorization of matrix A, like this: the absolute value of IPIV(k) is the index of the row and column that were interchanged with the k-th row and column. Which order did those interchanges happen in? That's literally what UPLO is for. And the sign of IPIV is doing the absolute most β it tells you the block structure of the Hermitian block diagonal matrix D, whose 1-by-1 or 2-by-2 diagonal blocks correspond to 1 or 2 interchanges at each factorization step. For more info, see the Further Details section. β¨
If UPLO = 'U' β and heads up, in factorization order k decreases from N to 1:
- a) A single positive entry
IPIV(k) > 0meansD(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); ifIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0meansD(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs π)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
If UPLO = 'L' β this time in factorization order k increases from 1 to N:
- a) A single positive entry
IPIV(k) > 0meansD(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); ifIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0meansD(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs π«Ά)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
INFO
INFO is INTEGER, and it's your little status report at the end, bestie π¬
= 0: successful exit π< 0: IfINFO = -k, the k-th argument had an illegal value> 0: IfINFO = k, the matrixAis singular, because:
If UPLO = 'U': column k in the upper triangular part of A contains all zeros. If UPLO = 'L': column k in the lower triangular part of A contains all zeros.
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.
π¨ and yes, that means what it sounds like β division by zero is on the menu if you try to solve a system with it. Not cute.
NOTE: INFO only stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored in INFO even though the factorization always completes.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ Further Details
TODO: put further details
Like, that's it, that's the section π (we keep it exactly as the source gives it).
π§ Contributors
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
- 01-01-96 - Based on modifications by J. Lewis, Boeing Computer Services Company; A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA
Definition at line 240 of file zhetf2_rk.f.
π¦ Next up: zsytf2_rk π
subroutine zsytf2_rk (character uplo, integer n, complex*16, dimension( lda,
* ) a, integer lda, complex*16, dimension( * ) e, integer, dimension( *
) ipiv, integer info)
So ZSYTF2_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). Periodt. β¨
β¨ Purpose β¨
Okay so ZSYTF2_RK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see Further Details section. π§ββοΈ
π Parameters
UPLO
UPLOisCHARACTER*1- Specifies whether the upper or lower triangular part of the symmetric matrix
Ais stored:= 'U': Upper triangular= 'L': Lower triangular
N
NisINTEGER- The order of the matrix
A.N >= 0.
A
AisCOMPLEX*16array, dimension(LDA,N)- On entry, the symmetric matrix
A.- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
- On exit, contains:
- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
LDA
LDAisINTEGER- The leading dimension of the array
A.LDA >= max(1,N).
E
EisCOMPLEX*16array, dimension(N)- On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
Dwith 1-by-1 or 2-by-2 diagonal blocks, where:- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to 0.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. π«Ά
IPIV
β¦and this one's the next chapter of the saga, bestie β bestie, hold that thought, it continues right up in the next part π
IPIV is an INTEGER array, dimension (N).
Okay so IPIV describes the permutation matrix P in the factorization of matrix A like this: the absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section.
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
If UPLO = 'L', ( in factorization order, k increases from 1 to N ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
INFO is INTEGER.
= 0: successful exit π< 0: IfINFO = -k, thek-th argument had an illegal value> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.
π¨ Not a drill, bestie: singular means singular. D is exactly singular here, and division by zero is literally waiting if you use it to solve a system of equations. π
NOTE: INFO only stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored in INFO even though the factorization always completes.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details: π¦
This section is literally a placeholder on the page:
!> TODO: put further details
!>
π«Ά Contributors: π«Ά
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
01-01-96- Based on modifications by- J. Lewis, Boeing Computer Services Company
- A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA
Definition at line 240 of file zsytf2_rk.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
And that's the footer moment, bestie: LAPACK Version 3.12.0 and hetf2_rk(3) β source/version sign-off, iconic and complete. π
β¨π
π¦ 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