complexSYcomputational(3)
π¦ complexSYcomputational(3) π¦
okay so this is the manual page for complexSYcomputational β it's giving complex computational energy for SY matrices, and we're about to go through every single function like it's a group chat, no cap. π
β¨ NAME β¨
complexSYcomputational β complex
πΈ SYNOPSIS πΈ
π Functions π
subroutine chesv_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, WORK, LWORK, INFO)CHESV_AA_2STAGEcomputes the solution to system of linear equationsA * X = Bfor HE matrices.subroutine chetrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)the description is literallyCHETRF_AA_2STAGEπsubroutine chetrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)the description is literallyCHETRS_AA_2STAGEπsubroutine cla_syamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)CLA_SYAMVcomputes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds.real function cla_syrcond_c (UPLO, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)CLA_SYRCOND_Ccomputes the infinity norm condition number ofop(A)*inv(diag(c))for symmetric indefinite matrices.real function cla_syrcond_x (UPLO, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)CLA_SYRCOND_Xcomputes the infinity norm condition number ofop(A)*diag(x)for symmetric indefinite matrices.subroutine cla_syrfsx_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)CLA_SYRFSX_EXTENDEDimproves the computed solution to a system of linear equations for symmetric indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.real function cla_syrpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)CLA_SYRPVGRWcomputes the reciprocal pivot growth factornorm(A)/norm(U)for a symmetric indefinite matrix.subroutine clahef_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)the description is literallyCLAHEF_AAπsubroutine clasyf (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)CLASYFcomputes a partial factorization of a complex symmetric matrix using the Bunch-Kaufman diagonal pivoting method.subroutine clasyf_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)the description is literallyCLASYF_AAπsubroutine clasyf_rk (UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, INFO)CLASYF_RKcomputes a partial factorization of a complex symmetric indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method.subroutine clasyf_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)CLASYF_ROOKcomputes a partial factorization of a complex symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.subroutine csycon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)the description is literallyCSYCONπsubroutine csycon_3 (UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, INFO)the description is literallyCSYCON_3πsubroutine csycon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)the description is literallyCSYCON_ROOKπsubroutine csyconv (UPLO, WAY, N, A, LDA, IPIV, E, INFO)the description is literallyCSYCONVπsubroutine csyconvf (UPLO, WAY, N, A, LDA, E, IPIV, INFO)the description is literallyCSYCONVFπsubroutine csyconvf_rook (UPLO, WAY, N, A, LDA, E, IPIV, INFO)the description is literallyCSYCONVF_ROOKπsubroutine csyequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)the description is literallyCSYEQUBπsubroutine csyrfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)the description is literallyCSYRFSπsubroutine csyrfsx (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)the description is literallyCSYRFSXπsubroutine csysv_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, WORK, LWORK, INFO)CSYSV_AA_2STAGEcomputes the solution to system of linear equationsA * X = Bfor SY matrices.subroutine csytf2 (UPLO, N, A, LDA, IPIV, INFO)CSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine csytf2_rk (UPLO, N, A, LDA, E, IPIV, INFO)CSYTF2_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).subroutine csytf2_rook (UPLO, N, A, LDA, IPIV, INFO)CSYTF2_ROOKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine csytrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)the description is literallyCSYTRFπsubroutine csytrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)the description is literallyCSYTRF_AAπsubroutine csytrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)the description is literallyCSYTRF_AA_2STAGEπsubroutine csytrf_rk (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)CSYTRF_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).subroutine csytrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)the description is literallyCSYTRF_ROOKπsubroutine csytri (UPLO, N, A, LDA, IPIV, WORK, INFO)the description is literallyCSYTRIπsubroutine csytri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)the description is literallyCSYTRI2πsubroutine csytri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)the description is literallyCSYTRI2Xπsubroutine csytri_3 (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)the description is literallyCSYTRI_3πsubroutine csytri_3x (UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO)the description is literallyCSYTRI_3Xπsubroutine csytri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)the description is literallyCSYTRI_ROOKπsubroutine csytrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)the description is literallyCSYTRSπsubroutine csytrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)the description is literallyCSYTRS2πsubroutine csytrs_3 (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)the description is literallyCSYTRS_3πsubroutine csytrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)the description is literallyCSYTRS_AAπsubroutine csytrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)the description is literallyCSYTRS_AA_2STAGEπsubroutine csytrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)the description is literallyCSYTRS_ROOKπsubroutine ctgsyl (TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC, D, LDD, E, LDE, F, LDF, SCALE, DIF, WORK, LWORK, IWORK, INFO)the description is literallyCTGSYLπsubroutine ctrsyl (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, INFO)the description is literallyCTRSYLπsubroutine ctrsyl3 (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, SWORK, LDSWORK, INFO)the description is literallyCTRSYL3π
π¦ Detailed Description π¦
This is the group of complex computational functions for SY matrices. like, the whole squad is here, bestie. π
π Function Documentation π
πΈ subroutine chesv_aa_2stage πΈ
subroutine chesv_aa_2stage (character UPLO, integer N, integer NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * ) WORK, integer LWORK, integer INFO)
CHESV_AA_2STAGE computes the solution to system of linear equations A * X = B for HE matrices
π Purpose π
okay so CHESV_AA_2STAGE computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
Aasen's 2-stage algorithm is used to factor A as
A = U**H * T * U, if UPLO = 'U', or
A = L * T * L**H, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is Hermitian and band. The matrix T is then LU-factored with partial pivoting. The factored form of A is then used to solve the system of equations A * X = B.
This is the blocked version of the algorithm, calling Level 3 BLAS.
π Parameters π
UPLOUPLOisCHARACTER*1='U': Upper triangle of A is stored; ='L': Lower triangle of A is stored.NNisINTEGERThe order of the matrix A.N >= 0.NRHSNRHSisINTEGERThe number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.AAisCOMPLEXarray, dimension(LDA,N)On entry, the hermitian matrix A. IfUPLO = '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, L is stored below (or above) the subdiaonal blocks, when UPLO is 'L' (or 'U').
LDALDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).TBTBisCOMPLEXarray, dimension(LTB)On exit, details of the LU factorization of the band matrix.LTBLTBisINTEGERThe size of the array TB.LTB >= 4*N, internally used to select NB such thatLTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA.
IPIVIPIVisINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and columnIPIV(k).IPIV2IPIV2isINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and column k of T were interchanged with the row and columnIPIV(k).BBisCOMPLEXarray, dimension(LDB,NRHS)On entry, the right hand side matrix B. On exit, the solution matrix X.LDBLDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKWORKisCOMPLEXworkspace of sizeLWORKLWORKLWORKisINTEGERThe size of WORK.LWORK >= N, internally used to select NB such thatLWORK >= N*NB.
If LWORK = -1? okay bestie, thatβs the secret workspace-query handshake: 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 giving βIβm just measuring, not solvingβ energy. π
β¨
INFO
INFO is INTEGER
= 0: successful exit. Slay.< 0: ifINFO = -i, the i-th argument had an illegal value. Not iconic.> 0: ifINFO = i, band LU factorization failed on i-th column. Big yikes.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π CHETRF_AA_2STAGE π
subroutine chetrf_aa_2stage (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( * ) TB, integer LTB,
integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, complex,
dimension( * ) WORK, integer LWORK, integer INFO)
CHETRF_AA_2STAGE
Purpose:
CHETRF_AA_2STAGE computes the factorization of a real hermitian matrix A using the Aasen's algorithm. The form of the factorization is
A = U**T*T*U or A = L*T*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a hermitian band matrix with the bandwidth of NB (NB is internally selected and stored in TB( 1 ), and T is LU factorized with partial pivoting).
This is the blocked version of the algorithm, calling Level 3 BLAS. Itβs the main character of factorizations, fr fr. π
Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, 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,Lis stored below (or above) the subdiaonal blocks, whenUPLOis'L'(or'U'). (Yes, the original says βsubdiaonalβ β weβre not fixing it, weβre respecting the lore. π)LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBβTBisCOMPLEXarray, dimension(LTB). On exit, details of the LU factorization of the band matrix.LTBβLTBisINTEGER. The size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch thatLTB >= (3*NB+1)*N. IfLTB = -1, then a workspace query is assumed; the routine only calculates the optimal size ofLTB, returns this value as the first entry ofTB, and no error message related toLTBis issued byXERBLA.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).IPIV2βIPIV2isINTEGERarray, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofTwere interchanged with the row and columnIPIV(k). (Yes, it saysIPIV(k)here, notIPIV2(k)β we keep it exactly as the original, no editing. π«Ά)WORKβWORKisCOMPLEXworkspace of sizeLWORK.LWORKβLWORKisINTEGER. The size ofWORK.LWORK >= N, internally used to selectNBsuch thatLWORK >= N*NB. IfLWORK = -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.INFOβINFOisINTEGER= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, band LU factorization failed on i-th column.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ CHETRS_AA_2STAGE πΈ
subroutine chetrs_aa_2stage (character UPLO, integer N, integer NRHS,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CHETRS_AA_2STAGE
Purpose:
CHETRS_AA_2STAGE solves a system of linear equations A*X = B with a real hermitian matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by CHETRF_AA_2STAGE. π§
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**T*T*U;= 'L': Lower triangular, form isA = L*T*L**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βAisCOMPLEXarray, dimension(LDA,N). Details of factors computed byCHETRF_AA_2STAGE.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBβTBisCOMPLEXarray, dimension(LTB). Details of factors computed byCHETRF_AA_2STAGE.LTBβLTBisINTEGER. The size of the arrayTB.LTB >= 4*N.IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges as computed byCHETRF_AA_2STAGE.IPIV2βIPIV2isINTEGERarray, dimension(N). Details of the interchanges as computed byCHETRF_AA_2STAGE.BβBisCOMPLEXarray, 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, the i-th argument had an illegal value.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ CLA_SYAMV β computes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds. π¦
subroutine cla_syamv (integer UPLO, integer N, real ALPHA, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) X, integer
INCX, real BETA, real, dimension( * ) Y, integer INCY)
CLA_SYAMV computes a matrix-vector product using a symmetric indefinite
matrix to calculate error bounds.
Purpose:
CLA_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βUPLOisINTEGER. 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βNisINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβALPHAisREAL. On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.AβAisCOMPLEXarray, dimension( LDA, n ). Before entry, the leading m by n part of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDAβLDAisINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.XβXisCOMPLEXarray, dimension( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the vectorx. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβBETAisREAL. On entry,BETAspecifies the scalarbeta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YβYisREALarray, dimension( 1 + ( n - 1 )*abs( INCY ) ). Before entry withBETAnon-zero, the incremented arrayYmust contain the vectory. On exit,Yis overwritten by the updated vectory.INCYβINCYisINTEGER. 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
cla_syrcond_c π
real function cla_syrcond_c (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( ldaf, * ) AF, integer LDAF,
integer, dimension( * ) IPIV, real, dimension( * ) C, logical CAPPLY,
integer INFO, complex, dimension( * ) WORK, real, dimension( * ) RWORK)
CLA_SYRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for symmetric indefinite matrices. bestie it's literally just vibing with the condition number, no drama π
β¨ Purpose β¨
CLA_SYRCOND_C computes the infinity norm condition number of op(A) * inv(diag(C)) where C is a REAL vector. that's the whole assignment, periodt π
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the N-by-N matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFisCOMPLEXarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.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 byCSYTRF.CβCisREALarray, dimension(N). The vectorCin the formulaop(A) * inv(diag(C)).CAPPLYβCAPPLYisLOGICAL. If.TRUE.then access the vectorCin the formula above.INFOβINFOisINTEGER= 0: Successful exit.i > 0: The ith argument is invalid.
WORKβWORKisCOMPLEXarray, dimension(2*N). Workspace.RWORKβRWORKisREALarray, dimension(N). Workspace.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
cla_syrcond_x π¦
real function cla_syrcond_x (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( ldaf, * ) AF, integer LDAF,
integer, dimension( * ) IPIV, complex, dimension( * ) X, integer INFO,
complex, dimension( * ) WORK, real, dimension( * ) RWORK)
CLA_SYRCOND_X computes the infinity norm condition number of op(A)*diag(x) for symmetric indefinite matrices. same energy as cla_syrcond_c but the diag friend is a whole COMPLEX vector this time, iconic β¨
β¨ Purpose β¨
CLA_SYRCOND_X computes the infinity norm condition number of op(A) * diag(X) where X is a COMPLEX vector. no notes, that's the tea π
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the N-by-N matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFisCOMPLEXarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.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 byCSYTRF.XβXisCOMPLEXarray, dimension(N). The vectorXin the formulaop(A) * diag(X).INFOβINFOisINTEGER= 0: Successful exit.i > 0: The ith argument is invalid.
WORKβWORKisCOMPLEXarray, dimension(2*N). Workspace.RWORKβRWORKisREALarray, dimension(N). Workspace.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
cla_syrfsx_extended π
subroutine cla_syrfsx_extended (integer PREC_TYPE, character UPLO, integer
N, integer NRHS, complex, dimension( lda, * ) A, integer LDA, complex,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
logical COLEQU, real, dimension( * ) C, complex, dimension( ldb, * ) B,
integer LDB, complex, dimension( ldy, * ) Y, integer LDY, real,
dimension( * ) BERR_OUT, integer N_NORMS, real, dimension( nrhs, * )
ERR_BNDS_NORM, real, dimension( nrhs, * ) ERR_BNDS_COMP, complex,
dimension( * ) RES, real, dimension( * ) AYB, complex, dimension( * )
DY, complex, dimension( * ) Y_TAIL, real RCOND, integer ITHRESH, real
RTHRESH, real DZ_UB, logical IGNORE_CWISE, integer INFO)
CLA_SYRFSX_EXTENDED improves the computed solution to a system of linear equations for symmetric indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. it's giving β¨main character energyβ¨ β this one does the extra work so your answer is actually trustworthy π«Ά
β¨ Purpose β¨
CLA_SYRCOND_C... okay no wait, it's CLA_SYRFSX_EXTENDED that improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by CSYRFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP.
πΈ Parameters πΈ
PREC_TYPEβPREC_TYPEisINTEGER. Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTERandP= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSβNRHSisINTEGER. The number of right-hand-sides, i.e., the number of columns of the matrixB.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the N-by-N matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFisCOMPLEXarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.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 byCSYTRF.COLEQUβCOLEQUisLOGICAL. If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly.CβCisREALarray, 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.
okay bestie listen β that radix-powers thing is not a suggestion, it's a whole thing. if you scale by anything else you might get error estimates that are straight up lying to you π
BβBisCOMPLEXarray, dimension(LDB,NRHS). The right-hand-side matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).YβYisCOMPLEXarray, dimension(LDY,NRHS). On entry, the solution matrixX, as computed byCSYTRS. On exit, the improved solution matrixY.LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,N).BERR_OUTβBERR_OUTisREALarray, 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 CLA_LIN_BERR.
N_NORMSβN_NORMSisINTEGER. Determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP). IfN_NORMS >= 1return normwise error bounds. IfN_NORMS >= 2return componentwise error bounds.ERR_BNDS_NORMβERR_BNDS_NORMisREALarray, 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. Periodt.err = 3β Reciprocal condition number: the estimated normwise reciprocal condition number. It gets compared against 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.
Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1. β¨
This subroutine is only responsible for setting the second field above. That's it, that's the whole job π
See Lapack Working Note 165 for further details and extra cautions.
ERR_BNDS_COMPβERR_BNDS_COMPisREALarray, 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.
Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1. π¦
This subroutine is only responsible for setting the second field above.
See Lapack Working Note 165 for further details and extra cautions.
RESβRESisCOMPLEXarray, dimension(N). Workspace to hold the intermediate residual. π«ΆAYBβAYBisREALarray, dimension(N). Workspace. That's all it does, it just holds space, we respect it.DYβDYisCOMPLEXarray, dimension(N). Workspace to hold the intermediate solution. πY_TAILβY_TAILisCOMPLEXarray, dimension(N). Workspace to hold the trailing bits of the intermediate solution. The little leftover crumbs bestie πRCONDβRCONDisREAL
Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after 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. π
ITHRESHβITHRESHisINTEGER
The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set to 100 to permit convergence using approximate factorizations or factorizations other than LU. 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βRTHRESHisREAL
Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop 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. The default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details.
DZ_UBβDZ_UBisREAL
Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details.
IGNORE_CWISEβIGNORE_CWISEisLOGICAL
If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
INFOβINFOisINTEGER
= 0: Successful exit.
< 0: if INFO = -i, the ith argument to CLA_SYRFSX_EXTENDED had an illegal
value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
real function cla_syrpvgrw
real function cla_syrpvgrw (character*1 UPLO, integer N, integer INFO,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, * )
) AF, integer LDAF, integer, dimension( * ) IPIV, real, dimension( * )
WORK)
Hold up β that's the signature, and the real one as printed is:
real function cla_syrpvgrw (character*1 UPLO, integer N, integer INFO,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, * )
AF, integer LDAF, integer, dimension( * ) IPIV, real, dimension( * ) WORK)
CLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix. π
Purpose
CLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). The 'max absolute element' norm is used. If this is much less than 1, the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, estimated condition numbers, and error bounds could be unreliable. π¬
Parameters
UPLOβUPLOisCHARACTER*1
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
NβNisINTEGER
The number of linear equations, i.e., the order of the matrix A. N >= 0.
INFOβINFOisINTEGER
The value of INFO returned from CSYTRF, .i.e., the pivot in column INFO is exactly 0.
AβAisCOMPLEXarray, dimension(LDA,N)
On entry, the N-by-N matrix A.
LDAβLDAisINTEGER
The leading dimension of the array A. LDA >= max(1,N).
AFβAFisCOMPLEXarray, dimension(LDAF,N)
The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by CSYTRF.
LDAFβLDAFisINTEGER
The leading dimension of the array AF. LDAF >= max(1,N).
IPIVβIPIVisINTEGERarray, dimension(N)
Details of the interchanges and the block structure of D as determined by CSYTRF.
WORKβWORKisREALarray, dimension(2*N)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clahef_aa
subroutine clahef_aa (character UPLO, integer J1, integer M, integer NB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldh, * ) H, integer LDH, complex, dimension( *
) WORK)
CLAHEF_AA β¨ (yes the whole subroutine is just its own name up there, iconic behaviour honestly)
Purpose
CLAHEF_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. π
Parameters
UPLOβUPLOisCHARACTER*1
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
J1βJ1isINTEGER
The location of the first row, or column, of the panel within the submatrix of A, passed to this routine, e.g., when called by CHETRF_AA, for the first panel, J1 is 1, while for the remaining panels, J1 is 2.
MβMisINTEGER
The dimension of the submatrix. M >= 0.
NBβNBisINTEGER
The dimension of the panel to be facotorized. (their spelling, not mine, and honestly? we stan a legend with a typo π)
AβAisCOMPLEXarray, dimension(LDA,M)for the first panel, while dimension(LDA,M+1)for the remaining panels.
On entry, A contains the last row, or column, of the previous panel, and the trailing submatrix of A to be factorized, except for the first panel, only the panel is passed.
On exit, the leading panel is factorized. πΈ
LDAβLDAβ INTEGER, bestie. It's the leading dimension of the arrayA. Rule of the land:LDA >= max(1,N). No exceptions, she's strict πIPIVβ INTEGER array, dimension(N). This is where the β¨dramaβ¨ of the interchanges lives β the deets on the row and column swaps. Basically: row and columnkgot swapped with row and columnIPIV(k). Tea spilled.Hβ COMPLEX workspace, dimension(LDH,NB). Just a lil scratch pad, she's doing her job π«ΆLDHβ INTEGER, the leading dimension of the workspaceH. And you guessed it:LDH >= max(1,M).WORKβ COMPLEX workspace, dimension(M). More scratch space, more vibes.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine clasyf π
subroutine clasyf (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldw, * ) W, integer LDW, integer INFO)
CLASYF computes a partial factorization of a complex symmetric matrix using the Bunch-Kaufman diagonal pivoting method. Okay so that's the whole assignment. Let's get into it π
β¨ Purpose β¨
CLASYF computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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**T denotes the transpose of U.
CLASYF is an auxiliary routine called by CSYTRF. 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. Tells us whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
Nβ INTEGER. The order of the matrixA.N >= 0.NBβ INTEGER. The max number of columns of the matrixAthat should be factored. And listen βNBshould be at least2to allow for 2-by-2 pivot blocks. Don't skimp on this one.KBβ INTEGER. The number of columns ofAthat were actually factored (the receipts, if you will).KBis eitherNB-1orNB, orNifN <= NB.Aβ COMPLEX array, dimension(LDA,N). On entry, the symmetric 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,Acontains details of the partial factorization. She transforms, periodt π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. Okay so this part has layers, so let's break it down:
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.
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.
Wβ COMPLEX array, dimension(LDW,NB). Over here being the workspace icon that she is β¨LDWβ INTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFOβ INTEGER. The vibe check at the end:= 0: successful exit π> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular. Not a crash, but definitely not slay.
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine clasyf_aa π
subroutine clasyf_aa (character UPLO, integer J1, integer M, integer NB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldh, * ) H, integer LDH, complex, dimension( *
) WORK)
CLASYF_AA β she's giving very much "here for the Aasen's algorithm" energy, and that's literally it.
β¨ Purpose β¨
DLATRF_AA factorizes a panel of a complex symmetric 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. She's reorganizing, not destroying, iykyk π¦
β¨ Parameters β¨
UPLOβ CHARACTER*1. The storage situation:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
J1β INTEGER. The location of the first row, or column, of the panel within the submatrix ofA, passed to this routine. Like, e.g., when called byCSYTRF_AA, for the first panel,J1is1, while for the remaining panels,J1is2. Cute lil head start.Mβ INTEGER. The dimension of the submatrix.M >= 0.NBβ INTEGER. The dimension of the panel to be facotorized. (Yes, we're keeping the typo exactly as she wrote it, no cap π)Aβ COMPLEX array, dimension(LDA,M)for the first panel, while dimension(LDA,M+1)for the remaining panels. On entry,Acontains the last row, or column, of the previous panel, and the trailing submatrix ofAto be factorized, except for the first panel, only the panel is passed. On exit, the leading panel is factorized. She ate and left no crumbs π₯LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).IPIVβ INTEGER array, dimension(M). Details of the row and column interchanges β the row and columnkwere interchanged with the row and columnIPIV(k).Hβ COMPLEX workspace, dimension(LDH,NB).LDHβ INTEGER. The leading dimension of the workspaceH.LDH >= max(1,M).WORKβ COMPLEX workspace, dimension(M).
πΈ 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
Shoutout to Igor, absolute legend π«Ά
π subroutine clasyf_rk π
subroutine clasyf_rk (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) E,
integer, dimension( * ) IPIV, complex, dimension( ldw, * ) W, integer
LDW, integer INFO)
CLASYF_RK computes a partial factorization of a complex symmetric indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method. The rook method, bestie β she's the careful one π
β¨ Purpose β¨
CLASYF_RK computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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.
CLASYF_RK is an auxiliary routine called by CSYTRF_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. Whether the upper or lower triangular part of the symmetric 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. Same rule as always, don't fight it.KBβ INTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.Aβ COMPLEX array, dimension(LDA,N). On entry, the symmetric matrixA.- If
UPLO = '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. - If
UPLO = '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.
- If
On exit, it's holding:
- a) ONLY the diagonal elements of the symmetric block diagonal matrix
Dsit right on the diagonal ofA, i.e.D(k,k) = A(k,k); (the 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
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N). No cap, just give A the room it deserves. π
E
E is COMPLEX array, dimension (N). On exit, it contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where:
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
NOTE: For a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in both theUPLO = 'U'orUPLO = 'L'cases. Both cases, bestie. It's giving equality. β¨
IPIV
IPIV is INTEGER array, dimension (N). IPIV describes the permutation matrix P in the factorization of matrix A as follows. The absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step.
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 in IPIV appear ONLY in pairs. 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.
- c) In both cases a) and b) is always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. No zeros allowed, periodt. π
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 in IPIV appear 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.
- c) In both cases a) and b) is always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. Same energy, flipped inequality. π¦
W
W is COMPLEX array, dimension (LDW,NB). That's the whole vibe.
LDW
LDW is INTEGER. The leading dimension of the array W. LDW >= max(1,N).
INFO
INFO is INTEGER
= 0: successful exit< 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 superdiagonal elements of column k of U (or subdiagonal elements of column k of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. First one only, bestie. The rest are lost to the void. π
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 clasyf_rook β¨
subroutine clasyf_rook (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldw, * ) W, integer LDW, integer INFO)
CLASYF_ROOK computes a partial factorization of a complex symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. Rook energy only. βοΈ
Purpose
CLASYF_ROOK computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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.
CLASYF_ROOK is an auxiliary routine called by CSYTRF_ROOK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). Blocked code, Level 3 BLAS, main character energy. π₯
Parameters
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 0.
NB
NB is INTEGER. The maximum number of columns of the matrix A that should be factored. NB should be at least 2 to allow for 2-by-2 pivot blocks. At least 2, or the 2-by-2 blocks simply cannot slay.
KB
KB is INTEGER. The number of columns of A that were actually factored. KB is either NB-1 or NB, or N if N <= NB.
A
A is COMPLEX array, dimension (LDA,N). On entry, the symmetric matrix A. If UPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit, A contains details of the partial factorization.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D.
If 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)wereinerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (Yes,inerchaged. We keep the typo. It's iconic. π)
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)wereinerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block. Same typo, same legend. π
W
W is COMPLEX array, dimension (LDW,NB).
LDW
LDW is INTEGER. The leading dimension of the array W. LDW >= max(1,N).
INFO
INFO is 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
β¨ csycon β¨
subroutine csycon (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real RCOND,
complex, dimension( * ) WORK, integer INFO)
CSYCON
Okay so CSYCON is here to estimate the reciprocal of the condition number (in the 1-norm, no cap) of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T that CSYTRF already did. It gets an estimate for norm(inv(A)), and then the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). Math but make it fashion. π
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**T;= 'L': Lower triangular, form isA = L*D*L**T.NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.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 ofDas determined byCSYTRF.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. 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 array, dimension (2*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.
β¨ csycon_3 β¨
subroutine csycon_3 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV,
real ANORM, real RCOND, complex, dimension( * ) WORK, integer INFO)
CSYCON_3
Bestie, CSYCON_3 also estimates the reciprocal of the condition number (in the 1-norm) of a complex symmetric matrix A, but it uses the factorization computed by CSYTRF_RK or CSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
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 CSYTRS_3. Fancy. π
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**T)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**T)*(P**T).NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX array, dimension (LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byCSYTRF_RKandCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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 - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβEisCOMPLEX array, dimension (N). On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where IfUPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)not referenced; IfUPLO = '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 ofDas determined byCSYTRF_RKorCSYTRF_BK.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. 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 array, dimension (2*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
β¨ csycon_rook β¨
subroutine csycon_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real
RCOND, complex, dimension( * ) WORK, integer INFO)
CSYCON_ROOK
CSYCON_ROOK estimates the reciprocal of the condition number (in the 1-norm) of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF_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))). Rook energy. βοΈ
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**T;= 'L': Lower triangular, form isA = L*D*L**T.NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF_ROOK.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 ofDas determined byCSYTRF_ROOK.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. 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 array, dimension (2*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:
- April 2012, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
β¨ csyconv β¨
subroutine csyconv (character UPLO, character WAY, integer N, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( * ) E, integer INFO)
CSYCONV
CSYCONV converts A given by TRF into L and D and vice-versa. It gets Non-diag elements of D (returned in workspace) and applies or reverses permutation done in TRF. Itβs giving transformation. π¦
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**T;= 'L': Lower triangular, form isA = L*D*L**T.WAYβWAYisCHARACTER*1.= 'C': Convert;= 'R': Revert.NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEX array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.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 ofDas determined byCSYTRF.EβEisCOMPLEX array, dimension (N).Estores the supdiagonal/subdiagonal of the symmetric 1-by-1 or 2-by-2 block diagonal matrixDinLDLT.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.
π¦ csyconvf β the format-swapper that keeps the receipts
subroutine csyconvf (character UPLO, character WAY, integer N, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer,
dimension( * ) IPIV, integer INFO)
CSYCONVF
Purpose π―
Okay bestie, listen. This one is a translator. If parameter WAY = 'C':
CSYCONVF converts the factorization output format used in CSYTRF provided on entry in parameter A into the factorization output format used in CSYTRF_RK (or CSYTRF_BK) that is stored on exit in parameters A and E. It also converts in place details of the interchanges stored in IPIV from the format used in CSYTRF into the format used in CSYTRF_RK (or CSYTRF_BK). π
If parameter WAY = 'R':
CSYCONVF performs the conversion in reverse direction, i.e. converts the factorization output format used in CSYTRF_RK (or CSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in CSYTRF that is stored on exit in parameter A. It also converts in place details of the interchanges stored in IPIV from the format used in CSYTRF_RK (or CSYTRF_BK) into the format used in CSYTRF.
And no cap, CSYCONVF can also convert in Hermitian matrix case, i.e. between formats used in CHETRF and CHETRF_RK (or CHETRF_BK). Versatile queen behavior. β¨
Parameters π
UPLOβUPLOisCHARACTER*1. Tells us whether the details of the factorization are stored as an upper or lower triangular matrixA. π= 'U': Upper triangular= 'L': Lower triangular
WAYβWAYisCHARACTER*1.= 'C': Convert= 'R': Revert
NβNisINTEGER. The order of the matrixA.N >= 0. (No negativity allowed, she's not about that life.)AβAisCOMPLEXarray, dimension(LDA,N). Two whole moods depending onWAY:- 1) If
WAY ='C':- On entry, contains factorization details in format used in
CSYTRF:- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factorLin the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix
- On exit, contains factorization details in format used in
CSYTRF_RKorCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- On entry, contains factorization details in format used in
- 2) If
WAY = 'R':- On entry, contains factorization details in format used in
CSYTRF_RKorCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- On exit, contains factorization details in format used in
CSYTRF:- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factorLin the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix
- On entry, contains factorization details in format used in
- 1) If
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβEisCOMPLEXarray, dimension(N).- 1) If
WAY ='C':- On entry, just a workspace. (She's showing up with nothing and leaving with everything. Growth. π±)
- On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
Dwith 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 to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
- If
- 2) If
WAY = 'R':- On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
Dwith 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.
- If
- On exit, is not changed. (Iconic: untouched, unbothered, thriving. π )
- On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
- 1) If
IPIVβIPIVisINTEGERarray, dimension(N).- 1) If
WAY ='C':On entry, details of the interchanges and the block structure ofDin the format used inCSYTRF. On exit, details of the interchanges and the block structure ofDin the format used inCSYTRF_RK( orCSYTRF_BK). - 1) If
WAY ='R':On entry, details of the interchanges and the block structure ofDin the format used inCSYTRF_RK( orCSYTRF_BK). On exit, details of the interchanges and the block structure ofDin the format used inCSYTRF.
- 1) If
INFOβINFOisINTEGER.= 0: successful exit< 0: if INFO = -i, the i-th argument had an illegal value
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
πΈ csyconvf_rook β the other format-swapper, ROOK edition
subroutine csyconvf_rook (character UPLO, character WAY, integer N, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer,
dimension( * ) IPIV, integer INFO)
CSYCONVF_ROOK
Purpose π―
If parameter WAY = 'C':
CSYCONVF_ROOK converts the factorization output format used in CSYTRF_ROOK provided on entry in parameter A into the factorization output format used in CSYTRF_RK (or CSYTRF_BK) that is stored on exit in parameters A and E. IPIV format for CSYTRF_ROOK and CSYTRF_RK (or CSYTRF_BK) is the same and is not converted. (Not her job, not her problem. π)
If parameter WAY = 'R':
CSYCONVF_ROOK performs the conversion in reverse direction, i.e. converts the factorization output format used in CSYTRF_RK (or CSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in CSYTRF_ROOK that is stored on exit in parameter A. IPIV format for CSYTRF_ROOK and CSYTRF_RK (or CSYTRF_BK) is the same and is not converted.
And yeah, CSYCONVF_ROOK can also convert in Hermitian matrix case, i.e. between formats used in CHETRF_ROOK and CHETRF_RK (or CHETRF_BK). She contains multitudes. π¦
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrixA.= 'U': Upper triangular= 'L': Lower triangular
WAYβWAYisCHARACTER*1.= 'C': Convert= 'R': Revert
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N).- 1) If
WAY ='C':- On entry, contains factorization details in format used in
CSYTRF_ROOK:- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factorLin the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix
- On exit, contains factorization details in format used in
CSYTRF_RKorCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- On entry, contains factorization details in format used in
- 2) If
WAY = 'R':- On entry, contains factorization details in format used in
CSYTRF_RKorCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- On exit, contains factorization details in format used in
CSYTRF_ROOK:- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factorLin the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix
- On entry, contains factorization details in format used in
- 1) If
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβEisCOMPLEXarray, dimension(N).- 1) If
WAY ='C':- On entry, just a workspace.
- On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
Dwith 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 to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
- If
- 2) If
WAY = 'R':
- 1) If
Eβ bestie, this is an array holding the superdiagonal (or subdiagonal, depending on the vibe) elements of the symmetric block diagonal matrixD, which is built out of 1-by-1 or 2-by-2 diagonal blocks. Here's the tea:- 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
On exit, is not changed. π (she's just here to look pretty, she doesn't get touched)
IPIVβIPIVis INTEGER array, dimension (N).
On entry, it's got all the details of the interchanges and the block structure of D, as determined by:
CSYTRF_ROOK, ifWAY ='C';CSYTRF_RK(orCSYTRF_BK), ifWAY ='R'.
The IPIV format is the same for all these routines. Fr fr, all of them. β¨
On exit, is not changed.
INFOβINFOis 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:
- November 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
π¦ CSYEQUB
subroutine csyequb (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, real, dimension( * ) S, real SCOND, real AMAX, complex,
dimension( * ) WORK, integer INFO)
β¨ Purpose:
CSYEQUB computes row and column scalings that are meant to equilibrate a symmetric matrix A (with respect to the Euclidean norm, no cap) and reduce its condition number. The scale factors S are computed by the BIN algorithm (see references, bestie) 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. Like, she's that good. π
πΈ Parameters
UPLOβUPLOis CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNis INTEGER
The order of the matrix A. N >= 0.
AβAis COMPLEX array, dimension (LDA,N)
The N-by-N symmetric matrix whose scaling factors are to be computed.
LDAβLDAis INTEGER
The leading dimension of the array A. LDA >= max(1,N).
SβSis REAL array, dimension (N)
If INFO = 0, S contains the scale factors for A.
SCONDβSCONDis REAL
If INFO = 0, S contains the ratio of the smallest S(i) to the largest S(i). If SCOND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by S. (like, don't bother, she's fine π)
AMAXβAMAXis REAL
Largest absolute value of any matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.
WORKβWORKis COMPLEX array, dimension (2*N)INFOβINFOis 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
π CSYRFS
subroutine csyrfs (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, * ) AF,
integer LDAF, integer, dimension( * ) IPIV, complex, dimension( ldb, * )
B, integer LDB, complex, dimension( ldx, * ) X, integer LDX, real,
dimension( * ) FERR, real, dimension( * ) BERR, complex, dimension( * )
WORK, real, dimension( * ) RWORK, integer INFO)
β¨ Purpose:
CSYRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite, and provides error bounds and backward error estimates for the solution. She's the glow-up your solution needed. π₯
πΈ Parameters
UPLOβUPLOis CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNis INTEGER
The order of the matrix A. N >= 0.
NRHSβNRHSis INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
AβAis COMPLEX array, dimension (LDA,N)
The symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. (the other half is literally not invited π«₯)
LDAβLDAis INTEGER
The leading dimension of the array A. LDA >= max(1,N).
AFβAFis COMPLEX array, dimension (LDAF,N)
The factored form of the matrix A. AF contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by CSYTRF.
LDAFβLDAFis INTEGER
The leading dimension of the array AF. LDAF >= max(1,N).
IPIVβIPIVis INTEGER array, dimension (N)
Details of the interchanges and the block structure of D as determined by CSYTRF.
BβBis COMPLEX array, dimension (LDB,NRHS)
The right hand side matrix B.
LDBβLDBis INTEGER
The leading dimension of the array B. LDB >= max(1,N).
XβXis COMPLEX array, dimension (LDX,NRHS)
On entry, the solution matrix X, as computed by CSYTRS. On exit, the improved solution matrix X. β (she got a makeover)
LDXβLDXis INTEGER
The leading dimension of the array X. LDX >= max(1,N).
FERRβFERRis REAL array, dimension (NRHS)
The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(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 in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error. (she's a lil dramatic, but in a cute way π
)
BERRβBERRis REAL array, dimension (NRHS)
The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).
WORKβWORKis COMPLEX array, dimension (2*N)RWORKβRWORKis REAL array, dimension (N)INFOβINFOis INTEGER= 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.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π CSYRFSX
subroutine csyrfsx (character UPLO, character EQUED, integer N, integer
NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension(
ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, real,
dimension( * ) S, complex, dimension( ldb, * ) B, integer LDB, complex,
dimension( ldx, * ) X, integer LDX, real RCOND, real, dimension( * )
BERR, integer N_ERR_BNDS, real, dimension( nrhs, * ) ERR_BNDS_NORM,
real, dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, real,
dimension( * ) PARAMS, complex, dimension( * ) WORK, real, dimension( *
) RWORK, integer INFO)
β¨ Purpose:
CSYRFSX improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite, and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. π
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. (the "just trust me bro" option, but like, officially sanctioned β¨)
πΈ Parameters
UPLOβUPLOis CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
EQUEDβEQUEDis CHARACTER*1
Specifies the form of equilibration that was done to A before 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βNis INTEGER
The order of the matrix A. N >= 0.
NRHSβNRHSis INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
Aβ okay bestie, hold on, her description is literally arriving in the next part, don't scroll away π
A
A is a COMPLEX array, dimension (LDA,N) β bestie, this is literally the symmetric matrix itself. And the way it's stored depends on UPLO, so listen up:
- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAholds the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced (so like, don't bother filling it in, it's giving background extra π ). - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAholds the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
LDA
LDA is INTEGER β the leading dimension of the array A, no cap. It has to satisfy LDA >= max(1,N).
AF
AF is a COMPLEX array, dimension (LDAF,N) β this is the factored form of the matrix A. AF contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by CSYTRF. Iconic, honestly.
LDAF
LDAF is INTEGER β the leading dimension of the array AF. Constraint: LDAF >= max(1,N). β¨
IPIV
IPIV is an INTEGER array, dimension (N) β it holds the deets on the interchanges and the block structure of D, as determined by CSYTRF. π«Ά
S
S is a REAL array, dimension (N) β the scale factors for A.
Okay so here's the situation:
- If
EQUED = 'Y',Ais multiplied on the left and right bydiag(S). Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument.- If
FACT = 'F'andEQUED = 'Y', each element ofSmust be positive. - If
Sis output, each element ofSis a power of the radix. - If
Sis 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 like, don't play with it.
B
B is a COMPLEX array, dimension (LDB,NRHS) β the right hand side matrix B. That's the whole job.
LDB
LDB is INTEGER β the leading dimension of the array B. You need LDB >= max(1,N).
X
X is a COMPLEX array, dimension (LDX,NRHS):
- On entry: the solution matrix
X, as computed byCGETRS. - On exit: the improved solution matrix
X. Glow up, fr fr.
LDX
LDX is INTEGER β the leading dimension of the array X, and it needs LDX >= max(1,N).
RCOND
RCOND is REAL β the reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that happened).
If this is less than the machine precision (in particular, if it's zero), the matrix is singular to working precision. π
Note though: the error may still be small even if this number is very small and the matrix appears ill-conditioned. So like, don't panic-spiral immediately, bestie.
BERR
BERR is a REAL array, dimension (NRHS) β the componentwise relative backward error. Precisely: this is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution). She's precise. π
N_ERR_BNDS
N_ERR_BNDS is INTEGER β the number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below. π
ERR_BNDS_NORM
ERR_BNDS_NORM is a REAL array, 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 of 10 of 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 approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π
ERR_BNDS_COMP
ERR_BNDS_COMP is a REAL array, 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), thenERR_BNDS_COMPis not accessed. IfN_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 of 10 of 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 approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π
NPARAMS
NPARAMS is INTEGER β it specifies the number of parameters set in PARAMS. If it's <= 0, the PARAMS array is never referenced and default values are used. Chill vibes only.
PARAMS
PARAMS is a REAL array, dimension NPARAMS β it specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not.- Default:
1.0= 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2): Maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: Set to
100to permit convergence using approximate factorizations or factorizations other thanLU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. π¬
- Default:
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)
- Default:
WORK
WORK is a COMPLEX array, dimension (2*N). Just vibing in the background, doing the work. πͺ
RWORK
RWORK is a REAL array, dimension (2*N). Same energy, real numbers this time.
INFO
okay bestie the tea on INFO is literally spilling over into the next part β hold that thought π«β¨
= 0: Successful exit. The solution to every right-hand side is guaranteed. No notes, immaculate.< 0: IfINFO = -i, the i-th argument had an illegal value. bestie that argument is a crime scene.> 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 era, honestly.= N+J: The solution corresponding to the Jth 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 the Jth 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) the Jth 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. tl;dr it only snitches on the first sus one, you gotta go look at the full arrays yourself.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine csysv_aa_2stage π¦
subroutine csysv_aa_2stage (character UPLO, integer N, integer NRHS,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex, dimension( ldb, * ) B, integer LDB, complex, dimension(
* ) WORK, integer LWORK, integer INFO)
CSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matrices periodt π
β¨ Purpose:
CSYSV_AA_2STAGE computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
Aasen's 2-stage algorithm is used to factor A as
A = U**T * T * U, if UPLO = 'U', or
A = L * T * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is symmetric and band. The matrix T is then LU-factored with partial pivoting. The factored form of A is then used to solve the system of equations A * X = B.
This is the blocked version of the algorithm, calling Level 3 BLAS. big girl algorithm energy, she does it in chunks.
β¨ Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
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βAisCOMPLEXarray, dimension(LDA,N). On entry, the symmetric 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, L is stored below (or above) the subdiaonal blocks, when UPLO is 'L' (or 'U'). yes it said subdiaonal, we're keeping it, don't @ me.
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBβTBisCOMPLEXarray, dimension(LTB). On exit, details of the LU factorization of the band matrix. receipts, saved for later.LTBβLTBisINTEGER. The size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch thatLTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA.
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).IPIV2βIPIV2isINTEGERarray, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofTwere interchanged with the row and columnIPIV(k).BβBisCOMPLEXarray, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. glow up, it becomes the answer πLDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORKβWORKisCOMPLEXworkspace of sizeLWORK.LWORKβLWORKisINTEGER. The size ofWORK.LWORK >= N, internally used to selectNBsuch thatLWORK >= N*NB.
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, the i-th argument had an illegal value.> 0: ifINFO = i, band LU factorization failed on i-th column oof, column i said no.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine csytf2 π
subroutine csytf2 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
CSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). note: the blurb says real, the Purpose says complex β we report, we don't decide.
β¨ Purpose:
CSYTF2 computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
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, U**T is the transpose of U, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. the chill, one-at-a-time sibling. no blocking, just vibes.
β¨ Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the symmetric 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). 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β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. π¨ do NOT use it to solve anything, that's a division by zero, that's a whole disaster.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ Further Details:
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k). she's packing everything right back into A, efficient queen π
So when UPLO = 'L', bestie, we get A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
like, L is a product of terms P(k)*L(k), and k walks from 1 to n in steps of 1 or 2, and D is that 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, then 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 π
- 09-29-06 - patch from Bobby Cheng, MathWorks
Replace l.209 and l.377
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
- 1-96 - Based on modifications by J. Lewis, Boeing Computer Services Company
subroutine csytf2_rk π¦
subroutine csytf2_rk (character UPLO, integer N, complex, dimension( lda, *
) A, integer LDA, complex, dimension( * ) E, integer, dimension( * )
IPIV, integer INFO)
CSYTF2_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). no cap, that's the whole vibe of this one.
Purpose πΈ
CSYTF2_RK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see Further Details section. π
Parameters
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N). On entry, the symmetric matrix A.
- If
UPLO = 'U': the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. - If
UPLO = 'L': the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, contains:
- a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of A, i.e.
D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements of D are stored on exit in arrayE), and - b) If
UPLO = 'U': factor U in the superdiagonal part of A. IfUPLO = 'L': factor L in the subdiagonal part of A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N). On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where
- If
UPLO = 'U':E(i) = D(i-1,i), i=2:N,E(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i), i=1:N-1,E(N)is set to 0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. π«Ά
IPIV
IPIV is INTEGER array, dimension (N). IPIV describes the permutation matrix P in the factorization of matrix A as follows. The absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section.
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columns k andIPIV(k)were interchanged in the matrixA(1:N,1:N); IfIPIV(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 inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columns k and-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 columns k-1 and-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.
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. IfIPIV(k) != k, rows and columns k andIPIV(k)were interchanged in the matrixA(1:N,1:N). IfIPIV(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 inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columns k and-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 columns k-1 and-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
INFO is INTEGER.
= 0: successful exit< 0: IfINFO = -k, the k-th argument had an illegal value> 0: IfINFO = k, the matrix A is singular, because: IfUPLO = 'U': column k in the upper triangular part of A contains all zeros. IfUPLO = 'L': column k in the lower triangular part of A contains all zeros.
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. π
NOTE: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.
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 csytf2_rook β
subroutine csytf2_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
CSYTF2_ROOK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm). π
Purpose:
CSYTF2_ROOK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method:
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, U**T is the transpose of U, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. β¨
Parameters
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 0.
AAβ a COMPLEX array, dimension(LDA,N). On entry, bestie, this is the symmetric 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 β like, it's giving background extra, don't even look at it. 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details β the receipts are all down there π
).
LDAβLDAis INTEGER. It's the leading dimension of the arrayA. Constraint era:LDA >= max(1,N). β¨IPIVβIPIVis an INTEGER array, dimension(N). It's got all the 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) < 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':
- 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.
INFOβINFOis INTEGER, and it's the vibe check at the end π= 0: successful exit. slay.< 0: ifINFO = -k, the k-th argument had an illegal value. rude.> 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. be so careful. π
π¦ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ Further Details:
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
πΈ 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 abd, USA
π subroutine csytrf
subroutine csytrf (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CSYTRF
π Purpose:
CSYTRF computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is
A = U*D*U**T or A = L*D*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. it's giving optimized, no cap. π₯
π Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNis INTEGER. The order of the matrixA. Constraint:N >= 0.AβAis a COMPLEX array, dimension(LDA,N). On entry, the symmetric 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βLDAis INTEGER. The leading dimension of the arrayA. Constraint:LDA >= max(1,N).IPIVβIPIVis an INTEGER array, 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βWORKis a COMPLEX array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. β¨LWORKβLWORKis INTEGER. The length ofWORK. Constraint:LWORK >= 1. For best performance,LWORK >= N*NB, whereNBis the block size returned byILAENV.
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. iconic behavior honestly.
INFOβINFOis INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
π¦ subroutine csytrf_aa
subroutine csytrf_aa (character UPLO, integer N, complex, dimension( lda, *
) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CSYTRF_AA
β¨ Purpose:
CSYTRF_AA computes the factorization of a complex symmetric matrix A using the Aasen's algorithm. The form of the factorization is
A = U**T*T*U or A = L*T*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a complex symmetric 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βNis INTEGER. The order of the matrixA. Constraint:N >= 0.A
A
Okay so</p> A is a COMPLEX array, dimension (LDA,N).
On entry, this is the symmetric matrix A β¨. If UPLO = 'U', the leading N-by-N upper triangular part of A holds the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced (like, we literally do not look at it, bestie). If UPLO = 'L', the leading N-by-N lower triangular part of A holds the lower triangular part of the matrix A, and the strictly upper triangular part of A is 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
LDA is INTEGER.
The leading dimension of the array A. So like, LDA >= max(1,N). Respect the math, queen.
IPIV
IPIV is INTEGER array, dimension (N).
On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and column IPIV(k). π
WORK
WORK is COMPLEX array, dimension (MAX(1,LWORK)).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. It's giving "here's how much room I actually wanted" energy.
LWORK
LWORK is INTEGER.
The length of WORK. LWORK >= MAX(1,2*N). For optimum performance LWORK >= N*(1+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.
CSYTRF_AA_2STAGE π
subroutine csytrf_aa_2stage (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( * ) TB, integer LTB,
integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, complex,
dimension( * ) WORK, integer LWORK, integer INFO)
Purpose
Not me about to explain the Aasen's algorithm to you, bestie, because it's lowkey iconic. CSYTRF_AA_2STAGE computes the factorization of a complex symmetric matrix A using the Aasen's algorithm. The form of the factorization is
A = U**T*T*U or A = L*T*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a complex symmetric band matrix with the bandwidth of NB (NB is internally selected and stored in TB( 1 ), and T is LU factorized with partial pivoting). β¨
This is the blocked version of the algorithm, calling Level 3 BLAS. Level 3 BLAS?? We love a fast bestie. π₯
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 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, L is stored below (or above) the subdiagonal blocks, when UPLO is 'L' (or 'U'). π
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
TB
TB is COMPLEX array, dimension (LTB)
On exit, details of the LU factorization of the band matrix. π
LTB
LTB is INTEGER
The size of the array TB. LTB >= 4*N, internally used to select NB such that LTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA. π
IPIV
IPIV is INTEGER array, dimension (N)
On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and column IPIV(k). π
IPIV2
IPIV2 is INTEGER array, dimension (N)
On exit, it contains the details of the interchanges, i.e., the row and column k of T were interchanged with the row and column IPIV(k).
WORK
WORK is COMPLEX workspace of size LWORK
LWORK
LWORK is INTEGER
The size of WORK. LWORK >= N, internally used to select NB such that LWORK >= N*NB.
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. π> 0: ifINFO = i, band LU factorization failed on i-th column π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
CSYTRF_RK π¦
subroutine csytrf_rk (character UPLO, integer N, complex, dimension( lda, *
) A, integer LDA, complex, dimension( * ) E, integer, dimension( * )
IPIV, complex, dimension( * ) WORK, integer LWORK, integer INFO)
CSYTRF_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm). π
Purpose
CSYTRF_RK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. β¨
This is the blocked version of the algorithm, calling Level 3 BLAS. For more information see Further Details section.
Parameters
UPLO
UPLO is CHARACTER*1
Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER
The order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N)
On entry, the symmetric matrix A.
- If
UPLO = '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. - If
UPLO = '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, contains:
- ONLY diagonal elements of the symmetric 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
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N)
On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to 0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. π«Ά
IPIV
IPIV is INTEGER array, dimension (N)
IPIV describes the permutation matrix P in the factorization of matrix A as follows. The absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section. π
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); IfIPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries, like
IPIV(k) < 0andIPIV(k-1) < 0, means one thing and one thing only bestie:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs, no solo negativity here π )- If
-IPIV(k) != k, then rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred, she stayed put π«Ά - If
-IPIV(k-1) != k-1, then 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), it's always
ABS( IPIV(k) ) <= k. periodt. - d) NOTE: any entry
IPIV(k)is always NONZERO on output. no zeros allowed, zero is not invited to this party π«
If UPLO = 'L', (and in factorization order, k increases from 1 to N, so she's climbing π):
- a) A single positive entry
IPIV(k) > 0meansD(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries,
IPIV(k) < 0andIPIV(k+1) < 0, meansD(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs, we've been over this π)- If
-IPIV(k) != k, then 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, then 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), it's always
ABS( IPIV(k) ) >= k. - d) NOTE: any entry
IPIV(k)is always NONZERO on output. yes we're saying it again, it's that important π
π§Ί WORK
WORK is COMPLEX array, dimension ( MAX(1,LWORK) ). On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. she's self-reporting her ideal size, iconic behavior π
π LWORK
LWORK is INTEGER β the length of WORK. LWORK >= 1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV. (give her room to breathe bestie, she performs better π
)
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. so don't worry, nobody's yelling at you here π«Ά
π¦ INFO
INFO is INTEGER:
= 0: successful exit
< 0: If INFO = -k, the k-th argument had an illegal value
> 0: If INFO = k, the matrix A is singular, because:
If UPLO = 'U': column k in the upper
triangular part of A contains all zeros.
If UPLO = 'L': column k in the lower
triangular part of A contains all zeros.
Therefore D(k,k) is exactly zero, and superdiagonal
elements of column k of U (or subdiagonal elements of
column k of L ) are all zeros. The factorization has
been completed, but the block diagonal matrix D is
exactly singular, and division by zero will occur if
it is used to solve a system of equations.
NOTE: INFO only stores the first occurrence of
a singularity, any subsequent occurrence of singularity
is not stored in INFO even though the factorization
always completes.
bestie listen to me.INFO > 0means the matrix is singular and dividing by zero WILL happen if you try to solve a system with it. that's not a vibe, that's a crash. respect theINFOπ
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
TODO: put correct description
π«Ά 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 csytrf_rook
subroutine csytrf_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( *
) WORK, integer LWORK, integer INFO)
β¨ CSYTRF_ROOK
π― Purpose:
CSYTRF_ROOK computes the factorization of a complex symmetric 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 symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. (level 3? she's highkey eating π₯)
π§© Parameters
UPLOβUPLOisCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the symmetric 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.
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 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.
WORKβWORKisCOMPLEXarray, 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.
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: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, D(i,i) is exactly zero. The factorization
has been completed, but the block diagonal matrix D is
exactly singular, and division by zero will occur if it
is used to solve a system of equations.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
π«Ά 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 csytri
subroutine csytri (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer INFO)
β¨ CSYTRI
π― Purpose:
okay so CSYTRI is literally the inverse-machine π« it computes the inverse of a complex symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF. bestie, that's the whole plot: you hand it the factorization, it hands you back the inverse. periodt.
UPLOβCHARACTER*1. tells you whether the details of the factorization are stored as an upper or lower triangular matrix. no third option, we're not doing that today:= 'U': upper triangular, form isA = U*D*U**T;= 'L': lower triangular, form isA = L*D*L**T.
NβINTEGER. the order of the matrixA.N >= 0.AβCOMPLEX array, dimension(LDA,N).- on entry: the block diagonal matrix
Dand the multipliers used to obtain the factorUorLas computed byCSYTRF. πΎ - on exit, if
INFO = 0: the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced. so mind which half you're reading, ok? π
- on entry: the block diagonal matrix
LDAβINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).IPIVβINTEGER array, dimension(N). the details of the interchanges and the block structure ofDas determined byCSYTRF.WORKβCOMPLEX array, dimension(2*N).INFOβINTEGER. the exit-status tea β:= 0: successful exit. slay.< 0: ifINFO = -i, the i-th argument had an illegal value. rude.> 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.
CSYTRI2 π
subroutine csytri2 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CSYTRI2 β¨
Purpose:
CSYTRI2 computes the inverse of a complex symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF. and then β the lil glow-up β CSYTRI2 sets the LEADING DIMENSION of the workspace before calling CSYTRI2X that actually computes the inverse. so it's giving backstage-manager energy, setting things up for the main character. π
UPLOβ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βINTEGER. the order of the matrixA.N >= 0.AβCOMPLEX array, dimension(LDA,N).- on entry: the block diagonal matrix
Dand the multipliers used to obtain the factorUorLas computed byCSYTRF. - on exit, if
INFO = 0: the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
- on entry: the block diagonal matrix
LDAβINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).IPIVβINTEGER array, dimension(N). the details of the interchanges and the block structure ofDas determined byCSYTRF.WORKβCOMPLEX array, dimension(N+NB+1)*(NB+3).LWORKβINTEGER. the dimension of the arrayWORK.WORKis size >=(N+NB+1)*(NB+3)- if
LWORK = -1, then a workspace query is assumed; the routine:- calculates the optimal size of the
WORKarray, returns this value as the first entry of theWORKarray, - and no error message related to
LWORKis issued byXERBLA.
- calculates the optimal size of the
INFOβ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.
CSYTRI2X π¦
subroutine csytri2x (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension(
n+nb+1,* ) WORK, integer NB, integer INFO)
CSYTRI2X β¨
Purpose:
CSYTRI2X computes the inverse of a real symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF.
UPLOβ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βINTEGER. the order of the matrixA.N >= 0.AβCOMPLEX array, dimension(LDA,N).- on entry: the
NNBdiagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF. - on exit, if
INFO = 0: the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
- on entry: the
LDAβINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).IPIVβINTEGER array, dimension(N). the details of the interchanges and theNNBstructure ofDas determined byCSYTRF.WORKβCOMPLEX array, dimension(N+NB+1,NB+3).NBβINTEGER. block size π¦INFOβ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.
CSYTRI_3 π
subroutine csytri_3 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV,
complex, dimension( * ) WORK, integer LWORK, integer INFO)
CSYTRI_3 β¨
Purpose:
CSYTRI_3 computes the inverse of a complex symmetric indefinite matrix A using the factorization computed by CSYTRF_RK or CSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
CSYTRI_3 sets the leading dimension of the workspace before calling CSYTRI_3X that actually computes the inverse. this is the blocked version of the algorithm, calling Level 3 BLAS. we love a glow-up that uses the good BLAS. π₯
UPLOβCHARACTER*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βINTEGER. the order of the matrixA.N >= 0.AβCOMPLEX array, dimension(LDA,N).- on entry: the diagonal of the block diagonal matrix
Dand factorsUorLas computed byCSYTRF_RKandCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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 - b) if
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- 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 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.
- if
- on entry: the diagonal of the block diagonal matrix
LDAβINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).EβCOMPLEX array, dimension(N).- on entry: contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
Dwith 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.
- if
- NOTE: for 1-by-1 diagonal block
D(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
- on entry: contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
IPIVβINTEGER array, dimension(N). the details of the interchanges and the block structure ofDas determined byCSYTRF_RKorCSYTRF_BK.WORKβCOMPLEX array, dimension(N+NB+1)*(NB+3). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK. πLWORKβINTEGER. 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, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. So it's just doing a size check, bestie, no cap. β¨
INFOβ it's anINTEGER, and it's the final vibe check:= 0: successful exit, we love to see it π< 0: ifINFO = -i, the i-th argument had an illegal value, so something's sus π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed, so no inverse, sorry bestie π
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 π¦
csytri_3x
subroutine csytri_3x (character UPLO, integer N, complex, dimension( lda, *
) A, integer LDA, complex, dimension( * ) E, integer, dimension( * )
IPIV, complex, dimension( n+nb+1, * ) WORK, integer NB, integer INFO)
CSYTRI_3X
Purpose:
CSYTRI_3X computes the inverse of a complex symmetric indefinite matrix A using the factorization computed by CSYTRF_RK or CSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. So it's the glow-up, the main character energy, periodt. π
Parameters
UPLOβUPLO is CHARACTER*1. Tells you if the factorization details are stored as an upper or lower triangular matrix.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβN is INTEGER. The order of the matrixA.N >= 0.AβA is COMPLEX array, dimension (LDA,N). On entry, diagonal of the block diagonal matrixDand factorsUorLas computed byCSYTRF_RKandCSYTRF_BK:- a) ONLY diagonal elements of the symmetric 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 - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
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 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βLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβE is COMPLEX array, dimension (N). On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric 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.
- If
NOTE: For 1-by-1 diagonal block D(k), where 1 <= k <= N, the element E(k) is not referenced in both UPLO = 'U' or UPLO = 'L' cases. So don't even worry about it, bestie. π
IPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byCSYTRF_RKorCSYTRF_BK.WORKβWORK is COMPLEX 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.
Contributors
June 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
csytri_rook
subroutine csytri_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( *
) WORK, integer INFO)
CSYTRI_ROOK
Purpose:
CSYTRI_ROOK computes the inverse of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF_ROOK. It's giving inverse vibes, fr fr.
Parameters
UPLOβUPLO is CHARACTER*1. Tells you if the factorization details 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 array, dimension (LDA,N). On entry, the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF_ROOK.
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 arrayA.LDA >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byCSYTRF_ROOK.WORKβWORK is COMPLEX 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.
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
csytrs
subroutine csytrs (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CSYTRS
Purpose:
CSYTRS solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF. Just being iconic, no big deal. π
Parameters
UPLOβUPLO is CHARACTER*1. Tells you if the factorization details 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.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AβA is COMPLEX array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCSYTRF.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byCSYTRF.BβB is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX.LDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).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.
csytrs2
subroutine csytrs2 (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * )
WORK, integer INFO)
CSYTRS2
Purpose:
CSYTRS2 solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF and converted by CSYCONV. Obsessed with this one, honestly.
Parameters
UPLOβUPLO is CHARACTER*1. Tells you if the factorization details 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.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.Aβ
A is a COMPLEX array, dimension (LDA,N) β and she is carrying the whole thing, okay? She holds the block diagonal matrix D and the multipliers used to obtain the factor U or L, exactly as computed by CSYTRF. π
β οΈ Now listen, because this is the part everyone gets wrong on the quiz:Ais input / output. Not input only. I know it looks input only, I know one may think that A is input only, but no.Ais input / output. Why? Because at the start of the subroutine we permuteAinto a 'better' form, and then at the end we permuteAback to its original form. She goes on a little journey and comes home. π
LDA
LDA is INTEGER β the leading dimension of the array A. And the law is LDA >= max(1,N). No exceptions, bestie. π
IPIV
IPIV is INTEGER array, dimension (N). She's got the details of the interchanges and the block structure of D, as determined by CSYTRF. π¦
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. It's giving transformation, it's giving main character arc. β¨
LDB
LDB is INTEGER β the leading dimension of the array B. Requirement: LDB >= max(1,N). Simple as that. πΈ
WORK
WORK is COMPLEX array, dimension (N). Just a lil workspace. She's doing her best. π«Ά
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.
subroutine csytrs_3 (...)
subroutine csytrs_3 (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer,
dimension( * ) IPIV, complex, dimension( ldb, * ) B, integer LDB,
integer INFO)
CSYTRS_3 π§
Purpose:
CSYTRS_3 solves a system of linear equations A * X = B with a complex symmetric matrix A, using the factorization computed by CSYTRF_RK or CSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is a unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
And the tea? This algorithm is using Level 3 BLAS. We love a fast queen. π₯
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 is A = P*U*D*(U**T)*(P**T);= 'L': Lower triangular, form is A = P*L*D*(L**T)*(P**T).
N
N is INTEGER β the order of the matrix A. N >= 0. π
NRHS
NRHS is INTEGER β the number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
A
A is COMPLEX array, dimension (LDA,N). She holds the diagonal of the block diagonal matrix D and the factors U or L as computed by CSYTRF_RK and CSYTRF_BK:
- ONLY the diagonal elements of the symmetric block diagonal matrix D, 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 array E), and - If
UPLO = 'U': factor U in the superdiagonal part of A. IfUPLO = 'L': factor L in the subdiagonal part of A.
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,N). πΈ
E
E is COMPLEX array, dimension (N).
On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where:
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)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. She's just out here unbothered. π
IPIV
IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D, as determined by CSYTRF_RK or CSYTRF_BK. π¦
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. β¨
LDB
LDB is INTEGER β the leading dimension of the array B. LDB >= max(1,N).
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.
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 csytrs_aa (...)
subroutine csytrs_aa (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CSYTRS_AA π
Purpose:
CSYTRS_AA solves a system of linear equations A*X = B with a complex symmetric matrix A, using the factorization A = U**T*T*U or A = L*T*L**T computed by CSYTRF_AA. π«Ά
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 is A = U**T*T*U;= 'L': Lower triangular, form is A = L*T*L**T.
N
N is INTEGER β the order of the matrix A. N >= 0. π
NRHS
NRHS is INTEGER β the number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
A
A is COMPLEX array, dimension (LDA,N). Details of factors computed by CSYTRF_AA. πΈ
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 as computed by CSYTRF_AA. π¦
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. β¨
LDB
LDB is INTEGER β the leading dimension of the array B. LDB >= max(1,N).
WORK
WORK is COMPLEX array, dimension (MAX(1,LWORK)). π§
LWORK
LWORK is INTEGER β the dimension of the array WORK. And the rule is LWORK >= max(1,3*N-2). Yes, that exact expression, don't round it, don't vibe-guess it. π
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.
subroutine csytrs_aa_2stage (...)
subroutine csytrs_aa_2stage (character UPLO, integer N, integer NRHS,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CSYTRS_AA_2STAGE π₯
Purpose:
CSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a complex symmetric matrix A, using the factorization A = U**T*T*U or A = L*T*L**T computed by CSYTRF_AA_2STAGE. Two stages, two slays. π
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 is A = U**T*T*U;= 'L': Lower triangular, form is A = L*T*L**T.
N
N is INTEGER β the order of the matrix A. N >= 0. π
NRHS
NRHS is INTEGER β the number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
A
A is COMPLEX array, dimension (LDA,N). Details of factors computed by CSYTRF_AA_2STAGE. πΈ
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,N).
TB
TB is COMPLEX array, dimension (LTB). Details of factors computed by CSYTRF_AA_2STAGE. π¦
LTB
LTB is INTEGER β the size of the array TB. And bestie, LTB >= 4*N. Four. Times. N. Not three. π
IPIV
IPIV is INTEGER array, dimension (N). Details of the interchanges as computed by CSYTRF_AA_2STAGE. β¨
IPIV2
IPIV2 is INTEGER array, dimension (N). Details of the interchanges as computed by CSYTRF_AA_2STAGE. (Yes, there's a second one. She's thorough. π
)
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. π
LDB
LDB is INTEGER β the leading dimension of the array B. LDB >= max(1,N).
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.
subroutine csytrs_rook (...)
subroutine csytrs_rook (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CSYTRS_ROOK βοΈ
Purpose:
CSYTRS_ROOK solves a system of linear equations A*X = B with a complex symmetric matrix A, using the factorization A = U*D*U**T or A = L*D*L**T computed by CSYTRF_ROOK. π«Ά
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 is A = U*D*U**T;= 'L': Lower triangular, form is A = L*D*L**T.
N
N is INTEGER β the order of the matrix A. N >= 0. π
NRHS
NRHSβNRHSisINTEGER. bestie it's the number of right hand sides, aka how many columns the matrixBhas. rule:NRHS >= 0. πAβAisCOMPLEXarray, dimension(LDA,N). it's the block diagonal matrixDplus the multipliers used to get the factorUorL, exactly as computed byCSYTRF_ROOK. π«ΆLDAβLDAisINTEGER. leading dimension of the arrayA. requirement:LDA >= max(1,N). no notes, just vibes β¨IPIVβIPIVisINTEGERarray, dimension(N). all the details of the interchanges and the block structure ofD, as determined byCSYTRF_ROOK. the receipts, basically πBβBisCOMPLEXarray, dimension(LDB,NRHS). on entry it's the right hand side matrixB, on exit it's the solution matrixX. glow-up complete π¦LDBβLDBisINTEGER. leading dimension of the arrayB. requirement:LDB >= max(1,N). πINFOβINFOisINTEGER.= 0: successful exit, we ate π₯< 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: π
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 ctgsyl (character TRANS, integer IJOB, integer M, integer N,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, *
) B, integer LDB, complex, dimension( ldc, * ) C, integer LDC, complex,
dimension( ldd, * ) D, integer LDD, complex, dimension( lde, * ) E,
integer LDE, complex, dimension( ldf, * ) F, integer LDF, real SCALE,
real DIF, complex, dimension( * ) WORK, integer LWORK, integer,
dimension( * ) IWORK, integer INFO)
CTGSYL
π Purpose: π
CTGSYL solves the generalized Sylvester equation:
A * R - L * B = scale * C (1)
D * R - L * E = scale * F
where R and L are unknown m-by-n matrices, (A, D), (B, E) and (C, F) are given matrix pairs of size m-by-m, n-by-n and m-by-n, respectively, with complex entries. A, B, D and E are upper triangular (i.e., (A,D) and (B,E) in generalized Schur form). π
The solution (R, L) overwrites (C, F). 0 <= SCALE <= 1 is an output scaling factor chosen to avoid overflow.
In matrix notation (1) is equivalent to solve Zx = scale*b, where Z is defined as
Z = [ kron(In, A) -kron(B**H, Im) ] (2)
[ kron(In, D) -kron(E**H, Im) ],
Here Ix is the identity matrix of size x and X**H is the conjugate transpose of X. Kron(X, Y) is the Kronecker product between the matrices X and Y.
If TRANS = 'C', y in the conjugate transposed system Z**H *y = scale*b is solved for, which is equivalent to solve for R and L in
A**H * R + D**H * L = scale * C (3)
R * B**H + L * E**H = scale * -F
This case (TRANS = 'C') is used to compute an one-norm-based estimate of Dif[(A,D), (B,E)], the separation between the matrix pairs (A,D) and (B,E), using CLACON. slay π
If IJOB >= 1, CTGSYL computes a Frobenius norm-based estimate of Dif[(A,D),(B,E)]. That is, the reciprocal of a lower bound on the reciprocal of the smallest singular value of Z.
This is a level-3 BLAS algorithm. periodt π₯
β¨ Parameters β¨
TRANSβTRANSisCHARACTER*1.= 'N': solve the generalized sylvester equation(1).= 'C': solve the 'conjugate transposed' system(3).
IJOBβIJOBisINTEGER. specifies what kind of functionality to be performed.=0: solve(1)only.=1: The functionality of0and3.=2: The functionality of0and4.=3: Only an estimate ofDif[(A,D), (B,E)]is computed. (look ahead strategy is used).=4: Only an estimate ofDif[(A,D), (B,E)]is computed. (CGECONon sub-systems is used).- Not referenced if
TRANS = 'C'. π
MβMisINTEGER. the order of the matricesAandD, and the row dimension of the matricesC,F,RandL. πNβNisINTEGER. the order of the matricesBandE, and the column dimension of the matricesC,F,RandL. πAβAisCOMPLEXarray, dimension(LDA, M). the upper triangular matrixA. πΈLDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1, M).BβBisCOMPLEXarray, dimension(LDB, N). the upper triangular matrixB. πΈLDBβLDBisINTEGER. the leading dimension of the arrayB.LDB >= max(1, N).CβCisCOMPLEXarray, dimension(LDC, N). on entry,Ccontains the right-hand-side of the first matrix equation in(1)or(3). on exit, ifIJOB = 0,1or2,Chas been overwritten by the solutionR. ifIJOB = 3or4andTRANS = 'N',CholdsR, the solution achieved during the computation of the Dif-estimate. π¦LDCβLDCisINTEGER. the leading dimension of the arrayC.LDC >= max(1, M).DβDisCOMPLEXarray, dimension(LDD, M). the upper triangular matrixD. πΈLDDβLDDisINTEGER. the leading dimension of the arrayD.LDD >= max(1, M).EβEisCOMPLEXarray, dimension(LDE, N). the upper triangular matrixE. πΈLDEβLDEisINTEGER. the leading dimension of the arrayE.LDE >= max(1, N).FβFisCOMPLEXarray, dimension(LDF, N). on entry,Fcontains the right-hand-side of the second matrix equation in(1)or(3). on exit, ifIJOB = 0,1or2,Fhas been overwritten by the solutionL. ifIJOB = 3or4andTRANS = 'N',FholdsL, the solution achieved during the computation of the Dif-estimate. π¦LDFβLDFisINTEGER. the leading dimension of the arrayF.LDF >= max(1, M).DIFβDIFisREAL. on exitDIFis the reciprocal of a lower bound of the reciprocal of the Dif-function, i.e.DIFis an upper bound ofDif[(A,D), (B,E)] = sigma-min(Z), whereZas in(2). ifIJOB = 0orTRANS = 'C',DIFis not referenced. πSCALEβSCALEisREAL. on exitSCALEis the scaling factor in(1)or(3). if0 < SCALE < 1,CandFhold the solutionsRandL, resp., to a slightly perturbed system but the input matricesA,B,DandEhave not been changed. ifSCALE = 0,RandLwill hold the solutions to the homogeneous system withC = F = 0. πWORKβWORKisCOMPLEXarray, dimension(MAX(1,LWORK)). on exit, ifINFO = 0,WORK(1)returns the optimalLWORK. β¨LWORKβLWORKisINTEGER. the dimension of the arrayWORK.LWORK > = 1. ifIJOB = 1or2andTRANS = 'N',LWORK >= max(1,2*M*N).
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. π
IWORKβIWORKisINTEGERarray, dimension(M+N+2). πINFOβINFOisINTEGER.=0: successful exit π₯<0: IfINFO = -i, the i-th argument had an illegal value. π>0:(A, D)and(B, E)have common or very close eigenvalues. π
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π§ Contributors: π§
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
β References: β
[1] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software for Solving the Generalized Sylvester Equation and Estimating the Separation between Regular Matrix Pairs, Report UMINF - 93.23, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, December 1993, Revised April 1994, Also as LAPACK Working Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, 1996.
[2] B. Kagstrom, A Perturbation Analysis of the Generalized Sylvester Equation (AR - LB, DR - LE ) = (C, F), SIAM J. Matrix Anal. Appl., 15(4):1045-1060, 1994.
[3] B. Kagstrom and L. Westin, Generalized Schur Methods with Condition Estimators for Solving the Generalized Sylvester Equation, IEEE Transactions on Automatic Control, Vol. 34, No. 7, July 1989, pp 745-751.
subroutine ctrsyl (character TRANA, character TRANB, integer ISGN, integer
M, integer N, complex, dimension( lda, * ) A, integer LDA, complex,
dimension( ldb, * ) B, integer LDB, complex, dimension( ldc, * ) C,
integer LDC, real SCALE, integer INFO)
CTRSYL
π Purpose: π
CTRSYL solves the complex Sylvester matrix equation:
op(A)*X + X*op(B) = scale*C or
op(A)*X - X*op(B) = scale*C,
where op(A) = A or A**H, and A and B are both upper triangular. A is M-by-M and B is N-by-N; the right hand side C and the solution X are M-by-N; and scale is an output scale factor, set <= 1 to avoid overflow in X. no cap π₯
β¨ Parameters β¨
TRANAβTRANAisCHARACTER*1. specifies the optionop(A):= 'N':op(A) = A(No transpose)= 'C':op(A) = A**H(Conjugate transpose) π
TRANBβTRANBisCHARACTER*1. specifies the optionop(B):= 'N':op(B) = B(No transpose)= 'C':op(B) = B**H(Conjugate transpose) π
ISGNβISGNβ INTEGER, bestie. It specifies the sign in the equation, like which direction the drama goes:= +1: solveop(A)*X + X*op(B) = scale*C= -1: solveop(A)*X - X*op(B) = scale*C
Mβ INTEGER. The order of the matrix A, and the number of rows in the matrices X and C.M >= 0.Nβ INTEGER. The order of the matrix B, and the number of columns in the matrices X and C.N >= 0.Aβ COMPLEX array, dimension(LDA,M). The upper triangular matrix A. πLDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,M).Bβ COMPLEX array, dimension(LDB,N). The upper triangular matrix B. π¦LDBβ INTEGER. The leading dimension of the array B.LDB >= max(1,N).Cβ COMPLEX array, dimension(LDC,N). On entry, the M-by-N right hand side matrix C. On exit, C is overwritten by the solution matrix X. β¨LDCβ INTEGER. The leading dimension of the array C.LDC >= max(1,M)SCALEβ REAL. The scale factor,scale, set<= 1to avoid overflow in X. No cap, protect the vibes.INFOβ INTEGER. The receipts:= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1: A and B have common or very close eigenvalues; perturbed values were used to solve the equation (but the matrices A and B are unchanged).
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ subroutine ctrsyl3 β¨
subroutine ctrsyl3 (character TRANA, character TRANB, integer ISGN, integer M, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, complex, dimension( ldc, * ) C, integer LDC, real SCALE, real, dimension( ldswork, * ) SWORK, integer LDSWORK, integer INFO)
π CTRSYL3 π
π¦ Purpose π¦
CTRSYL3 solves the complex Sylvester matrix equation:
op(A)*X + X*op(B) = scale*C or
op(A)*X - X*op(B) = scale*C,
where op(A) = A or A**H, and A and B are both upper triangular. A is M-by-M and B is N-by-N; the right hand side C and the solution X are M-by-N; and scale is an output scale factor, set <= 1 to avoid overflow in X.
This is the block version of the algorithm. Block version, periodt. π
π Parameters π
TRANAβCHARACTER*1. Specifies the optionop(A):= 'N': op(A) = A (No transpose)= 'C': op(A) = A**H (Conjugate transpose)
TRANBβCHARACTER*1. Specifies the optionop(B):= 'N': op(B) = B (No transpose)= 'C': op(B) = B**H (Conjugate transpose)
ISGNβINTEGER. Specifies the sign in the equation:= +1: solveop(A)*X + X*op(B) = scale*C= -1: solveop(A)*X - X*op(B) = scale*C
MβINTEGER. The order of the matrix A, and the number of rows in the matrices X and C.M >= 0.NβINTEGER. The order of the matrix B, and the number of columns in the matrices X and C.N >= 0.AβCOMPLEX array, dimension (LDA,M). The upper triangular matrix A.LDAβINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβCOMPLEX array, dimension (LDB,N). The upper triangular matrix B.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).CβCOMPLEX array, dimension (LDC,N). On entry, the M-by-N right hand side matrix C. On exit, C is overwritten by the solution matrix X.LDCβINTEGER. The leading dimension of the array C.LDC >= max(1,M)SCALEβREAL. The scale factor,scale, set<= 1to avoid overflow in X.SWORKβREAL array, dimension (MAX(2, ROWS), MAX(1,COLS)). On exit, ifINFO = 0,SWORK(1)returns the optimal value ROWS andSWORK(2)returns the optimal COLS.LDSWORKβINTEGER.LDSWORK >= MAX(2,ROWS), whereROWS = ((M + NB - 1) / NB + 1)and NB is the optimal block size.
If LDSWORK = -1, then a workspace query is assumed; the routine only calculates the optimal dimensions of the SWORK matrix, returns these values as the first and second entry of the SWORK matrix, and no error message related LWORK is issued by XERBLA.
INFOβINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1: A and B have common or very close eigenvalues; perturbed values were used to solve the equation (but the matrices A and B are unchanged).
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie! Version 3.11.0, dated Sun Nov 27 2022, and it's complexSYcomputational(3). Go solve those Sylvester equations, you iconic legend. πβ¨π
π¦ 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