complex16HEcomputational(3)
β¨ complex16HEcomputational β¨
okay so bestie, welcome to complex16HEcomputational(3) β this is the LAPACK manual page for the entire squad of complex16 computational functions for HE matrices π it's giving big group-chat energy, it's giving "let me introduce you to all my friends", and honestly? every single one of them ate. π
πΈ NAME πΈ
complex16HEcomputational β complex16 π¦
β¨ SYNOPSIS β¨
π«Ά Functions π«Ά
subroutine zhecon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)β ZHECONsubroutine zhecon_3 (UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, INFO)β ZHECON_3subroutine zhecon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)β ZHECON_ROOK estimates the reciprocal of the condition number for HE matrices using the factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges).subroutine zheequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)β ZHEEQUBsubroutine zhegs2 (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β ZHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorization results obtained fromcpotrf(unblocked algorithm).subroutine zhegst (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β ZHEGSTsubroutine zherfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)β ZHERFSsubroutine zherfsx (UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)β ZHERFSXsubroutine zhetd2 (UPLO, N, A, LDA, D, E, TAU, INFO)β ZHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transformation (unblocked algorithm).subroutine zhetf2 (UPLO, N, A, LDA, IPIV, INFO)β ZHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm, calling Level 2 BLAS).subroutine 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 zhetf2_rook (UPLO, N, A, LDA, IPIV, INFO)β ZHETF2_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine zhetrd (UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)β ZHETRDsubroutine zhetrd_2stage (VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)β ZHETRD_2STAGEsubroutine zhetrd_he2hb (UPLO, N, KD, A, LDA, AB, LDAB, TAU, WORK, LWORK, INFO)β ZHETRD_HE2HBsubroutine zhetrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β ZHETRFsubroutine zhetrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β ZHETRF_AAsubroutine zhetrf_rk (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)β ZHETRF_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).subroutine zhetrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β ZHETRF_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (blocked algorithm, calling Level 3 BLAS).subroutine zhetri (UPLO, N, A, LDA, IPIV, WORK, INFO)β ZHETRIsubroutine zhetri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β ZHETRI2subroutine zhetri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)β ZHETRI2Xsubroutine zhetri_3 (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)β ZHETRI_3subroutine zhetri_3x (UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO)β ZHETRI_3Xsubroutine zhetri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)β ZHETRI_ROOK computes the inverse of HE matrix using the factorization obtained with the bounded Bunch-Kaufman ('rook') diagonal pivoting method.subroutine zhetrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β ZHETRSsubroutine zhetrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)β ZHETRS2subroutine zhetrs_3 (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)β ZHETRS_3subroutine zhetrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)β ZHETRS_AAsubroutine zhetrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β ZHETRS_ROOK computes the solution to a system of linear equationsA * X = Bfor HE matrices using the factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges).subroutine zla_heamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)β ZLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bounds.double precision function zla_hercond_c (UPLO, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)β ZLA_HERCOND_C computes the infinity norm condition number ofop(A)*inv(diag(c))for Hermitian indefinite matrices.double precision function zla_hercond_x (UPLO, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)β ZLA_HERCOND_X computes the infinity norm condition number ofop(A)*diag(x)for Hermitian indefinite matrices.subroutine zla_herfsx_extended (PREC_TYPE, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, COLEQU, C, B, LDB, Y, LDY, BERR_OUT, N_NORMS, ERR_BNDS_NORM, ERR_BNDS_COMP, RES, AYB, DY, Y_TAIL, RCOND, ITHRESH, RTHRESH, DZ_UB, IGNORE_CWISE, INFO)β ZLA_HERFSX_EXTENDED improves the computed solution to a system of linear equations for Hermitian indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.double precision function zla_herpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)β ZLA_HERPVGRWsubroutine zlahef (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)β ZLAHEF computes a partial factorization of a complex Hermitian indefinite matrix using the Bunch-Kaufman diagonal pivoting method (blocked algorithm, calling Level 3 BLAS).subroutine zlahef_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)β ZLAHEF_AAsubroutine zlahef_rk (UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, INFO)β ZLAHEF_RK computes a partial factorization of a complex Hermitian indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method.subroutine zlahef_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)β ZLAHEF_ROOK
π Detailed Description π
This is the group of complex16 computational functions for HE matrices. that's it. that's the whole description. short, sweet, and absolutely iconic of them π
π Function Documentation π
π subroutine zhecon π
subroutine zhecon (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision ANORM, double precision RCOND, complex*16, dimension( * ) WORK, integer INFO)
ZHECON
π Purpose π
okay so ZHECON estimates the reciprocal of the condition number of a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as:
RCOND = 1 / (ANORM * norm(inv(A)))
π§ Parameters π§
UPLOβUPLOisCHARACTER*1. Tells you whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZHETRF.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF.ANORMβANORMisDOUBLE PRECISION. The 1-norm of the original matrixA.RCONDβRCONDisDOUBLE PRECISION. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKβWORKisCOMPLEX*16array, dimension(2*N).INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
π«Ά Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zhecon_3 π
subroutine zhecon_3 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, double precision ANORM, double precision RCOND, complex*16, dimension( * ) WORK, integer INFO)
ZHECON_3
π Purpose π
ZHECON_3 estimates the reciprocal of the condition number (in the 1-norm) of a complex Hermitian matrix A using the factorization computed by ZHETRF_RK or ZHETRF_BK:
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.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). This routine uses BLAS3 solver ZHETRS_3.
π§ Parameters π§
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix:= 'U': Upper triangular, form isA = P*U*D*(U**H)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**H)*(P**T).
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byZHETRF_RKandZHETRF_BK:- ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- ONLY diagonal elements of the Hermitian block diagonal matrix
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).Eβ and bestie, the description ofEis literally where this part of the page cuts off, so hold that thought πEβ COMPLEX*16 array, dimension (N). On entry it's holding the superdiagonal (or subdiagonal, depending on which side you're on) elements of the Hermitian block diagonal matrix D, which has 1-by-1 or 2-by-2 diagonal blocks. Specifically:- If UPLO = 'U':
E(i) = D(i-1,i),i=2:N, andE(1)is not referenced; - If UPLO = 'L':
E(i) = D(i+1,i),i=1:N-1, andE(N)is not referenced.
- If UPLO = 'U':
NOTE: for a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced β doesn't matter if UPLO = 'U' or UPLO = 'L', it just sits there unbothered. π
IPIVβ INTEGER array, dimension (N). All the deets on the interchanges and the block structure of D, as determined byZHETRF_RKorZHETRF_BK. Like, the receipts. π§ΎANORMβ DOUBLE PRECISION. The 1-norm of the original matrix A.RCONDβ DOUBLE PRECISION. The reciprocal of the condition number of the matrix A, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine. It's giving "how invertible are we actually". πWORKβ COMPLEX*16 array, dimension(2*N).INFOβ INTEGER.= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
June 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
School of Mathematics,
University of Manchester
π¦ zhecon_rook π¦
subroutine zhecon_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision
ANORM, double precision RCOND, complex*16, dimension( * ) WORK, integer
INFO)
ZHECON_ROOK estimates the reciprocal of the condition number fort HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges)
Purpose:
ZHECON_ROOK estimates the reciprocal of the condition number of a complex
Hermitian matrix A using the factorization A = U*D*U**H or
A = L*D*L**H computed by CHETRF_ROOK.
An estimate is obtained for norm(inv(A)), and the reciprocal of the
condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
Parameters
UPLOβ CHARACTER*1. Tells you whether the factorization details are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
Nβ INTEGER. The order of the matrix A.N >= 0.Aβ COMPLEX*16 array, dimension(LDA,N). The block diagonal matrix D plus the multipliers used to obtain the factor U or L, as computed byCHETRF_ROOK.LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N).IPIVβ INTEGER array, dimension (N). The details of the interchanges and the block structure of D, as determined byCHETRF_ROOK. πANORMβ DOUBLE PRECISION. The 1-norm of the original matrix A.RCONDβ DOUBLE PRECISION. The reciprocal of the condition number of the matrix A, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKβ COMPLEX*16 array, dimension(2*N).INFOβ INTEGER.= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
June 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
School of Mathematics,
University of Manchester
πΈ zheequb πΈ
subroutine zheequb (character UPLO, integer N, complex*16, dimension( lda, *
) A, integer LDA, double precision, dimension( * ) S, double precision
SCOND, double precision AMAX, complex*16, dimension( * ) WORK, integer
INFO)
ZHEEQUB
Purpose:
ZHEEQUB computes row and column scalings intended to equilibrate a
Hermitian matrix A (with respect to the Euclidean norm) and reduce
its condition number. The scale factors S are computed by the BIN
algorithm (see references) so that the scaled matrix B with elements
B(i,j) = S(i)*A(i,j)*S(j) has a condition number within a factor N of
the smallest possible condition number over all possible diagonal
scalings.
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). The N-by-N Hermitian matrix whose scaling factors are about to be computed. Bestie, we're finding its glow-up numbers. β¨LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N).Sβ DOUBLE PRECISION array, dimension (N). IfINFO = 0, S contains the scale factors for A.SCONDβ DOUBLE PRECISION. IfINFO = 0, S contains the ratio of the smallestS(i)to the largestS(i). IfSCOND >= 0.1and AMAX is neither too large nor too small, it is not worth scaling by S. Don't do it, it's a waste of time fr fr.AMAXβ DOUBLE PRECISION. Largest absolute value of any matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled. Like, genuinely. That's not a vibe, that's a requirement. π¨WORKβ COMPLEX*16 array, dimension(2*N).INFOβ INTEGER.= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i, the i-th diagonal element is nonpositive.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
References:
Livne, O.E. and Golub, G.H., 'Scaling by Binormalization',
Numerical Algorithms, vol. 35, no. 1, pp. 97-120, January 2004.
DOI 10.1023/B:NUMA.0000016606.32820.69
Tech report version:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.1679
π zhegs2 π
subroutine zhegs2 (integer ITYPE, character UPLO, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
integer LDB, integer INFO)
ZHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorization results obtained from cpotrf (unblocked algorithm).
Purpose:
ZHEGS2 reduces a complex Hermitian-definite generalized
eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x,
and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or
B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H *A*L.
B must have been previously factorized as U**H *U or L*L**H by ZPOTRF.
Parameters
ITYPEβ INTEGER.= 1: computeinv(U**H)*A*inv(U)orinv(L)*A*inv(L**H);= 2 or 3: computeU*A*U**HorL**H *A*L.
UPLOβ CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored, and how B has been factorized.= 'U': Upper triangular= 'L': Lower triangular
Nβ INTEGER. The order of the matrices A and B.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.
On exit, if INFO = 0, the transformed matrix, stored in the same format as A. She's different now. π
LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N).Bβ COMPLEX*16 array, dimension(LDB,N). The triangular factor from the Cholesky factorization of B, as returned byZPOTRF. B is modified by the routine but restored on exit β so don't panic, she comes back. π«ΆLDBβ INTEGER. The leading dimension of the array B.LDB >= max(1,N).INFOβ INTEGER.= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π zhegst π
subroutine zhegst (integer ITYPE, character UPLO, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
integer LDB, integer INFO)
ZHEGST
Purpose:
ZHEGST reduces a complex Hermitian-definite generalized
eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x,
and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or
B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H*A*L.
B must have been previously factorized as U**H*U or L*L**H by ZPOTRF.
Parameters
ITYPEITYPEβ INTEGER, the vibe-setter for what exactly we're computing:= 1: computeinv(U**H)*A*inv(U)orinv(L)*A*inv(L**H);= 2or3: computeU*A*U**HorL**H*A*L.
UPLOβ CHARACTER1*, which triangle ofAwe're even looking at:= 'U': upper triangle ofAis stored andBis factored asU**H*U;= 'L': lower triangle ofAis stored andBis factored asL*L**H.
Nβ INTEGER, the order of the matricesAandB. Constraint check bestie:N >= 0πAβ COMPLEX*16 array, dimension(LDA,N). On entry, this is the Hermitian matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAholds the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced (aka don't bother, it's not invited to the party). IfUPLO = 'L', the leading N-by-N lower triangular part ofAholds the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, if INFO = 0, this is the transformed matrix, stored in the same format as A. glow up complete β¨
LDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,N). No cap π§’Bβ COMPLEX*16 array, dimension(LDB,N). The triangular factor from the Cholesky factorization ofB, as returned byZPOTRF.
Heads up: B is modified by the routine but restored on exit. She's a temporary guest star, not a permanent resident π
LDBβ INTEGER, the leading dimension of the arrayB.LDB >= max(1,N).INFOβ INTEGER, the receipts π:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value. not slay
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
zherfs
subroutine zherfs (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF,
integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( ldb,
* ) B, integer LDB, complex*16, dimension( ldx, * ) X, integer LDX,
double precision, dimension( * ) FERR, double precision, dimension( * )
BERR, complex*16, dimension( * ) WORK, double precision, dimension( * )
RWORK, integer INFO)
Purpose
ZHERFS improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian indefinite, and provides error bounds and backward error estimates for the solution. She's not just giving you an answer, she's giving you an answer with receipts πβ¨
Parameters
UPLOβ CHARACTER1*, which triangle situation we're in:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
Nβ INTEGER, the order of the matrixA.N >= 0.NRHSβ INTEGER, the number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0. Like, how many problems are we solving at once bestie πAβ COMPLEX*16 array, dimension(LDA,N). The Hermitian matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. Same energy as before: only one triangle gets a seat at the table πͺLDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,N).AFβ COMPLEX*16 array, dimension(LDAF,N). The factored form of the matrixA.AFcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**HorA = L*D*L**Has computed byZHETRF.LDAFβ INTEGER, the leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβ INTEGER array, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF. It's the lore πBβ COMPLEX*16 array, dimension(LDB,NRHS). The right hand side matrixB.LDBβ INTEGER, the leading dimension of the arrayB.LDB >= max(1,N).Xβ COMPLEX*16 array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byZHETRS. On exit, the improved solution matrixX. glow-up arc, but for numbers πLDXβ INTEGER, the leading dimension of the arrayX.LDX >= max(1,N).FERRβ DOUBLE PRECISION array, dimension(NRHS). The estimated forward error bound for each solution vectorX(j)(the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. She's a little dramatic, she overestimates, but she's trustworthy fr fr π«ΆBERRβ DOUBLE PRECISION array, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). Tiny lil nudge and suddenly it's perfect β¨WORKβ COMPLEX*16 array, dimension(2*N)RWORKβ DOUBLE PRECISION array, dimension(N)INFOβ INTEGER, the receipts:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value.
Internal Parameters
ITMAX is the maximum number of steps of iterative refinement. She keeps going until it's giving perfection, but there's a limit bestie π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
zherfsx
subroutine zherfsx (character UPLO, character EQUED, integer N, integer
NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( * ) S, complex*16, dimension( ldb, * ) B,
integer LDB, complex*16, dimension( ldx, * ) X, integer LDX, double
precision RCOND, double precision, dimension( * ) BERR, integer
N_ERR_BNDS, double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double
precision, dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, double
precision, dimension( * ) PARAMS, complex*16, dimension( * ) WORK,
double precision, dimension( * ) RWORK, integer INFO)
Purpose
ZHERFSX improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian indefinite, and provides error bounds and backward error estimates for the solution. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. Like, she brought TWO sets of receipts, not just one ππ
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED and S below. In this case, the solution and error bounds returned are for the original unequilibrated system.
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. Basically: defaults are the moment, so if you're chill with them, just say NPARAMS = 0 and skip the whole argument π
Parameters
UPLOβ CHARACTER1*= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
EQUEDβ CHARACTER1*. Specifies the form of equilibration that was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly.= 'N': No equilibration= 'Y': Both row and column equilibration, i.e.,Ahas been replaced bydiag(S) * A * diag(S). The right hand sideBhas been changed accordingly.
Nβ INTEGER, the order of the matrixA.N >= 0.NRHSβ INTEGER, the number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aβ COMPLEX*16 array, dimension(LDA,N). The Hermitian matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.LDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,N).AFβ COMPLEX*16 array, dimension(LDAF,N). The factored form of the matrixA.AFcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**HorA = L*D*L**Has computed byZHETRF.LDAFβ INTEGER, the leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβ INTEGER array, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF.SSβSis aDOUBLE PRECISIONarray, dimension(N)π the scale factors forA. IfEQUED = 'Y',Agets multiplied on the left and right bydiag(S).Sis an input argument ifFACT = 'F'; otherwiseSis an output argument. IfFACT = 'F'andEQUED = 'Y', every element ofSmust be positive. IfSis output, each element ofSis a power of the radix. IfSis input, each element ofSshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. so real, bestie β powers of the radix or it gets messy πBβBisCOMPLEX*16array, dimension(LDB,NRHS)π¦ the right hand side matrixB.LDBβLDBisINTEGERthe leading dimension of the arrayB.LDB >= max(1,N).XβXisCOMPLEX*16array, dimension(LDX,NRHS)β¨ on entry, the solution matrixX, as computed byZHETRS. On exit, the improved solution matrixX. glow up πLDXβLDXisINTEGERthe leading dimension of the arrayX.LDX >= max(1,N).RCONDβRCONDisDOUBLE PRECISIONreciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. don't panic if it's tiny β sometimes the answer still eats πBERRβBERRisDOUBLE PRECISIONarray, dimension(NRHS)componentwise relative backward error. This is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). the tiniest change that makes it perfect β no cap β¨N_ERR_BNDSβN_ERR_BNDSisINTEGERnumber of error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow.ERR_BNDS_NORMβERR_BNDS_NORMisDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS)for each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned. three little data gems π
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon'). vibe check: trust or don't π«Άerr = 2'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. only trust it if the boolean said trust β periodt πerr = 3Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately 1. math but make it iconic π§
See Lapack Working Note 165 for further details and extra cautions. iykyk π
ERR_BNDS_COMPβERR_BNDS_COMPisDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS)for each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. so if you don't ask for componentwise, she stays unbothered π
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon'). same vibe check, componentwise edition πerr = 2'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. again β only trust if boolean says so, bestie πerr = 3Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately 1. more math, more slay π§
See Lapack Working Note 165 for further details and extra cautions. iykyk again π
NPARAMSβNPARAMSisINTEGERspecifies the number of parameters set inPARAMS. If<= 0, thePARAMSarray is never referenced and default values are used. no params, no problem β¨PARAMSβPARAMSisDOUBLE PRECISIONarray, dimensionNPARAMSspecifies algorithm parameters. If an entry is< 0.0, then that entry will be filled with default value used for that parameter. Only positions up toNPARAMSare accessed; defaults are used for higher-numbered parameters.PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not. Default:1.0D+0= 0.0: No refinement is performed, and no error bounds are computed. just raw dogging it, no refinement π³= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION. glow up with extra precision β¨- (other values are reserved for future use) mystery future vibes π
PARAMS(LA_LINRX_ITHRESH_I = 2): Maximum number of residual computations allowed for refinement. Default:10Aggressive: Set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. so if you go aggressive, those guarantees might ghost you πPARAMS(LA_LINRX_CWISE_I = 3): Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false. Default:1.0(attempt componentwise convergence) yes queen, go componentwise π
WORKβWORKisCOMPLEX*16array, dimension(2*N)RWORKβRWORKisDOUBLE PRECISIONarray, dimension(2*N)INFOβINFOisINTEGER= 0: Successful exit. The solution to every right-hand side is guaranteed. slay, all guaranteed π< 0: IfINFO = -i, thei-th argument had an illegal value. whoops, bad arg π> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned. singular matrix, no solution for you π= N+J: The solution corresponding to theJth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then theJth right-hand side is the first with a normwise error bound that is not guaranteed (the smallestJsuch thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) theJth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP. so basically the first messy right-hand side gets called out, and you gotta check the arrays yourself for the rest π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zhetd2 π¦β¨
subroutine zhetd2 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) D, double precision, dimension( * ) E, complex*16, dimension( * ) TAU, integer INFO)
ZHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transformation (unblocked algorithm). no cap, it's the glow-up pipeline for Hermitian matrices π
Purpose πΈ
ZHETD2 reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:
Q**H * A * Q = T.
Parameters π
UPLOβCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. The order of the matrixA.N >= 0.AβCOMPLEX*16array, 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 UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details.
LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).DβDOUBLE PRECISIONarray, dimension(N). The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).EβDOUBLE PRECISIONarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβCOMPLEX*16array, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).INFOβINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π§
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). obsessed with this little map honestly πΊοΈ
subroutine zhetf2 π
subroutine zhetf2 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
ZHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm, calling Level 2 BLAS).
Purpose β¨
ZHETF2 computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**H or A = L*D*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**H is the conjugate transpose of U, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS.
Parameters π
UPLOβCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. The order of the matrixA.N >= 0.AβCOMPLEX*16array, 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 arrayA.LDA >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD.
If UPLO = 'U':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k-1) < 0, then 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':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
INFOβINTEGER.= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations.
β οΈ bestie that> 0case is not a drill βDis exactly singular and if you try to solve with it you WILL divide by zero. do not pass go. π
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).
Contributors: π«Ά
09-29-06β patch from Bobby Cheng, MathWorks
Replace l.210 and l.393
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. DISNAN(ABSAKK) ) THEN
01-01-96β Based on modifications by J. Lewis, Boeing Computer Services Company, A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
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). the rook variant!! ββ¨
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 info, go peek at the Further Details section, bestie. π
β¨ Parameters β¨
UPLOβUPLOisCHARACTER*1. It tells us which triangular half of the Hermitian matrixAis actually chillin' in memory:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA. So like,N >= 0, obviously. πAβAisCOMPLEX*16array, dimension(LDA,N). On entry: it's the Hermitian matrixA, no cap.- If
UPLO = 'U': the leading N-by-N upper triangular part ofAholds the upper triangular part of the matrixA, and the strictly lower triangular part ofA? not referenced, we literally don't look at it. π - If
UPLO = 'L': the leading N-by-N lower triangular part ofAholds the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced either.
- If
On exit, A contains:
- a) ONLY the diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k). (The superdiagonal β or subdiagonal β elements ofDget stashed on exit in arrayEinstead, iykyk.) - b) If
UPLO = 'U': the factorUin the superdiagonal part ofA. IfUPLO = 'L': the factorLin the subdiagonal part ofA.
LDAβLDAisINTEGER. The leading dimension of the arrayA. Gotta beLDA >= max(1,N), periodt.EβEisCOMPLEX*16array, dimension(N). On exit, it holds the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where:- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N, andE(1)is set to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, andE(N)is set to0.
- If
NOTE: for a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in both theUPLO = 'U'andUPLO = 'L'cases. π
IPIVβIPIVisINTEGERarray, dimension(N).IPIVdescribes the permutation matrixPin the factorization of matrixA, like this: the absolute value ofIPIV(k)represents the index of the row and column that got interchanged with the k-th row and column. The value ofUPLOdescribes the order in which those interchanges were applied. Also β and this is the iconic part β the sign ofIPIVrepresents the block structure of the Hermitian block diagonal matrixDwith 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) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs.)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: any entry
IPIV(k)is always NONZERO on output. no cap.
If UPLO = 'L' (in factorization order, k increases from 1 to N):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs.)- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: any entry
IPIV(k)is always NONZERO on output.
INFOβINFOisINTEGER.= 0: successful exit, we ate. π< 0: ifINFO = -k, the k-th argument had an illegal value.> 0: ifINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
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:INFOonly stores the first occurrence of a singularity β any subsequent occurrence of singularity is not stored inINFO, even though the factorization always completes. lowkey important.
π 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
π subroutine zhetf2_rook π
subroutine zhetf2_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
ZHETF2_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).
β¨ Purpose: β¨
ZHETF2_ROOK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method:
A = U*D*U**H or A = L*D*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**H is the conjugate transpose of U, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. π
β¨ Parameters β¨
UPLOβUPLOisCHARACTER*1. Which triangular half of the Hermitian matrixAis stored, bestie:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA. IfUPLO = 'U', the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis 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βLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). All the deets on the interchanges and the block structure ofD:- If
UPLO = 'U':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- If
- If
UPLO = 'L':- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- If
- If
INFOβ hold up bestie,INFOgets its whole glow-up in the next part πINFOisINTEGER= 0: successful exit β¨< 0: ifINFO = -k, the k-th argument had an illegal value π¬> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. girl run, that's a singular block, do NOT divide by it π
π 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).
πΈ Contributors
November 2013, 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, USA
π¦ subroutine zhetrd (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) D, double precision, dimension( * ) E, complex*16, dimension( * ) TAU, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRD
β¨ Purpose
ZHETRD reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:
Q**H * A * Q = T.
π Parameters
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
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, if UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are over- written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details. π
LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
D
D is DOUBLE PRECISION array, dimension (N) The diagonal elements of the tridiagonal matrix T: D(i) = A(i,i).
E
E is DOUBLE PRECISION array, dimension (N-1) The off-diagonal elements of the tridiagonal matrix T: E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'.
TAU
TAU is COMPLEX*16 array, dimension (N-1) The scalar factors of the elementary reflectors (see Further Details).
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK. π
LWORK
LWORK is INTEGER The dimension of the array WORK. LWORK >= 1. For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.
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
INFO is INTEGER
= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π§ Further Details
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
π subroutine zhetrd_2stage (character VECT, character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) D, double precision, dimension( * ) E, complex*16, dimension( * ) TAU, complex*16, dimension( * ) HOUS2, integer LHOUS2, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRD_2STAGE
β¨ Purpose
ZHETRD_2STAGE reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:
Q1**H Q2**H* A * Q2 * Q1 = T.
π Parameters
VECT
VECT is CHARACTER*1
= 'N': No need for the Housholder representation, in particular for the second stage (Band to tridiagonal) and thusLHOUS2is of sizemax(1, 4*N);= 'V': the Householder representation is needed to either generateQ1 Q2or to applyQ1 Q2, thenLHOUS2is to be queried and computed. (NOT AVAILABLE IN THIS RELEASE). π«
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
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, if UPLO = 'U', the band superdiagonal of A are overwritten by the corresponding elements of the internal band-diagonal matrix AB, and the elements above the KD superdiagonal, with the array TAU, represent the unitary matrix Q1 as a product of elementary reflectors; if UPLO = 'L', the diagonal and band subdiagonal of A are over- written by the corresponding elements of the internal band-diagonal matrix AB, and the elements below the KD subdiagonal, with the array TAU, represent the unitary matrix Q1 as a product of elementary reflectors. See Further Details. π
LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
D
D is DOUBLE PRECISION array, dimension (N) The diagonal elements of the tridiagonal matrix T.
E
E is DOUBLE PRECISION array, dimension (N-1) The off-diagonal elements of the tridiagonal matrix T.
TAUTAUβCOMPLEX*16array, dimension(N-KD). It's holding the scalar factors of the elementary reflectors from the first stage (go peek at Further Details, bestie π ).HOUS2βCOMPLEX*16array, dimension(LHOUS2). This one stores the Householder representation of the stage2 band-to-tridiagonal glow-up β¨.LHOUS2βINTEGER. The dimension of the arrayHOUS2, no biggie.- If
LWORK = -1, orLHOUS2 = -1, then a query is assumed β the routine only calculates the optimal size of theHOUS2array, returns this value as the first entry of theHOUS2array, and no error message related toLHOUS2is issued byXERBLA. Periodt. - If
VECT='N',LHOUS2 = max(1, 4*n); - if
VECT='V', option not yet available. π (it's giving "coming soon", not us though)
- If
WORKβCOMPLEX*16array, dimension(LWORK).LWORKβINTEGER. The dimension of the arrayWORK.LWORK = MAX(1, dimension).- If
LWORK = -1, orLHOUS2=-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 byXERBLA. π«Ά LWORK = MAX(1, dimension)where
- If
dimension = max(stage1,stage2) + (KD+1)*N
= N*KD + N*max(KD+1,FACTOPTNB)
+ max(2*KD*KD, KD*NTHREADS)
+ (KD+1)*N
- where
KDis the blocking size of the reduction,FACTOPTNBis the blocking used by the QR or LQ algorithm, usuallyFACTOPTNB=128is a good choice, andNTHREADSis the number of threads used when openMP compilation is enabled, otherwise=1. Slay π
INFOβINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
Implemented by Azzam Haidar.
All details are available on technical report, SC11, SC13 papers. π
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
β¨ zhetrd_he2hb β the next main character π
subroutine zhetrd_he2hb (character UPLO, integer N, integer KD, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldab, * ) AB,
integer LDAB, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZHETRD_HE2HB π¦
π Purpose:
ZHETRD_HE2HB reduces a complex Hermitian matrix A to complex Hermitian band-diagonal form AB by a unitary similarity transformation:
Q**H * A * Q = AB.
okay so it literally takes your Hermitian matrix and gives it the band-diagonal glow-up, no cap β¨
π Parameters
UPLOβUPLOisCHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβNisINTEGER. The order of the matrix A.N >= 0.KDβKDisINTEGER. The number of superdiagonals of the reduced matrix ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0. The reduced matrix is stored in the arrayAB.AβAisCOMPLEX*16array, 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. IfUPLO = '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
UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details. π
- On entry, the Hermitian matrix A. If
LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).ABβABisCOMPLEX*16array, dimension(LDAB,N).- On exit, the upper or lower triangle of the Hermitian band matrix A, stored in the first
KD+1rows of the array. The j-th column of A is stored in the j-th column of the arrayABas follows: - if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- On exit, the upper or lower triangle of the Hermitian band matrix A, stored in the first
LDABβLDABisINTEGER. The leading dimension of the array AB.LDAB >= KD+1.TAUβTAUisCOMPLEX*16array, dimension(N-KD). The scalar factors of the elementary reflectors (see Further Details). β¨WORKβWORKisCOMPLEX*16array, dimension(LWORK). On exit, ifINFO = 0, or ifLWORK=-1,WORK(1)returns the size ofLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORKwhich should be calculated by a workspace query.LWORK = MAX(1, LWORK_QUERY).- 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 byXERBLA. LWORK_QUERY = N*KD + N*max(KD,FACTOPTNB) + 2*KD*KD- where
FACTOPTNBis the blocking used by the QR or LQ algorithm, usuallyFACTOPTNB=128is a good choice otherwise puttingLWORK=-1will provide the size ofWORK. π
- If
INFOβINFOisINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
Implemented by Azzam Haidar.
All details are available on technical report, SC11, SC13 papers. π
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(k)**H . . . H(2)**H H(1)**H, where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i+kd-1) = 0 and v(i+kd) = 1; conjg(v(i+kd+1:n)) is stored on exit in A(i,i+kd+1:n), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(kd+1:i) = 0 and v(i+kd+1) = 1; v(i+kd+2:n) is stored on exit in A(i+kd+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( ab ab/v1 v1 v1 v1 ) ( ab )
( ab ab/v2 v2 v2 ) ( ab/v1 ab )
( ab ab/v3 v3 ) ( v1 ab/v2 ab )
( ab ab/v4 ) ( v1 v2 ab/v3 ab )
( ab ) ( v1 v2 v3 ab/v4 ab )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i)..fi
π¦ 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)
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. slay.
Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis 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βLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD. IfIPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. IfUPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. π«ΆWORKβWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The length ofWORK.LWORK >=1. For best performanceLWORK >= N*NB, whereNBis the block size returned byILAENV.INFOβINFOisINTEGER= 0: successful exit β¨< 0: ifINFO = -i, thei-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, and division by zero will occur if it is used to solve a system of equations. π 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).
π§ ZHETRF_AA π§
subroutine zhetrf_aa (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
Purpose:
ZHETRF_AA computes the factorization of a complex hermitian matrix A using the Aasen's algorithm. The form of the factorization is
A = U**H*T*U or A = L*T*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a hermitian tridiagonal matrix. πΈ
This is the blocked version of the algorithm, calling Level 3 BLAS.
Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the hermitian matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, the tridiagonal matrix is stored in the diagonals and the subdiagonals of A just below (or above) the diagonals, and L is stored below (or above) the subdiagonals, when UPLO is 'L' (or 'U'). β¨
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofAwere interchanged with the row and columnIPIV(k).WORKβWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The length ofWORK.LWORK >= MAX(1,2*N). For optimum performanceLWORK >= N*(1+NB), whereNBis the optimal blocksize.
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βINFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π₯ ZHETRF_RK π₯
subroutine zhetrf_rk (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRF_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).
Purpose:
ZHETRF_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 blocked version of the algorithm, calling Level 3 BLAS. For more information see Further Details section.
Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA.- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
On exit, contains:
- ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA. π
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).Eβ β³ to be continuedβ¦
E β a COMPLEX*16 array, dimension (N) π
On exit, bestie, it's holding the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D, the one with all those 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 a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in both theUPLO = 'U'and theUPLO = 'L'cases. No exceptions, no loopholes π
IPIV β INTEGER array, dimension (N) π
IPIV is the whole story of the permutation matrix P in the factorization of matrix A, and here's how it goes. 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. And 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. Want the whole lore drop? See the Further Details section, it's all there β¨
If UPLO = 'U', and in factorization order k decreases from N to 1:
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs π) - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(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. Every single one, periodt.
If UPLO = 'L', and in factorization order k increases from 1 to N:
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs π) - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(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. Same energy as above, just flipped π
WORK β COMPLEX*16 array, dimension ( MAX(1,LWORK) ) π¦
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. It's giving "here's the number you actually wanted" π
LWORK β INTEGER
The length of WORK. LWORK >=1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV. Go big or go home, honestly.
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. It's just doing a lil recon mission π΅οΈββοΈ
INFO β INTEGER
= 0: successful exit π< 0: IfINFO = -k, thek-th argument had an illegal value π¨> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
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. Like, she finished the job but the result is a landmine π
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. One warning, that's the whole alert system bestie.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π
TODO: put correct description
(not me leaving the homework blank, iconic honestly)
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
subroutine zhetrf_rook π
subroutine zhetrf_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16,
dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRF_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (blocked algorithm, calling Level 3 BLAS). Yes, she does all of that π«Ά
Purpose: β¨
ZHETRF_ROOK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman ('rook') 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 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. Main character energy, obviously π₯
Parameters
UPLO β CHARACTER*1 π
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis 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. Mind ya business, other triangle π
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 UPLO = 'U':
- Only the last
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were interchanged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = 'L':
- Only the first
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were interchanged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
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.
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. Same recon mission as before, she's consistent π
INFO β INTEGER
= 0: successful exit π< 0: ifINFO = -i, thei-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, and division by zero will occur if it is used to solve a system of equations. Yeah. Watch out for that one π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π
okay so if UPLO = 'U', then bestie, A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is literally 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). periodt.
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). slay. π
Contributors:
June 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
subroutine zhetri (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer INFO)
ZHETRI
okay so this one is the moment π
. ZHETRI computes the inverse of a complex Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF.
Parameters
UPLOβ UPLO is CHARACTER*1. It's the vibe check for whether the details of the factorization are stored as an upper or lower triangular matrix. = 'U': Upper triangular, form isA = U*D*U**H; = 'L': Lower triangular, form isA = L*D*L**H.Nβ N is INTEGER. The order of the matrixA.N >= 0. No cap.Aβ A is COMPLEX*16 array, dimension (LDA,N). On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byZHETRF.
On exit, if INFO = 0, the (Hermitian) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
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 as determined byZHETRF.WORKβ WORK is COMPLEX*16 array, dimension (N).INFOβ INFO is INTEGER. = 0: successful exit < 0: ifINFO = -i, the i-th argument had an illegal value
0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author
Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd.
subroutine zhetri2 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRI2
ZHETRI2 computes the inverse of a COMPLEX*16 hermitian indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZHETRF. ZHETRI2 set the LEADING DIMENSION of the workspace before calling ZHETRI2X that actually computes the inverse. It's giving very much "I prep the workspace, you do the math" β¨.
Parameters
UPLOβ UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix. = 'U': Upper triangular, form isA = U*D*U**T; = 'L': Lower triangular, form isA = L*D*L**T.Nβ N is INTEGER. The order of the matrixA.N >= 0.Aβ A is COMPLEX*16 array, dimension (LDA,N). On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byZHETRF.
On exit, if INFO = 0, the (symmetric) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
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 as determined byZHETRF.WORKβ WORK is COMPLEX*16 array, dimension (N+NB+1)*(NB+3).LWORKβ LWORK is INTEGER. The dimension of the array WORK. WORK is size >= (N+NB+1)*(NB+3). IfLWORK = -1, then a workspace query is assumed; the routine 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β INFO is INTEGER. = 0: successful exit < 0: ifINFO = -i, the i-th argument had an illegal value
0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author
Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd.
subroutine zhetri2x (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( n+nb+1,* ) WORK, integer NB, integer INFO)
ZHETRI2X
ZHETRI2X computes the inverse of a COMPLEX*16 Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF. This is the actual computation, no cap π§’.
Parameters
UPLOβ UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix. = 'U': Upper triangular, form isA = U*D*U**H; = 'L': Lower triangular, form isA = L*D*L**H.Nβ N is INTEGER. The order of the matrixA.N >= 0.Aβ A is COMPLEX*16 array, dimension (LDA,N). On entry, the NNB diagonal matrix D and the multipliers used to obtain the factor U or L as computed byZHETRF.
On exit, if INFO = 0, the (symmetric) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
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 NNB structure of D as determined byZHETRF.WORKβ WORK is COMPLEX*16 array, dimension (N+NB+1,NB+3).NBβ NB is INTEGER. Block size.INFOβ INFO is INTEGER. = 0: successful exit < 0: ifINFO = -i, the i-th argument had an illegal value
0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author
Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd.
subroutine zhetri_3 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRI_3
ZHETRI_3 computes the inverse of a complex Hermitian indefinite matrix A using the factorization computed by ZHETRF_RK or ZHETRF_BK:
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.
ZHETRI_3 sets the leading dimension of the workspace before calling ZHETRI_3X that actually computes the inverse. This is the blocked version of the algorithm, calling Level 3 BLAS. It's the glow-up version π
.
Parameters
UPLOβ UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix. = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored.Nβ N is INTEGER. The order of the matrixA.N >= 0.AβAβAisCOMPLEX*16 array, dimension (LDA,N)π
On entry, bestie, you're handing over the diagonal of the block diagonal matrix D plus the factors U or L exactly as ZHETRF_RK and ZHETRF_BK cooked them up:
- ONLY the diagonal elements of the Hermitian block diagonal matrix D live on the diagonal of
A, i.e.D(k,k) = A(k,k); (the superdiagonal (or subdiagonal) elements of D should be provided on entry in arrayE), and - If
UPLO = 'U': factor U sits in the superdiagonal part ofA. IfUPLO = 'L': factor L sits in the subdiagonal part ofA.
On exit, if INFO = 0, you get the Hermitian inverse of the original matrix, slay:
- If
UPLO = 'U': the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; - If
UPLO = 'L': the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). π«ΆEβEisCOMPLEX*16 array, dimension (N)π¦
On entry, it holds 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)not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)not referenced.
NOTE: For a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in both theUPLO = 'U'orUPLO = 'L'cases.
IPIVβIPIVisINTEGER array, dimension (N). All the deets on the interchanges and the block structure of D, exactly as determined byZHETRF_RKorZHETRF_BK. πWORKβWORKisCOMPLEX*16 array, dimension (N+NB+1)*(NB+3). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. β¨LWORKβLWORKisINTEGER. The length ofWORK.LWORK >= (N+NB+1)*(NB+3). π
If LDWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the optimal size of the WORK array (yes bestie, the original really does say "the optimal size of the optimal size" twice, and honestly? iconic redundancy, we stan a queen who repeats herself π
), returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOβINFOisINTEGER= 0: successful exit πΈ< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors: π
November 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
π subroutine zhetri_3x π
subroutine zhetri_3x (character UPLO, integer N, complex*16, dimension( lda,
* ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( *
) IPIV, complex*16, dimension( n+nb+1, * ) WORK, integer NB, integer
INFO)
ZHETRI_3X β¨
Purpose π
ZHETRI_3X computes the inverse of a complex Hermitian indefinite matrix A using the factorization computed by ZHETRF_RK or ZHETRF_BK:
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 blocked version of the algorithm, calling Level 3 BLAS. No cap, she's out here doing the most. π
Parameters π¦
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0. βAβAisCOMPLEX*16 array, dimension (LDA,N)
On entry, diagonal of the block diagonal matrix D and factors U or L as computed by ZHETRF_RK and ZHETRF_BK:
- 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 should be provided on entry in arrayE), and - If
UPLO = 'U': factor U in the superdiagonal part ofA. IfUPLO = 'L': factor L in the subdiagonal part ofA.
On exit, if INFO = 0, the Hermitian inverse of the original matrix. If UPLO = 'U': the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L': the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). π«ΆEβEisCOMPLEX*16 array, dimension (N)
On entry, 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)not referenced; - If
UPLO = 'L':E(i) = D(i+1,i), i=1:N-1,E(N)not referenced.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
IPIVβIPIVisINTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined byZHETRF_RKorZHETRF_BK. πWORKβWORKisCOMPLEX*16 array, dimension (N+NB+1,NB+3). β¨NBβNBisINTEGER. Block size. π§±INFOβINFOisINTEGER= 0: successful exit πΈ< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors: π
June 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
π subroutine zhetri_rook π
subroutine zhetri_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16,
dimension( * ) WORK, integer INFO)
ZHETRI_ROOK computes the inverse of HE matrix using the factorization obtained with the bounded Bunch-Kaufman ('rook') diagonal pivoting method. π° (rook as in the chess piece, not the bird, bestie β although honestly both are valid energy)
Purpose π
ZHETRI_ROOK computes the inverse of a complex Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF_ROOK.
Parameters π¦
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0. βAβAisCOMPLEX*16 array, dimension (LDA,N)
On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by ZHETRF_ROOK.
On exit, if INFO = 0, the (Hermitian) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced. π
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). π«ΆIPIVβIPIVisINTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined byZHETRF_ROOK. πWORKβWORKisCOMPLEX*16 array, dimension (N). β¨INFOβINFOisINTEGER= 0: successful exit πΈ< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors: π
November 2013, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
School of Mathematics,
University of Manchester
π subroutine zhetrs π
subroutine zhetrs (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZHETRS
Purpose π
ZHETRS solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF. Solving systems? She does that. Periodt. π
Parameters π¦
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0. βNRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. πAβAβAis aCOMPLEX*16array, dimension(LDA,N). It's holding the block diagonal matrixDplus all the multipliers that got you the factorUorL, exactly the wayZHETRFcomputed them. πLDAβLDAisINTEGER. It's the leading dimension of the arrayA, and the rule isLDA >= max(1,N). bestie pls respect the leading dimension, she is not decorative. πIPIVβIPIVisINTEGERarray, dimension(N). It's got the details of the interchanges and the block structure ofD, as determined byZHETRF. πBβBisCOMPLEX*16array, dimension(LDB,NRHS). On entry it's the right hand side matrixB. On exit? It's the solution matrixX. the way it just becomes the answer, main character energy fr. β¨LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πINFOβINFOisINTEGER.= 0: successful exit, we ate, no notes. π< 0: ifINFO = -i, thei-th argument had an illegal value. something you passed in was simply not it. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine zhetrs2
subroutine zhetrs2 (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 INFO)
ZHETRS2
Purpose:
ZHETRS2 solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF and converted by ZSYCONV. it's giving "we already did the hard part, now we just solve." π
Parameters
UPLOβUPLOisCHARACTER*1. It says whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0. π¦NRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. πΈAβAisCOMPLEX*16array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZHETRF. β¨LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). πIPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF. πBβBisCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. π₯LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πWORKβWORKisCOMPLEX*16array, dimension(N). π§INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zhetrs_3
subroutine zhetrs_3 (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E,
integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer
LDB, integer INFO)
ZHETRS_3
Purpose:
ZHETRS_3 solves a system of linear equations A * X = B with a complex Hermitian matrix A using the factorization computed by ZHETRF_RK or ZHETRF_BK:
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 algorithm is using Level 3 BLAS. the way it's out here doing Level 3 BLAS like it's nothing β iconic. π₯
Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix:= 'U': Upper triangular, form isA = P*U*D*(U**H)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**H)*(P**T).
NβNisINTEGER. The order of the matrixA.N >= 0. π¦NRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. πΈAβAisCOMPLEX*16array, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byZHETRF_RKandZHETRF_BK:- ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- ONLY diagonal elements of the Hermitian block diagonal matrix
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). πEβEisCOMPLEX*16array, dimension(N). On entry, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where
If UPLO = 'U': E(i) = D(i-1,i),i=2:N, E(1) not referenced;
If UPLO = 'L': E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases. so don't come forE(k), she's simply not in the conversation for that block. π
IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF_RKorZHETRF_BK. πBβBisCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. β¨LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πINFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
- June 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
π«Ά subroutine zhetrs_aa
subroutine zhetrs_aa (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)
ZHETRS_AA
Purpose:
ZHETRS_AA solves a system of linear equations A*X = B with a complex hermitian matrix A using the factorization A = U**H*T*U or A = L*T*L**H computed by ZHETRF_AA. it really said "A double-A, no cap." π
Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U**H*T*U;= 'L': Lower triangular, form isA = L*T*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0. π¦NRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. πΈAβAisCOMPLEX*16array, dimension(LDA,N). Details of factors computed byZHETRF_AA. β¨LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). πIPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges as computed byZHETRF_AA. πBβBisCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. π₯LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πWORKβWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). π§LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= max(1,3*N-2). ngl if you undersize this one she will simply not participate. πINFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zhetrs_rook
subroutine zhetrs_rook (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZHETRS_ROOK computes the solution to a system of linear equations A * X = B for HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges). rook said two interchanges MAX and honestly, respect. βοΈ
Purpose:
ZHETRS_ROOK solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by ZHETRF_ROOK.
Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0. π¦NRHSβNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. πΈAβAisCOMPLEX*16array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZHETRF_ROOK. β¨LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). πIPIVβ it's anINTEGERarray, dimension(N). It's holding all the deets on the interchanges and the block structure ofD, exactly asZHETRF_ROOKdecided. πBβCOMPLEX*16array, dimension(LDB,NRHS). On entry, it's the right hand side matrixB. On exit? Bestie, it becomes the solution matrixX. β¨LDBβINTEGER. The leading dimension of arrayB.LDB >= max(1,N). No cap.INFOβINTEGER.= 0: successful exit, we love to see it.< 0: ifINFO = -i, then the i-th argument had an illegal value, so something was giving messy. π«
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
- November 2013, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
β¨ subroutine zla_heamv (integer UPLO, integer N, double precision ALPHA, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) X, integer INCX, double precision BETA, double precision, dimension( * ) Y, integer INCY) β¨
ZLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bounds.
Purpose:
ZLA_SYAMV performs the matrix-vector operation
y := alpha*abs(A)*abs(x) + beta*abs(y),
where alpha and beta are scalars, x and y are vectors and A is an n by n symmetric matrix.
This function is primarily used in calculating error bounds. To protect against underflow during evaluation, components in the resulting vector are perturbed away from zero by (N+1) times the underflow threshold. To prevent unnecessarily large errors for block-structure embedded in general matrices, 'symbolically' zero components are not perturbed. A zero entry is considered 'symbolic' if all multiplications involved in computing that entry have at least one zero multiplicand.
Parameters
UPLOβINTEGER. On entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced as follows:UPLO = BLAS_UPPERβ Only the upper triangular part ofAis to be referenced.UPLO = BLAS_LOWERβ Only the lower triangular part ofAis to be referenced.
Unchanged on exit. π
NβINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβDOUBLE PRECISION. On entry,ALPHAspecifies the scalar alpha. Unchanged on exit.AβCOMPLEX*16array, dimension( LDA, n ). Before entry, the leading m by n part of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDAβINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.XβCOMPLEX*16array, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the vector x. Unchanged on exit.INCXβINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβDOUBLE PRECISION. On entry,BETAspecifies the scalar beta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YβDOUBLE PRECISIONarray, dimension( 1 + ( n - 1 )*abs( INCY ) ). Before entry withBETAnon-zero, the incremented arrayYmust contain the vector y. On exit,Yis overwritten by the updated vector y.INCYβINTEGER. On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit. π¦
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
Level 2 Blas routine.
- Written on 22-October-1986.
- Jack Dongarra, Argonne National Lab.
- Jeremy Du Croz, Nag Central Office.
- Sven Hammarling, Nag Central Office.
- Richard Hanson, Sandia National Labs.
- Modified for the absolute-value product, April 2006
- Jason Riedy, UC Berkeley
β¨ double precision function zla_hercond_c (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, double precision, dimension ( * ) C, logical CAPPLY, integer INFO, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK) β¨
ZLA_HERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for Hermitian indefinite matrices.
Purpose:
ZLA_HERCOND_C computes the infinity norm condition number of op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector.
Parameters
UPLOβCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβINTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0.AβCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrix ALDAβINTEGER. The leading dimension of the array A.LDA >= max(1,N).AFβCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by ZHETRF.LDAFβINTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure of D as determined by CHETRF.CβDOUBLE PRECISIONarray, dimension(N). The vector C in the formula op(A) * inv(diag(C)).CAPPLYβLOGICAL. If.TRUE.then access the vector C in the formula above.INFOβINTEGER= 0: Successful exit.i > 0: The ith argument is invalid.
WORKβCOMPLEX*16array, dimension(2*N). Workspace.RWORKβDOUBLE PRECISIONarray, dimension(N). Workspace. πΈ
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ double precision function zla_hercond_x (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( * ) X, integer INFO, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK) β¨
ZLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices.
Purpose:
ZLA_HERCOND_X computes the infinity norm condition number of op(A) * diag(X) where X is a COMPLEX*16 vector.
Parameters
UPLOβCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβINTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0.AβCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrix A.LDAβINTEGER. The leading dimension of the array A.LDA >= max(1,N).AFβCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by ZHETRF.LDAFβINTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure of D as determined by CHETRF.XβCOMPLEX*16array, dimension(N). The vector X in the formula op(A) * diag(X).INFOβINTEGER= 0: Successful exit.i > 0: The ith argument is invalid.
WORKβCOMPLEX*16array, dimension(2*N). Workspace.RWORKβDOUBLE PRECISIONarray, dimension(N). Workspace. π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π
subroutine zla_herfsx_extended π
subroutine zla_herfsx_extended (integer PREC_TYPE, character UPLO, integer
N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA,
complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
) IPIV, logical COLEQU, double precision, dimension( * ) C, complex*16,
dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldy, * ) Y,
integer LDY, double precision, dimension( * ) BERR_OUT, integer N_NORMS,
double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double precision,
dimension( nrhs, * ) ERR_BNDS_COMP, complex*16, dimension( * ) RES,
double precision, dimension( * ) AYB, complex*16, dimension( * ) DY,
complex*16, dimension( * ) Y_TAIL, double precision RCOND, integer
ITHRESH, double precision RTHRESH, double precision DZ_UB, logical
IGNORE_CWISE, integer INFO)
ZLA_HERFSX_EXTENDED improves the computed solution to a system of linear equations for Hermitian indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.
β¨ Purpose β¨
So basically, ZLA_HERFSX_EXTENDED glow-ups your computed solution to a system of linear equations by doing that extra-precise iterative refinement thing, and it hands you error bounds + backward error estimates for the solution. π
This subroutine is called by ZHERFSX to perform iterative refinement.
On top of the normwise error bound, the code also gives you the maximum componentwise error bound <em>if possible</em> β peek at the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on those error bounds. π«Ά And heads up: this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP. That's it. That's the job. π
π Parameters π
PREC_TYPEβINTEGER. Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTER, andP:= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
UPLOβCHARACTER*1. Which triangle we're vibing with:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSβINTEGER. The number of right-hand-sides, i.e., the number of columns of the matrixB.AβCOMPLEX*16array, dimension(LDA,N). On entry, theN-by-NmatrixA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZHETRF.LDAFβINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF.COLEQUβLOGICAL. If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly β so don't skip it, bestie.CβDOUBLE PRECISIONarray, dimension(N). The column scale factors forA. IfCOLEQU = .FALSE.,Cis not accessed. IfCis input, each element ofCshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. π
β οΈ That last bit is a real caveat, not a vibe β if your scaling isn't by powers of the radix, your error estimates can go sideways and stop being trustworthy.
BβCOMPLEX*16array, dimension(LDB,NRHS). The right-hand-side matrixB.LDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).YβCOMPLEX*16array, dimension(LDY,NRHS). On entry, the solution matrixX, as computed byZHETRS. On exit, the improved solution matrixY. β¨LDYβINTEGER. The leading dimension of the arrayY.LDY >= max(1,N).BERR_OUTβDOUBLE PRECISIONarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom the formula
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by ZLA_LIN_BERR.
N_NORMSβINTEGER. Determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP).- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
- If
ERR_BNDS_NORMβDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1β 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β 'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3β Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
ERR_BNDS_COMPβDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1β 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β 'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3β Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.
RESβCOMPLEX*16array, dimension(N). Workspace to hold the intermediate residual.AYBβDOUBLE PRECISIONarray, dimension(N). Workspace.DYβCOMPLEX*16array, dimension(N). Workspace to hold the intermediate solution.Y_TAILβCOMPLEX*16array, dimension(N). Workspace to hold the trailing bits of the intermediate solution. π¦ (yes, the <em>trailing bits</em> β that's the extra-precise secret sauce)RCOND
RCOND</p> π
RCOND is DOUBLE PRECISION.
Reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if equilibration happened). And bestie, listen: if this is less than the machine precision β and especially if it's straight up zero β then the matrix is singular to working precision. No cap. One tiny caveat tho: the error can still be small even when this number is teeny tiny and the matrix looks ill-conditioned. So don't panic-read it, okay? π
ITHRESH β¨
ITHRESH is INTEGER.
The max number of residual computations allowed for refinement. Default is 10. For 'aggressive' you set it to 100 to permit convergence using approximate factorizations or factorizations that aren't LU. Heads up tho: if the factorization uses a technique other than Gaussian elimination, the guarantees in ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. π
RTHRESH πΈ
RTHRESH is DOUBLE PRECISION.
This one decides when to stop refinement if the error estimate stops decreasing. Refinement stops when the next solution no longer satisfies
norm(dx_{i+1}) < RTHRESH * norm(dx_i)
where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. Default value is 0.5. For 'aggressive' set it to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. π
DZ_UB π¦
DZ_UB is DOUBLE PRECISION.
Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, and we define "stable" as the relative change in each component being less than DZ_UB. Default value is 0.25, which requires the first bit to be stable. See LAWN 165 for more details. π
IGNORE_CWISE π
IGNORE_CWISE is LOGICAL.
If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
INFO π
INFO is INTEGER.
= 0: Successful exit. slay β¨< 0: ifINFO = -i, theith argument toZLA_HERFSX_EXTENDEDhad an illegal value.
Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
double precision function zla_herpvgrw π
double precision function zla_herpvgrw (character*1 UPLO, integer N, integer
INFO, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( * ) WORK)
ZLA_HERPVGRW
Purpose β
ZLA_HERPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). The 'max absolute element' norm is used. If this comes out much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. And that means the solution X, the estimated condition numbers, and the error bounds could all be unreliable. π So yeah β vibe check your pivot growth, fr fr.
Parameters π
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.INFOβINFOisINTEGER. The value ofINFOreturned fromZHETRF, .i.e., the pivot in columnINFOis exactly0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, theN-by-NmatrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFisCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZHETRF.LDAFβLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHETRF.WORKβWORKisDOUBLE PRECISIONarray, dimension(2*N).
Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zlahef π₯
subroutine zlahef (character UPLO, integer N, integer NB, integer KB,
complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex*16, dimension( ldw, * ) W, integer LDW, integer INFO)
ZLAHEF computes a partial factorization of a complex Hermitian indefinite matrix using the Bunch-Kaufman diagonal pivoting method (blocked algorithm, calling Level 3 BLAS). iconic behavior tbh π
Purpose β
ZLAHEF computes a partial factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method. The partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L'
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. The actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB. Note that U**H denotes the conjugate transpose of U. π
ZLAHEF is an auxiliary routine called by ZHETRF. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA.N >= 0.NBβNBisINTEGER. The maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks.KBβKBisINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA. IfUPLO = 'U', the leadingn-by-nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingn-by-nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit,Acontains details of the partial factorization.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD.- If
UPLO = 'U':- Only the last
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- Only the last
- If
UPLO = 'L':- Only the first
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- Only the first
- If
WβWisCOMPLEX*16array, dimension(LDW,NB).LDWβLDWisINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFOβINFOisINTEGER= 0: successful exit> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular. singular bestie, it's giving β¨nothingβ¨ π
Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors π
December 2016, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
subroutine zlahef_aa π
subroutine zlahef_aa (character UPLO, integer J1, integer M, integer NB,
complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex*16, dimension( ldh, * ) H, integer LDH, complex*16,
dimension( * ) WORK)
ZLAHEF_AA
Purpose β
DLAHEF_AA factorizes a panel of a complex hermitian matrix A using the Aasen's algorithm. The panel consists of a set of NB rows of A when UPLO is U, or a set of NB columns when UPLO is L. πΈ
In order to factorize the panel, the Aasen's algorithm requires the last row, or column, of the previous panel. The first row, or column, of A is set to be the first row, or column, of an identity matrix, which is used to factorize the first panel. π¦
The resulting J-th row of U, or J-th column of L, is stored in the (J-1)-th row, or column, of A (without the unit diagonals), while the diagonal and subdiagonal of A are overwritten by those of T. so much going on and we're obsessed β¨
Parameters π
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
J1βJ1isINTEGER. The location of the first row, or column, of the panel within the submatrix ofA, passed to this routine, e.g., when called byZHETRF_AA, for the first panel,J1is1, while for the remaining panels,J1is2.MβMisINTEGER. The dimension of the submatrix.M >= 0.NBβNBisINTEGER. The dimension of the panel to be factored.AβAisCOMPLEX*16array, dimension(LDA,M)for the first panel, while dimension(LDA,M+1)for the remaining panels.
And for A, the tea keeps going: on entry, A holds the last row (or column) of the previous panel, plus the trailing submatrix of A that still needs factorizing β except for that very first panel, where literally only the panel gets passed in.
On exit, the leading panel is factorized. slay. π
LDAβINTEGER. The leading dimension of the arrayA. Gotta respect the rules:LDA >= max(1,N). πIPIVβINTEGERarray, dimension(N). This one's the receipt for all the row-and-column interchanges, fr: row and columnkwere swapped with row and columnIPIV(k).HβCOMPLEX*16workspace, dimension(LDH,NB). Just a lil scratch pad πLDHβINTEGER. The leading dimension of that workspaceH.LDH >= max(1,M).WORKβCOMPLEX*16workspace, dimension(M). More scratch space, bestie β¨
Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zlahef_rk
subroutine zlahef_rk (character UPLO, integer N, integer NB, integer KB,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( *
) E, integer, dimension( * ) IPIV, complex*16, dimension( ldw, * ) W,
integer LDW, integer INFO)
ZLAHEF_RK computes a partial factorization of a complex Hermitian indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method. no cap, that's the whole gig π«Ά
Purpose π
ZLAHEF_RK computes a partial factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method. The partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L',
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. The actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB.
ZLAHEF_RK is an auxiliary routine called by ZHETRF_RK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters π
UPLOβCHARACTER*1. Says which half of the Hermitian matrixAwe actually stored, bestie:= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. The order of the matrixA.N >= 0.NBβINTEGER. The maximum number of columns of the matrixAthat should be factored.NBshould be at least 2 to allow for 2-by-2 pivot blocks. (two or it's not giving pivot block energy π )KBβINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB. the truth-teller of the group β¨AβCOMPLEX*16array, dimension(LDA,N). On entry, the Hermitian matrixA.- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
On exit, contains:
- a) ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβCOMPLEX*16array, dimension(N). On exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrixDwith 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.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. zeroed out, periodt.
IPIVβINTEGERarray, dimension(N).IPIVdescribes the permutation matrixPin the factorization of matrixAas follows. The absolute value ofIPIV(k)represents the index of row and column that were interchanged with thek-th row and column. The value ofUPLOdescribes the order in which the interchanges were applied. Also, the sign ofIPIVrepresents the block structure of the Hermitian block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. buckle up, this part is long but iconic π
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the submatrixA(1:N,N-KB+1:N); - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,N-KB+1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,N-KB+1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b) is always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. always. π―
If UPLO = 'L', ( in factorization order, k increases from 1 to N ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the submatrixA(1:N,1:KB). - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b) is always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
WβCOMPLEX*16array, dimension(LDW,NB). more scratch space, we love to see it πΈLDWβINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFOβINTEGER. the vibe report π’= 0: successful exit π< 0: IfINFO = -k, thek-th argument had an illegal value. not it.> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
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. π do NOT go solving systems with this one, bestie, I'm so serious.
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
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
π¦ subroutine zlahef_rook
subroutine zlahef_rook (character UPLO, integer N, integer NB, integer KB,
complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex*16, dimension( ldw, * ) W, integer LDW, integer INFO)
Purpose β¨
ZLAHEF_ROOK computes a partial factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. The partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L'
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. The actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB. Note that U**H denotes the conjugate transpose of U.
ZLAHEF_ROOK is an auxiliary routine called by ZHETRF_ROOK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
π Parameters π
okay bestie, here's the full rundown of every argument this routine takes. no skips, no cap. β¨
UPLOβCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. The order of the matrixA.N >= 0.NBβINTEGER. The maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks.KBβINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AβCOMPLEX*16 array, dimension (LDA,N).- On entry, the Hermitian matrix
A. IfUPLO = 'U', the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. - On exit,
Acontains details of the partial factorization.
- On entry, the Hermitian matrix
LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβINTEGER array, dimension (N). Details of the interchanges and the block structure ofD.- If
UPLO = 'U':- Only the last
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were interchanged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- Only the last
- If
UPLO = 'L':- Only the first
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were interchanged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- Only the first
- If
WβCOMPLEX*16 array, dimension (LDW,NB).LDWβINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFOβINTEGER.= 0: successful exit> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά Contributors: π«Ά
- November 2013, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
π€ Author π€
Generated automatically by Doxygen for LAPACK from the source code.
That's the whole vibe, bestie. This page is serving LAPACK Version 3.11.0, dated Sun Nov 27 2022, and it's the manual page for complex16HEcomputational(3). Slay responsibly. π
β¨
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms