/home/abui...RC/zhesv.f(3)
๐ 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 equationsA * X = Bfor 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 beN >= 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. alsoNRHS >= 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*16array, dimension(LDA,N).- on entry โ the Hermitian matrix
A. ifUPLO = 'U', the leading N-by-N upper triangular part holds the upper triangle ofAand the strictly lower triangular part is not referenced. ifUPLO = '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 matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**HorA = L*D*L**Has computed byZHETRF. 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, andLDA >= 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 byZHETRFโ - if
IPIV(k) > 0โ rows and columnskandIPIV(k)were interchanged, andD(k,k)is a 1-by-1 diagonal block. - if
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0โ rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. - if
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0โ rows and columnsk+1and-IPIV(k)were interchanged andD(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*16array, dimension(LDB,NRHS).- on entry โ the N-by-NRHS right hand side matrix
B. - on exit, if
INFO = 0โ the N-by-NRHS solution matrixX. 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, andLDB >= max(1,N). same energy asLDA, honestly ๐
9. WORK
!> WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
!> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!>
COMPLEX*16array, dimension(MAX(1,LWORK)).- on exit, if
INFO = 0,WORK(1)returns the optimalLWORK. 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 performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forZHETRF. - 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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued by XERBLA. lowkey the-1magic 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โ ifINFO = -i, the i-th argument had an illegal value ๐จ> 0โ ifINFO = i,D(i,i)is exactly zero. the factorization has been completed, but the block diagonal matrixDis 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
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms