/home/abui...RC/zhesv.f(3)

๐Ÿ“ฆ version 3.12.0, in opensuse-leap 16.0

๐Ÿ’œ zhesv.f โ€” the ZHESV subroutine, explained by your fave Unix bestie

okay so bestie, real talk โ€” this is a LAPACK routine page from /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zhesv.f. it's a Library Functions Manual situation (section 3, iykyk). let me break down the ZHESV vibe for you, no gatekeeping โœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

Functions/Subroutines

  • subroutine ZHESV (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info) โ€” this is the main character ๐ŸŽ€ and she literally computes the solution to the system of linear equations A * X = B for HE matrices. periodt.

๐Ÿฆ‹ Function/Subroutine Documentation ๐Ÿฆ‹

โœจ the ZHESV signature (copy it exactly, don't you dare paraphrase) โœจ

subroutine ZHESV (character uplo, integer n, integer nrhs, complex*16,
    dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv,
    complex*16, dimension( ldb, * ) b, integer ldb, complex*16, dimension( *
    ) work, integer lwork, integer info)

so this routine handles ZHESV and it computes the solution to a system of linear equations A * X = B for HE matrices. iconic behavior, honestly ๐Ÿ’…


๐ŸŽ€ Purpose ๐ŸŽ€

the actual doc-block, kept pristine:

!>
!> ZHESV computes the solution to a complex system of linear equations
!>    A * X = B,
!> where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS
!> matrices.
!>
!> The diagonal pivoting method is used to factor A as
!>    A = U * D * U**H,  if UPLO = 'U', or
!>    A = L * D * L**H,  if UPLO = 'L',
!> 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.  The factored form of A is then
!> used to solve the system of equations A * X = B.
!>

tl;dr โ€” she factors A with the diagonal pivoting method, then solves A * X = B with the factored form. slay.


๐ŸŒˆ Parameters ๐ŸŒˆ

okay so here's every single one, because we do NOT skip the boring parts in this house ๐Ÿซถ

1. UPLO

!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!>
  • character*1, and it tells us which triangle is living in A โ€” 'U' for upper, 'L' for lower. pick your fighter โœจ

2. N

!>          N is INTEGER
!>          The number of linear equations, i.e., the order of the
!>          matrix A.  N >= 0.
!>
  • integer, the number of linear equations (aka the order of matrix A), and it's gotta be N >= 0. no negativity allowed ๐Ÿ’€

3. NRHS

!>          NRHS is INTEGER
!>          The number of right hand sides, i.e., the number of columns
!>          of the matrix B.  NRHS >= 0.
!>
  • integer, the number of right hand sides, i.e. the number of columns in matrix B. also NRHS >= 0. keeping it consistent, love that.

4. 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, if INFO = 0, the block diagonal matrix D and the
!>          multipliers used to obtain the factor U or L from the
!>          factorization A = U*D*U**H or A = L*D*L**H as computed by
!>          ZHETRF.
!>
  • COMPLEX*16 array, dimension (LDA,N).
  • on entry โ€” the Hermitian matrix A. if UPLO = 'U', the leading N-by-N upper triangular part holds the upper triangle of A and the strictly lower triangular part is not referenced. if UPLO = 'L', the leading N-by-N lower triangular part holds the lower triangle and the strictly upper triangular part is not referenced. mind the triangle, bestie ๐Ÿ™ˆ
  • on exit, if INFO = 0, you get the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**H or A = L*D*L**H as computed by ZHETRF. she ate. ๐Ÿ”ฅ

5. LDA

!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!>
  • integer, the leading dimension of array A, and LDA >= max(1,N). non-negotiable โœ‹

6. IPIV

!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges and the block structure of D, as
!>          determined by ZHETRF.  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.
!>
  • integer array, dimension (N).
  • the tea on the interchanges and the block structure of D, as determined by ZHETRF โ˜•
  • if IPIV(k) > 0 โ†’ 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 โ†’ 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 โ†’ 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 it's a lot of cases. no we're not skipping them. ๐Ÿซก

7. B

!>          B is COMPLEX*16 array, dimension (LDB,NRHS)
!>          On entry, the N-by-NRHS right hand side matrix B.
!>          On exit, if INFO = 0, the N-by-NRHS solution matrix X.
!>
  • COMPLEX*16 array, dimension (LDB,NRHS).
  • on entry โ†’ the N-by-NRHS right hand side matrix B.
  • on exit, if INFO = 0 โ†’ the N-by-NRHS solution matrix X. glow-up โœจ

8. LDB

!>          LDB is INTEGER
!>          The leading dimension of the array B.  LDB >= max(1,N).
!>
  • integer, the leading dimension of array B, and LDB >= max(1,N). same energy as LDA, honestly ๐Ÿ’…

9. WORK

!>          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
!>          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!>
  • COMPLEX*16 array, dimension (MAX(1,LWORK)).
  • on exit, if INFO = 0, WORK(1) returns the optimal LWORK. she's helpful like that ๐ŸŽ€

10. LWORK

!>          LWORK is INTEGER
!>          The length of WORK.  LWORK >= 1, and for best performance
!>          LWORK >= max(1,N*NB), where NB is the optimal blocksize for
!>          ZHETRF.
!>          for LWORK < N, TRS will be done with Level BLAS 2
!>          for LWORK >= N, TRS will be done with Level BLAS 3
!>
!>          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.
!>
  • integer, the length of WORK. LWORK >= 1, and for best performance LWORK >= max(1,N*NB), where NB is the optimal blocksize for ZHETRF.
  • for LWORK < N, TRS will be done with Level BLAS 2.
  • for LWORK >= N, TRS will be done with Level BLAS 3.
  • 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. lowkey the -1 magic trick ๐Ÿ”ฎ

11. INFO

!>          INFO is 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, so the solution could not be computed.
!>
  • integer, the vibe check of the whole call:
    • = 0 โ†’ successful exit, we love a happy ending ๐Ÿ’–
    • < 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, so the solution could not be computed. ๐Ÿ˜ญ big sad, no solution for you.

๐Ÿ‘‘ Author ๐Ÿ‘‘

the legends behind this:

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

and it's defined at line 169 of file zhesv.f. noted. ๐Ÿซถ


โญ Author (the page itself) โญ

this page was generated automatically by Doxygen for LAPACK from the source code. robot-authored, human-approved, iconic ๐Ÿ’€โœจ


so yeah, that's ZHESV. LAPACK, Version 3.12.0, dated /home/abui...RC/zhesv.f(3) โ€” and that's the whole page, bestie. you're welcome, go solve some Hermitian systems, mwah ๐ŸŽ€๐Ÿ’œ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from