hetf2(3)
๐ hetf2(3) โ the {he,sy}tf2 glow-up: triangular factor, level 2 ๐
okay bestie, sit down, hydrate, and let me tell you about hetf2 โ she's from the Library Functions Manual and she is, no cap, the level-2 BLAS girlie who factors your triangular matrices with the diagonal pivoting method. two families, six subroutines, one iconic era ๐
โจ NAME โจ
hetf2 โ {he,sy}tf2: triangular factor, level 2. that's her. that's the whole name. periodt ๐
โจ SYNOPSIS โจ
๐ธ Functions ๐ธ
lowkey the whole cast, right here โ all six of them take the exact same arguments, which is honestly such a slay:
subroutine chetf2 (uplo, n, a, lda, ipiv, info)
subroutine csytf2 (uplo, n, a, lda, ipiv, info)
subroutine dsytf2 (uplo, n, a, lda, ipiv, info)
subroutine ssytf2 (uplo, n, a, lda, ipiv, info)
subroutine zhetf2 (uplo, n, a, lda, ipiv, info)
subroutine zsytf2 (uplo, n, a, lda, ipiv, info)
and here's who's who in the group chat ๐ซถ
subroutine chetf2 (uplo, n, a, lda, ipiv, info)โCHETF2computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm calling Level 2 BLAS).subroutine csytf2 (uplo, n, a, lda, ipiv, info)โCSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine dsytf2 (uplo, n, a, lda, ipiv, info)โDSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine ssytf2 (uplo, n, a, lda, ipiv, info)โSSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine zhetf2 (uplo, n, a, lda, ipiv, info)โZHETF2computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm, calling Level 2 BLAS).subroutine zsytf2 (uplo, n, a, lda, ipiv, info)โZSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).
โจ Detailed Description โจ
bestie, the "detailed description" section is literally just vibes and two headings โ Function Documentation โ and then the actual docs. iconic minimalism honestly. so let's get into the functions themselves, because that's where all the lore lives ๐ฅ
โจ Function Documentation โจ
๐ subroutine chetf2 (character uplo, integer n, complex, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, integer info)
CHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm calling Level 2 BLAS). she's the complex Hermitian one, she calls Level 2 BLAS, she does not block. respect her craft ๐
๐ Purpose
okay so here's the actual purpose, straight up:
CHETF2 computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**H or A = L*D*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**H is the conjugate transpose of U, 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. no blocking, no buffer, just vibes and BLAS calls โจ
๐ฆ Parameters
UPLOโUPLOisCHARACTER*1. tells us whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NโNisINTEGER. the order of the matrixA.N >= 0. (zero is allowed, she's flexible like that ๐)AโAisCOMPLEXarray, dimension(LDA,N).- on entry, the Hermitian matrix
A. ifUPLO = '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. ifUPLO = '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, the block diagonal matrix
Dand the multipliers used to obtain the factorUorL(see below for further details). she does a little costume change on the way out, we love a transformation arc ๐
- on entry, the Hermitian matrix
LDAโLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N). (thatmax(1,N)is doing the lords work, do not come for her.)IPIVโIPIVisINTEGERarray, dimension(N). the receipts: details of the interchanges and the block structure ofD๐- if
UPLO = 'U':- if
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - if
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- if
- if
UPLO = 'L':- if
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - if
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- if
- if
INFOโINFOisINTEGER. the vibe check at the end:= 0: successful exit ๐< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. the factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations ๐ญ
โ ๏ธ bestie do NOT ignore a positiveINFO. the factorization did finish, butDis exactly singular and you're gonna divide by zero the second you try to solve with it. that's not a drill, that's math being math ๐
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ง Further Details
the lore section, i'm obsessed:
09-29-06โ patch from Bobby Cheng, MathWorks. the patch replaced linesl.210andl.392:
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
01-01-96โ based on modifications by J. Lewis, Boeing Computer Services Company and A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA.- if
UPLO = 'U', thenA = U*D*U**H, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
- if
s = 1,D(k)overwritesA(k,k), andvoverwritesA(1:k-1,k). - if
s = 2, the upper triangle ofD(k)overwritesA(k-1,k-1),A(k-1,k), andA(k,k), andvoverwritesA(1:k-2,k-1:k). - if
UPLO = 'L', thenA = L*D*L**H, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
- if
s = 1,D(k)overwritesA(k,k), andvoverwritesA(k+1:n,k). - if
s = 2, the lower triangle ofD(k)overwritesA(k,k),A(k+1,k), andA(k+1,k+1), andvoverwritesA(k+2:n,k:k+1).
Definition at line 185 of file chetf2.f.
๐ subroutine csytf2 (character uplo, integer n, complex, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, integer info)
CSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). that's what the synopsis says and we're reporting it faithfully, bestie ๐ซถ โ keep reading, the Purpose block below has its own whole take on things.
๐ Purpose
CSYTF2 computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**T or A = L*D*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**T is the transpose of U, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
note it's **T here, not **H โ no conjugate transpose, this one's all about that plain transpose life โจ
this is the unblocked version of the algorithm, calling Level 2 BLAS.
๐ฆ 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.AโAisCOMPLEXarray, dimension(LDA,N).- on entry, the symmetric matrix
A. ifUPLO = '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. ifUPLO = '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, the block diagonal matrix
Dand the multipliers used to obtain the factorUorL(see below for further details).
- on entry, the symmetric matrix
LDAโLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N). she's back and she still eats ๐IPIVโIPIVisINTEGERarray, dimension(N). details of the interchanges and the block structure ofD.- if
UPLO = 'U':- if
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - if
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- if
- if
UPLO = 'L':- if
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - if
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- if
- if
INFOโINFOisINTEGER.= 0: successful exit ๐< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. the factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations ๐ญ
โ ๏ธ same warning as before, fr fr: positiveINFOmeansDis exactly singular and solving with it divides by zero. she told you, don't act surprised ๐
โจ and that's where part one leaves you, bestie โ the parameter list just ends and the page keeps going, so keep scrolling, there's more subroutine lore loading ๐ ๐
๐ Author ๐
(still riding with csytf2 here, bestie โ same four legends as always, and honestly? icons only)
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐งฎ Further Details ๐งฎ
Okay so this is the part where the math stops being cute and starts being math, but stay with me, it's giving "I understand it now" energy.
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
which is me saying U is a product of terms P(k)*U(k) โ and k decreases from n to 1 in steps of 1 or 2 ๐ช. Meanwhile D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
- If
s = 1,D(k)overwritesA(k,k), andvoverwritesA(1:k-1,k). - If
s = 2, the upper triangle ofD(k)overwritesA(k-1,k-1),A(k-1,k), andA(k,k), andvoverwritesA(1:k-2,k-1:k).
Now flip it โ if UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
so L is a product of terms P(k)*L(k), with k increasing from 1 to n in steps of 1 or 2 (see what they did there ๐), and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
- If
s = 1,D(k)overwritesA(k,k), andvoverwritesA(k+1:n,k). - If
s = 2, the lower triangle ofD(k)overwritesA(k,k),A(k+1,k), andA(k+1,k+1), andvoverwritesA(k+2:n,k:k+1).
๐ซถ Contributors ๐ซถ
09-29-06 โ patch from Bobby Cheng, MathWorks. The assignment: replace l.209 and l.377, which said
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
...with
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
1-96 โ based on modifications by J. Lewis, Boeing Computer Services Company.
๐ Definition at line190of filecsytf2.f.
๐ subroutine dsytf2 ๐
subroutine dsytf2 (character uplo, integer n, double precision, dimension(
lda, * ) a, integer lda, integer, dimension( * ) ipiv, integer info)
Real talk: DSYTF2 computes the factorization of a real symmetric indefinite matrix using the diagonal pivoting method โ and this is the unblocked algorithm, bestie, the one that keeps it simple โจ
๐ฏ Purpose ๐ฏ
DSYTF2 computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**T or A = L*D*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**T is the transpose of U, 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.
๐ Parameters ๐
UPLO โ UPLO is CHARACTER*1. 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 DOUBLE PRECISION array, dimension (LDA,N).
- On entry: the symmetric matrix
A. IfUPLO = '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. IfUPLO = '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: the block diagonal matrix
Dand the multipliers used to obtain the factorUorL(see below for further details ๐).
LDA โ LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
IPIV โ IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D.
If UPLO = 'U':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = 'L':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
INFO โ INFO is INTEGER.
= 0: successful exit ๐< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations ๐
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐งฎ Further Details ๐งฎ
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
so U is a product of terms P(k)*U(k), with k decreasing from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
- If
s = 1,D(k)overwritesA(k,k), andvoverwritesA(1:k-1,k). - If
s = 2, the upper triangle ofD(k)overwritesA(k-1,k-1),A(k-1,k), andA(k,k), andvoverwritesA(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
so L is a product of terms P(k)*L(k), with k increasing from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
- If
s = 1,D(k)overwritesA(k,k), andvoverwritesA(k+1:n,k). - If
s = 2, the lower triangle ofD(k)overwritesA(k,k),A(k+1,k), andA(k+1,k+1), andvoverwritesA(k+2:n,k:k+1).
๐ซถ Contributors ๐ซถ
09-29-06 โ patch from Bobby Cheng, MathWorks. Replace l.204 and l.372, which said
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
...with
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. DISNAN(ABSAKK) ) THEN
01-01-96 โ based on modifications by J. Lewis, Boeing Computer Services Company, and A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA.
1-96 โ based on modifications by J. Lewis, Boeing Computer Services Company.
๐ Definition at line193of filedsytf2.f.
๐ธ subroutine ssytf2 ๐ธ
subroutine ssytf2 (character uplo, integer n, real, dimension( lda, * ) a,
integer lda, integer, dimension( * ) ipiv, integer info)
Same energy, single precision edition ๐ โ SSYTF2 computes the factorization of a real symmetric indefinite matrix using the diagonal pivoting method, unblocked algorithm, no cap.
๐ฏ Purpose ๐ฏ
SSYTF2 computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**T or A = L*D*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**T is the transpose of U, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
Again: this is the unblocked version of the algorithm, calling Level 2 BLAS.
๐ Parameters ๐
UPLO โ UPLO is CHARACTER*1. 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 REAL array, dimension (LDA,N).
- On entry: the symmetric matrix
A. IfUPLO = '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. IfUPLO = '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: the block diagonal matrix
Dand the multipliers used to obtain the factorUorL(see below for further details).
LDA โ LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
IPIV โ (and this is exactly where the page hands off, bestie โ the full IPIV breakdown for ssytf2 picks up in the next chunk ๐)
IPIVโ INTEGER array, dimension (N) ๐ Details of the interchanges and the block structure of D. So iconic. Here's the tea:- If
UPLO = 'U':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. โจ - If
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. ๐
- If
- If
UPLO = 'L':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. ๐ - If
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. ๐ฆ
- If
- If
INFOโ INTEGER. OMG the receipts:= 0: successful exit ๐;< 0: ifINFO = -k, thek-th argument had an illegal value ๐ญ;> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐ So be careful bestie!
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
Okay so here's the full vibe of the factorization. If UPLO = 'U', then A = U*D*U**T, where
!> U = P(n)*U(n)* ... *P(k)U(k)* ...,
!> i.e., U is a product of terms P(k)*U(k), where k decreases from n to
!> 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1
!> and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as
!> defined by IPIV(k), and U(k) is a unit upper triangular matrix, such
!> that if the diagonal block D(k) is of order s (s = 1 or 2), then
!>
!> ( I v 0 ) k-s
!> U(k) = ( 0 I 0 ) s
!> ( 0 0 I ) n-k
!> k-s s n-k
!>
!> If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
!> If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k),
!> and A(k,k), and v overwrites A(1:k-2,k-1:k).
And if UPLO = 'L', then A = L*D*L**T, where
!> L = P(1)*L(1)* ... *P(k)*L(k)* ...,
!> i.e., L is a product of terms P(k)*L(k), where k increases from 1 to
!> n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1
!> and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as
!> defined by IPIV(k), and L(k) is a unit lower triangular matrix, such
!> that if the diagonal block D(k) is of order s (s = 1 or 2), then
!>
!> ( I 0 0 ) k-1
!> L(k) = ( 0 I 0 ) s
!> ( 0 v I ) n-k-s+1
!> k-1 s n-k-s+1
!>
!> If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k).
!> If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k),
!> and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
Contributors:
!> 09-29-06 - patch from
!> Bobby Cheng, MathWorks
!>
!> Replace l.204 and l.372
!> IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
!> by
!> IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
!>
!> 01-01-96 - Based on modifications by
!> J. Lewis, Boeing Computer Services Company
!> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
!> 1-96 - Based on modifications by J. Lewis, Boeing Computer Services
!> Company
Definition at line 194 of file ssytf2.f. (Wait, that's from the previous part, but we're still in zhetf2? No, this is zhetf2's definition at line 190 of file zhetf2.f โ keep scrolling bestie!)
subroutine zsytf2
subroutine zsytf2 (character uplo, integer n, complex*16, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, integer info)
ZSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). (Yes, it says "real" but it's complex โ we don't make the rules, we just report them ๐ )
Purpose:
!>
!> ZSYTF2 computes the factorization of a complex symmetric matrix A
!> using the Bunch-Kaufman diagonal pivoting method:
!>
!> A = U*D*U**T or A = L*D*L**T
!>
!> where U (or L) is a product of permutation and unit upper (lower)
!> triangular matrices, U**T is the transpose of U, 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.
๐ธ Parameters ๐ธ
Okay bestie, hereโs the tea on every argument this subroutine touches. Keep these exact โ no renaming, no โimproving,โ okay? ๐
UPLOโCHARACTER*1. Tells us whether the upper or lower triangular half of the symmetric matrixAis the one actually stored. Set it to'U'for upper triangular, or'L'for lower triangular. Thatโs the whole vibe check. ๐ฆNโINTEGER. The order of matrixA. It must satisfyN >= 0. Zero is allowed, bestie โ matrix can be baby. ๐AโCOMPLEX*16 array, dimension (LDA,N). On entry, this is the symmetric matrixA. IfUPLO = '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. IfUPLO = '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,Ais doing double duty: it holds the block diagonal matrixDplus the multipliers used to obtain the factorUorL(peep Further Details below for the full lore). ๐LDAโINTEGER. The leading dimension of the arrayA. Required:LDA >= max(1,N). Donโt skimp, bestie. โจIPIVโINTEGER array, dimension (N). This one spills all the details about the interchanges and the block structure ofD. It gets a little choose-your-own-adventure depending onUPLO:- If
UPLO = 'U':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. Slay. ๐ - If
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. Iconic little duo. ๐ฏ
- If
- If
UPLO = 'L':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. Same energy. ๐ - If
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. Matching set, honestly. ๐ซถ
- If
- If
INFOโINTEGER. The exit-status bestie:INFO = 0: successful exit. We love a clean getaway. โจINFO < 0: ifINFO = -k, the k-th argument had an illegal value. Ruh-roh. ๐ญINFO > 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. Thatโs not a vibe โ thatโs a warning, bestie. ๐
๐ Author ๐
The humans behind this masterpiece:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
โจ Further Details โจ
Okay, this is where the math girlies shine. Keep your wig on. ๐ง
If UPLO = 'U', then:
A = U*D*U**T
where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then:
A = L*D*L**T
where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then:
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k).
If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
๐ซถ Contributors ๐ซถ
Little history moment, bestie:
09-29-06โ patch from Bobby Cheng, MathWorks. Replacel.209andl.377:
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by:
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. DISNAN(ABSAKK) ) THEN
1-96โ based on modifications by J. Lewis, Boeing Computer Services Company.
๐ Definition ๐
Definition at line 190 of file zsytf2.f.
๐ค Author ๐ค
Generated automatically by Doxygen for LAPACK from the source code.
Thatโs the whole page, bestie! Footer vibes: LAPACK ยท Version 3.12.0 ยท hetf2(3). The date isnโt in this footer snippet, so Iโm not inventing one โ no cap, we donโt make up facts around here. Byeee, go factor something symmetric ๐
โจ
๐ฆ 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