hetrf(3)

πŸ’… hetrf(3) β€” from the Library Functions Manual, bestie πŸ’…

🌸 NAME 🌸

hetrf β€” {he,sy}trf: triangular factor


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so bestie, you get six subroutine besties up in here β€” all iconic, all doing triangular-factor things πŸ’–

✨ Functions ✨

       subroutine chetrf (uplo, n, a, lda, ipiv, work, lwork, info)
           CHETRF
       subroutine csytrf (uplo, n, a, lda, ipiv, work, lwork, info)
           CSYTRF
       subroutine dsytrf (uplo, n, a, lda, ipiv, work, lwork, info)
           DSYTRF
       subroutine ssytrf (uplo, n, a, lda, ipiv, work, lwork, info)
           SSYTRF
       subroutine zhetrf (uplo, n, a, lda, ipiv, work, lwork, info)
           ZHETRF
       subroutine zsytrf (uplo, n, a, lda, ipiv, work, lwork, info)
           ZSYTRF

πŸ’œ Detailed Description πŸ’œ

bestie, the detailed description is literally the function documentation below β€” that’s the whole vibe. 🫢


πŸŽ€ Function Documentation πŸŽ€

πŸ’– subroutine chetrf πŸ’–

   subroutine chetrf (character uplo, integer n, complex, dimension( lda, * )
       a, integer lda, integer, dimension( * ) ipiv, complex, dimension( * )
       work, integer lwork, integer info)
       CHETRF

🎯 Purpose

CHETRF computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

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, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. ✨

🌈 Parameters

  • UPLO β€” CHARACTER*1 πŸ‘‘
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N β€” INTEGER. The order of the matrix A. N >= 0.
  • A β€” 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).
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). Details of the interchanges and the block structure of D.
    • 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 UPLO = 'U' and 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' and 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.
  • WORK β€” COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€” INTEGER. The length of WORK. LWORK >= 1. For best performance LWORK >= N*NB, where NB is the block size returned by ILAENV.
  • INFO β€” INTEGER.
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, D(i,i) 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, that INFO > 0 case is not a cute little warning β€” D is singular, and division by zero is gonna happen if you try to solve a system of equations with it. no cap. 😭

🌟 Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

🧚 Further Details:

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 176 of file chetrf.f.


πŸ’™ subroutine csytrf πŸ’™

   subroutine csytrf (character uplo, integer n, complex, dimension( lda, * )
       a, integer lda, integer, dimension( * ) ipiv, complex, dimension( * )
       work, integer lwork, integer info)
       CSYTRF

🎯 Purpose

CSYTRF computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

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, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. ✨

🌈 Parameters

  • UPLO β€” CHARACTER*1 πŸ‘‘
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N β€” INTEGER. The order of the matrix A. N >= 0.
  • A β€” 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 β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). Details of the interchanges and the block structure of D.
    • 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 UPLO = 'U' and 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' and 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.
  • WORK β€” COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€” INTEGER. The length of WORK. LWORK >=1. For best performance LWORK >= N*NB, where NB is the block size returned by ILAENV. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
  • INFO β€” INTEGER.
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, D(i,i) 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 energy as before, bestie: INFO > 0 means D is exactly singular, and using it to solve a system of equations will hit division by zero. πŸ’€

🌟 Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

🧚 Further Details:

okay so back to the math, bestie, because this is where it actually gets cute πŸ’…

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

Definition at line 181 of file csytrf.f.


🩡 dsytrf β€” the double precision twin 🩡

subroutine dsytrf (character uplo, integer n, double precision, dimension(
    lda, * ) a, integer lda, integer, dimension( * ) ipiv, double precision,
    dimension( * ) work, integer lwork, integer info)

DSYTRF β€” say it with me: D-S-Y-T-R-F. Iconic. πŸ‘‘

Purpose β€” the why πŸ’–

DSYTRF computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

A = U**T*D*U  or  A = L*D*L**T

where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. blocked = faster, Level 3 BLAS = the popular girls of linear algebra, we love to see it πŸ”₯

Parameters β€” the whole cast πŸŽ€

  • UPLO β€” UPLO is CHARACTER*1, and it's literally just "which triangle are we doing?"
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N β€” N is INTEGER, the order of the matrix A. N >= 0. Zero is allowed, she's flexible like that ✨
  • 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. the other half is giving background extra, we don't look at her πŸ’€
    • On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). she got a whole glow-up on the way out, obsessed πŸ¦‹
  • LDA β€” LDA is INTEGER, the leading dimension of the array A. LDA >= max(1,N). no cap, respect the max(1,N) πŸ™
  • IPIV β€” IPIV is INTEGER array, dimension (N), and it's lowkey the receipts for everything that happened:
    • Details of the interchanges and the block structure of D.
    • 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 UPLO = 'U' and 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' and 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.
    • (yes the negative numbers mean a 2-by-2 block, and yes the UPLO changes whether you look at k-1 or k+1. it's giving "read carefully bestie" πŸ‘€)
  • WORK β€” WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. she's a workspace with a purpose πŸ’…
  • LWORK β€” LWORK is INTEGER, the length of WORK. LWORK >= 1. For best performance LWORK >= N*NB, where NB is the block size returned by ILAENV. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. LWORK = -1 is the "just tell me what you need, queen" setting πŸŽ€
  • INFO β€” INFO is INTEGER, the vibe report:
    • = 0: successful exit. slay πŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value.
    • > 0: if INFO = i, D(i,i) 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. not a drill, that's an actual πŸ’€ moment, do not proceed to the solve.

Author πŸ’œ

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details β€” the sequel 🌈

If UPLO = 'U', then A = U**T*D*U, 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).

