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_RK computes 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_RK computes 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_RK computes 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_RK computes 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_RK computes 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_RK computes 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 > 0 means D is 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 (or L) is the unit upper (or lower) triangular matrix,
  • U**T (or L**T) is the transpose of U (or L),
  • P is a permutation matrix, and P**T is the transpose of P,
  • D is 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 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, it contains:

  • a) only the diagonal elements of the symmetric block diagonal matrix D, sitting on the diagonal of A, i.e. D(k,k) = A(k,k) (the superdiagonal, or subdiagonal, elements of D get 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.

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, and E(1) is set to 0;
  • If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, and E(N) is set to 0.
NOTE 🫢 For a 1-by-1 diagonal block D(k), where 1 <= k <= N, the element E(k) is set to 0 in both the UPLO = 'U' and UPLO = '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) > 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.

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 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: 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: ✨

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 (or L) is the unit upper (or lower) triangular matrix,
  • U**T (or L**T) is the transpose of U (or L),
  • P is a permutation matrix, and P**T is the transpose of P,
  • 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 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 β€” A is DOUBLE PRECISION array, dimension (LDA,N). Bestie, this is the main character of the whole function. On entry, it's the symmetric matrix A, and here's how she's read:
    • 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, she's been transformed, and contains:

  1. ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of A, i.e. D(k,k) = A(k,k) β€” and yeah, the superdiagonal (or subdiagonal) elements of D are stored on exit in array E instead, periodt.
  2. If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.
  • LDA β€” LDA is INTEGER. It's the leading dimension of the array A, and the rule is LDA >= max(1,N). No cap, it's literally just a constraint. πŸ’…
  • E β€” E is DOUBLE PRECISION 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, 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. Zeroed out, every time, no exceptions. 🫢
  • IPIV β€” IPIV is INTEGER array, 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) > 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. Iconic, nothing moved.
  • 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 β€” they do not show up solo, ever. πŸ’€)
    • 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. 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) > 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.
  • INFO β€” INFO is INTEGER, the vibe report at the end. 🌈
    • = 0: successful exit. Slay, she ate, no notes. πŸ’–
    • < 0: If INFO = -k, the k-th argument had an illegal value. Someone passed something cursed, go check your args.
    • > 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. Ma'am. That's a whole crisis. 😭

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. 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 β€” 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. That's the rule, no negotiating.
  • A β€” A is REAL array, dimension (LDA,N). Note the REAL, bestie β€” she's single precision now, the DOUBLE PRECISION version up above is her sister. πŸ’… 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, contains:

  1. ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of A, i.e. D(k,k) = A(k,k) β€” and the superdiagonal (or subdiagonal) elements of D are stored on exit in array E.
  2. If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N). Same rule as before, she's consistent.
  • E β€” E is REAL array, dimension (N). On exit, 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, 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. πŸŽ€
  • 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) > 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.

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.

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 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.

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 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.

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) > 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' β€” this time 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.

INFO

INFO is INTEGER, and it's your little status report at the end, bestie πŸ“¬

  • = 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.

🚨 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

  • 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*16 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, contains:
    • a) ONLY diagonal elements of the symmetric 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.

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 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, 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. 🫢

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) > 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.

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.

🚨 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