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) โ€” CHETF2 computes 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) โ€” CSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).
  • subroutine dsytf2 (uplo, n, a, lda, ipiv, info) โ€” DSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).
  • subroutine ssytf2 (uplo, n, a, lda, ipiv, info) โ€” SSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).
  • subroutine zhetf2 (uplo, n, a, lda, ipiv, info) โ€” ZHETF2 computes 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) โ€” ZSYTF2 computes 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 โ€” UPLO is CHARACTER*1. tells us 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. (zero is allowed, she's flexible like that ๐Ÿ™ˆ)
  • 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). she does a little costume change on the way out, we love a transformation arc ๐Ÿ’–
  • LDA โ€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,N). (that max(1,N) is doing the lords work, do not come for her.)
  • IPIV โ€” IPIV is INTEGER array, dimension (N). the receipts: details of the interchanges and the block structure of D ๐Ÿ’€
    • if UPLO = 'U':
      • if IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
      • if IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block.
    • if UPLO = 'L':
      • if IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
      • if IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
  • INFO โ€” INFO is INTEGER. the vibe check at the end:
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value
    • > 0: if INFO = k, D(k,k) is exactly zero. 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 ๐Ÿ˜ญ
โš ๏ธ bestie do NOT ignore a positive INFO. the factorization did finish, but D is 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 lines l.210 and l.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', then A = 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) 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**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) 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).

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 โ€” UPLO is CHARACTER*1. 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, the symmetric 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
  • LDA โ€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,N). she's back and she still eats ๐Ÿ’…
  • 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 columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
      • if IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block.
    • if UPLO = 'L':
      • if IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
      • if IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
  • INFO โ€” INFO is INTEGER.
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value
    • > 0: if INFO = k, D(k,k) is exactly zero. 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 ๐Ÿ˜ญ
โš ๏ธ same warning as before, fr fr: positive INFO means D is 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) 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).

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) 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. 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 line 190 of file csytf2.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. 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: the block diagonal matrix D and the multipliers used to obtain the factor U or L (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 columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
  • If IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block.

If UPLO = 'L':

  • If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
  • If IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.

INFO โ€” INFO is INTEGER.

  • = 0: successful exit ๐ŸŽ‰
  • < 0: if INFO = -k, the k-th argument had an illegal value
  • > 0: if INFO = k, D(k,k) is exactly zero. 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 ๐Ÿ’€

๐Ÿ’– 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) 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)* ...,

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) 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, 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 line 193 of file dsytf2.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. 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: the block diagonal matrix D and the multipliers used to obtain the factor U or L (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 columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block. โœจ
      • If IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. ๐ŸŽ€
    • If UPLO = 'L':
      • If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block. ๐Ÿ’–
      • If IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. ๐Ÿฆ‹
  • INFO โ€” INTEGER. OMG the receipts: = 0: successful exit ๐ŸŽ‰; < 0: if INFO = -k, the k-th argument had an illegal value ๐Ÿ˜ญ; > 0: if INFO = k, D(k,k) is exactly zero. 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. ๐Ÿ’€ 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 matrix A is 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 matrix A. It must satisfy N >= 0. Zero is allowed, bestie โ€” matrix can be baby. ๐Ÿ‘‘
  • A โ€” COMPLEX*16 array, dimension (LDA,N). On entry, this is the symmetric 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, A is doing double duty: it holds the block diagonal matrix D plus the multipliers used to obtain the factor U or L (peep Further Details below for the full lore). ๐Ÿ’–
  • LDA โ€” INTEGER. The leading dimension of the array A. 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 of D. It gets a little choose-your-own-adventure depending on UPLO:
    • If UPLO = 'U':
      • If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block. Slay. ๐ŸŽ€
      • If IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. Iconic little duo. ๐Ÿ‘ฏ
    • If UPLO = 'L':
      • If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block. Same energy. ๐Ÿ’…
      • If IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. Matching set, honestly. ๐Ÿซถ
  • INFO โ€” INTEGER. The exit-status bestie:
    • INFO = 0: successful exit. We love a clean getaway. โœจ
    • INFO < 0: if INFO = -k, the k-th argument had an illegal value. Ruh-roh. ๐Ÿ˜ญ
    • INFO > 0: if INFO = k, D(k,k) is exactly zero. 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. 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. Replace l.209 and l.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