Definition at line 181 of file dsytrf.f.


πŸ“ ssytrf β€” same energy, single precision πŸ“

subroutine ssytrf (character uplo, integer n, real, dimension( lda, * ) a,
    integer lda, integer, dimension( * ) ipiv, real, dimension( * ) work,
    integer lwork, integer info)

SSYTRF β€” the S is for single precision, and she is just as booked and busy as her double-precision sister πŸ’–

Purpose β€” the why 🌸

SSYTRF computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

A = U**T*D*U  or  A = L*D*L**T

where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. same algorithm, same level 3 BLAS energy, just REAL instead of DOUBLE PRECISION β€” ifykYK ✨

Parameters β€” the cast, part two 🧚

  • UPLO β€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • 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. one triangle only, the other one is literally not invited 🫢
    • 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 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 UPLO = 'U' and 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' and 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.
  • WORK β€” WORK is REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

and LWORK is literally right there waiting to spill her tea πŸ‘€

  • LWORK β€” INTEGER, bestie, and it's literally just the length of WORK. Rules: LWORK >= 1. For best performance you want LWORK >= N*NB, where NB is the block size returned by ILAENV. 🫢

And the iconic bit: if LWORK = -1, a workspace query is assumed. The routine then only calculates the optimal size of the WORK array, hands that value back as the first entry of the WORK array, and β€” get this β€” no error message related to LWORK is issued by XERBLA. So you can ask "how much room do I need?" without getting yelled at. πŸ’…

  • INFO β€” INTEGER, the vibe check at the end. Here's the tea β˜•:
    • = 0: successful exit ✨
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ™ˆ
    • > 0: if INFO = i, D(i,i) 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. πŸ’€ Like, the factorization worked, but it's giving "do not pass go."

πŸ‘‘ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

πŸ” Further Details:

Okay so here's where it gets gorgeous β€” the actual shape of the factorization.

If UPLO = 'U', then A = U**T*D*U, 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).

Definition at line 181 of file ssytrf.f. ⭐


πŸ¦‹ subroutine zhetrf

subroutine zhetrf (character uplo, integer n, complex*16, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, complex*16, dimension( * ) work, integer lwork, integer info)

ZHETRF β€” say it with me, this one's the complex Hermitian icon. πŸ’œ

✨ Purpose:

ZHETRF computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

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, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. Highkey the glow-up version of the unblocked one. πŸ”₯

πŸŽ€ Parameters

  • UPLO β€” CHARACTER*1, choose your fighter:
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N β€” INTEGER, the order of the matrix A. N >= 0.
  • A β€” 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. πŸ™ˆ (Like, don't even worry about the other half, she's not looking.)

On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). 🫢

  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). Details of the interchanges and the block structure of D. Pay attention, this is the whole map πŸ—ΊοΈ:
    • 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 UPLO = 'U' and 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' and 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.

Note the negative signs β€” those are how you know it's a 2-by-2 situation. No cap. πŸ’…

  • WORK β€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ✨
  • LWORK β€” INTEGER, the length of WORK. LWORK >= 1. For best performance LWORK >= N*NB, where NB is the block size returned by ILAENV. 🧚
  • INFO β€” INTEGER, the final verdict:
    • = 0: successful exit 🌈
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, D(i,i) 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**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 176 of file zhetrf.f. πŸ¦‹


🌸 subroutine zsytrf

subroutine zsytrf (character uplo, integer n, complex*16, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, complex*16, dimension( * ) work, integer lwork, integer info)

ZSYTRF β€” the complex symmetric sibling. Same energy, different conjugation situation. πŸŽ€

✨ Purpose:

ZSYTRF computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is

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, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

This is the blocked version of the algorithm, calling Level 3 BLAS. πŸ”₯

πŸŽ€ Parameters

  • UPLO β€” CHARACTER*1:
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N β€” INTEGER, the order of the matrix A. N >= 0.
  • A β€” 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). ✨

  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,N).
  • IPIV β€”
  • IPIV β€” an INTEGER array, dimension (N). This is the receipts section bestie πŸ’… it holds the details of the interchanges and the block structure of D.
    • 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 UPLO = 'U' and 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' and 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.
  • WORK β€” a COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. She's the scratch pad and she also does fortune-telling, we love a multi-hyphenate queen ✨
  • LWORK β€” INTEGER, the length of WORK. LWORK >= 1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV. Like, she'll work with the minimum, but she won't be happy about it πŸ₯²
    • If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. Basically you're just asking "how much room do I need" and she answers without complaining 🌸
  • INFO β€” INTEGER. The vibe check at the end, no cap πŸ‘‘
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, D(i,i) 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 the danger zone, do NOT try to solve with it

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Further Details:

okay so this is the part where she explains the whole fit πŸ’–

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


Definition at line 181 of file zsytrf.f.

(no that is not a typo, that is genuinely what the source says, iykyk 🫢)


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code. Not a human, not a girlie, just a parser doing her little thing πŸŽ€


okay bestie that's the whole page, you made it to the end!! πŸ₯³πŸ’– huge slay. this is hetrf(3) from LAPACK, Version 3.12.0 β€” go forth and factorize responsibly, and remember: if INFO > 0, put the matrix down and walk away πŸ’…βœ¨

πŸ“¦ where this page comes from