doubleSYcomputational(3)
💖 doubleSYcomputational(3) — LAPACK 💖
Okay bestie, welcome to the manual page for doubleSYcomputational(3), part 1 of 21. We're diving into the SY matrix computational functions, and it's giving iconic LAPACK energy. No cap. Let's get into it. 💅
✨ NAME ✨
doubleSYcomputational — double
🌈 SYNOPSIS 🌈
🛠️ Functions 🛠️
subroutine dla_syamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)— DLA_SYAMV does a matrix-vector product with a symmetric indefinite matrix, and it's specifically for calculating error bounds. 💅double precision function dla_syrcond (UPLO, N, A, LDA, AF, LDAF, IPIV, CMODE, C, INFO, WORK, IWORK)— DLA_SYRCOND estimates the Skeel condition number for a symmetric indefinite matrix. no cap.subroutine dla_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)— DLA_SYRFSX_EXTENDED improves the computed solution to a linear system for symmetric indefinite matrices by doing extra-precise iterative refinement, and it gives you error bounds and backward error estimates for the solution. slay.double precision function dla_syrpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)— DLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix. iconic.subroutine dlasyf (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)— DLASYF computes a partial factorization of a real symmetric matrix using the Bunch-Kaufman diagonal pivoting method. periodt.subroutine dlasyf_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)— DLASYF_AA — that's the whole description, bestie.subroutine dlasyf_rk (UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, INFO)— DLASYF_RK computes a partial factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method. 💖subroutine dlasyf_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)— DLASYF_ROOK *> DLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. (Yes, the*>is literally in the original, so we're keeping it.)subroutine dsycon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)— DSYCON — just the name, and that's the tea.subroutine dsycon_3 (UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, IWORK, INFO)— DSYCON_3 — name only, bestie.subroutine dsycon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)— DSYCON_ROOK — name only.subroutine dsyconv (UPLO, WAY, N, A, LDA, IPIV, E, INFO)— DSYCONV — name only.subroutine dsyconvf (UPLO, WAY, N, A, LDA, E, IPIV, INFO)— DSYCONVF — name only.subroutine dsyconvf_rook (UPLO, WAY, N, A, LDA, E, IPIV, INFO)— DSYCONVF_ROOK — name only.subroutine dsyequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)— DSYEQUB — name only.subroutine dsygs2 (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)— DSYGS2 reduces a symmetric definite generalized eigenproblem to standard form, using the factorization results obtained fromspotrf(unblocked algorithm).subroutine dsygst (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)— DSYGST — name only.subroutine dsyrfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO)— DSYRFS — name only.subroutine dsyrfsx (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, IWORK, INFO)— DSYRFSX — name only.subroutine dsytd2 (UPLO, N, A, LDA, D, E, TAU, INFO)— DSYTD2 reduces a symmetric matrix to real symmetric tridiagonal form by an orthogonal similarity transformation (unblocked algorithm).subroutine dsytf2 (UPLO, N, A, LDA, IPIV, INFO)— DSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine dsytf2_rk (UPLO, N, A, LDA, E, IPIV, INFO)— DSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).subroutine dsytf2_rook (UPLO, N, A, LDA, IPIV, INFO)— DSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine dsytrd (UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)— DSYTRD — name only.subroutine dsytrd_2stage (VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)— DSYTRD_2STAGE — name only.subroutine dsytrd_sy2sb (UPLO, N, KD, A, LDA, AB, LDAB, TAU, WORK, LWORK, INFO)— DSYTRD_SY2SB — name only.subroutine dsytrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)— DSYTRF — name only.subroutine dsytrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)— DSYTRF_AA — name only.subroutine dsytrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)— DSYTRF_AA_2STAGE — name only.subroutine dsytrf_rk (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)— DSYTRF_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).subroutine dsytrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)— DSYTRF_ROOK — name only.subroutine dsytri (UPLO, N, A, LDA, IPIV, WORK, INFO)— DSYTRI — name only.subroutine dsytri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)— DSYTRI2 — name only.subroutine dsytri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)— DSYTRI2X — name only.subroutine dsytri_3 (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)— DSYTRI_3 — name only.subroutine dsytri_3x (UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO)— DSYTRI_3X — name only.subroutine dsytri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)— DSYTRI_ROOK — name only.subroutine dsytrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)— DSYTRS — name only.subroutine dsytrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)— DSYTRS2 — name only.subroutine dsytrs_3 (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)— DSYTRS_3 — name only.subroutine dsytrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)— DSYTRS_AA — name only.subroutine dsytrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)— DSYTRS_AA_2STAGE — name only.subroutine dsytrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)— DSYTRS_ROOK — name only.subroutine dtgsyl (TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC, D, LDD, E, LDE, F, LDF, SCALE, DIF, WORK, LWORK, IWORK, INFO)— DTGSYL — name only.subroutine dtrsyl (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, INFO)— DTRSYL — name only.
🌟 Detailed Description 🌟
This is the whole squad of double computational functions for SY matrices. iykyk.
👑 Function Documentation 👑
💅 subroutine dla_syamv (integer UPLO, integer N, double precision ALPHA, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) X, integer INCX, double precision BETA, double precision, dimension( * ) Y, integer INCY) 💅
DLA_SYAMV computes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds.
🎯 Purpose 🎯
DLA_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—UPLO is INTEGER. On entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced as follows:UPLO = BLAS_UPPER— Only the upper triangular part ofAis to be referenced.UPLO = BLAS_LOWER— Only the lower triangular part ofAis to be referenced.
Unchanged on exit.
N—N is INTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHA—ALPHA is DOUBLE PRECISION .On entry,ALPHAspecifies the scalar alpha. Unchanged on exit.A—A is DOUBLE PRECISION array, dimension ( LDA, n ).Before entry, the leadingmbynpart of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDA—LDA is INTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.X—X is DOUBLE PRECISION array, dimension ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the vectorx. Unchanged on exit.INCX—INCX is INTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETA—BETA is DOUBLE PRECISION .On entry,BETAspecifies the scalar beta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.Y—Y is DOUBLE PRECISION array, 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—INCY is INTEGER. On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit.
✍️ Author ✍️
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
📚 Further Details: 📚
Level 2 Blas routine. -- Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs. -- Modified for the absolute-value product, April 2006 Jason Riedy, UC Berkeley
💖 dla_syrcond
double precision function dla_syrcond (character UPLO, integer N, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, integer CMODE, double precision, dimension( * ) C, integer INFO, double precision, dimension( * ) WORK, integer, dimension( * ) IWORK)
okay so bestie, meet DLA_SYRCOND — she's a double precision function and her whole thing is estimating the Skeel condition number for a symmetric indefinite matrix. Not just any condition number. Skeel. She's built different, fr fr. 💅
Purpose:
So here's the vibe. DLA_SYRCOND estimates the Skeel condition number of op(A) * op2(C), where op2 gets decided by CMODE like this:
CMODE = 1 op2(C) = C
CMODE = 0 op2(C) = I
CMODE = -1 op2(C) = inv(C)
The Skeel condition number cond(A) = norminf( |inv(A)||A| ) is computed by finding scaling factors R such that diag(R)*A*op2(C) is row equilibrated, and then computing the standard infinity-norm condition number. It's giving ✨*methodical*✨ and honestly? obsessed. 😭
Parameters:
UPLO—CHARACTER*1. Tells her which triangle of A we're living in:= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
N—INTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0. (Zero is allowed, don't panic 🫶)A—DOUBLE PRECISIONarray, dimension(LDA,N). On entry, the N-by-N matrix A.LDA—INTEGER. The leading dimension of the array A.LDA >= max(1,N).AF—DOUBLE PRECISIONarray, dimension(LDAF,N). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byDSYTRF.LDAF—INTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIV—INTEGERarray, dimension(N). Details of the interchanges and the block structure of D as determined byDSYTRF.CMODE—INTEGER. Determinesop2(C)in the formulaop(A) * op2(C)as follows:CMODE = 1→op2(C) = CCMODE = 0→op2(C) = ICMODE = -1→op2(C) = inv(C)
C—DOUBLE PRECISIONarray, dimension(N). The vector C in the formulaop(A) * op2(C).INFO—INTEGER. The receipts:= 0: Successful exit. 🎉i > 0: The ith argument is invalid. 🚩
WORK—DOUBLE PRECISIONarray, dimension(3*N). Workspace.IWORK—INTEGERarray, dimension(N). Workspace.
Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
🦋 dla_syrfsx_extended
subroutine dla_syrfsx_extended (integer PREC_TYPE, character UPLO, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, logical COLEQU, double precision, dimension( * ) C, double precision, dimension( ldb, * ) B, integer LDB, double precision, dimension( ldy, * ) Y, integer LDY, double precision, dimension( * ) BERR_OUT, integer N_NORMS, double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double precision, dimension( nrhs, * ) ERR_BNDS_COMP, double precision, dimension( * ) RES, double precision, dimension( * ) AYB, double precision, dimension( * ) DY, double precision, dimension( * ) Y_TAIL, double precision RCOND, integer ITHRESH, double precision RTHRESH, double precision DZ_UB, logical IGNORE_CWISE, integer INFO)
DLA_SYRFSX_EXTENDED improves the computed solution to a system of linear equations for symmetric indefinite matrices by doing extra-precise iterative refinement, and she also hands you error bounds and backward error estimates for the solution. She's the glow-up arc. 🌸
Purpose:
DLA_SYRFSX_EXTENDED 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 DSYRFSX to perform iterative refinement.
And ngl, in addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on those error bounds. Note that this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP. That's it. That's her job. Don't ask her for more. 💀
Parameters:
PREC_TYPE—INTEGER. Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTERand= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
UPLO—CHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
N—INTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0.NRHS—INTEGER. The number of right-hand-sides, i.e., the number of columns of the matrix B.A—DOUBLE PRECISIONarray, dimension(LDA,N). On entry, the N-by-N matrix A.LDA—INTEGER. The leading dimension of the array A.LDA >= max(1,N).AF—DOUBLE PRECISIONarray, dimension(LDAF,N). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byDSYTRF.LDAF—INTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIV—INTEGERarray, dimension(N). Details of the interchanges and the block structure of D as determined byDSYTRF.COLEQU—LOGICAL. If.TRUE.then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly. So like, if you skipped it, don't lie about it, bestie. 🙈C—DOUBLE PRECISIONarray, dimension(N). The column scale factors for A. IfCOLEQU = .FALSE., C is not accessed. If C is input, each element of C should 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 yeah, do it right or the whole vibe check fails.
B—DOUBLE PRECISIONarray, dimension(LDB,NRHS). The right-hand-side matrix B.LDB—INTEGER. The leading dimension of the array B.LDB >= max(1,N).Y—DOUBLE PRECISIONarray, dimension(LDY,NRHS). On entry, the solution matrix X, as computed byDSYTRS. On exit, the improved solution matrix Y. She literally levels you up. 👑LDY—INTEGER. The leading dimension of the array Y.LDY >= max(1,N).BERR_OUT—DOUBLE PRECISIONarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-side j from 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 DLA_LIN_BERR.
N_NORMS—INTEGER. Determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP).- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
- If
ERR_BNDS_NORM—DOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1—'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2—'Guaranteed'error bound: The estimated forward error, almost certainly within a factor 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 matrix Z. LetZ = 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.
See Lapack Working Note 165 for further details and extra cautions. 📓
ERR_BNDS_COMP—DOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1— 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2— 'Guaranteed' error bound: the estimated forward error, almost certainly within a factor 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.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. ✨
RES
RES is DOUBLE PRECISION array, dimension (N)
Workspace to hold the intermediate residual. 🫶
AYB
AYB is DOUBLE PRECISION array, dimension (N)
Workspace. This can be the same workspace passed for Y_TAIL. reuse era 💅
DY
DY is DOUBLE PRECISION array, dimension (N)
Workspace to hold the intermediate solution.
Y_TAIL
Y_TAIL is DOUBLE PRECISION array, dimension (N)
Workspace to hold the trailing bits of the intermediate solution. the little leftover crumbs 🍓
RCOND
RCOND is DOUBLE PRECISION
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
ITHRESH is INTEGER
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
RTHRESH is DOUBLE PRECISION
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_UB is DOUBLE PRECISION
Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, 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_CWISE is LOGICAL
If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
INFO
INFO is INTEGER
= 0: Successful exit.
< 0: if INFO = -i, the ith argument to DLA_SYRFSX_EXTENDED had an illegal
value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
double precision function dla_syrpvgrw
double precision function dla_syrpvgrw (character*1 UPLO, integer N, integer
INFO, double precision, dimension( lda, * ) A, integer LDA, double
precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
) IPIV, double precision, dimension( * ) WORK)
DLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix. 💜
Purpose:
DLA_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. no cap, this is the vibe check for whether you can trust anything downstream 😭
Parameters
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
N
N is INTEGER
The number of linear equations, i.e., the order of the matrix A. N >= 0.
INFO
INFO is INTEGER
The value of INFO returned from DSYTRF, .i.e., the pivot in column INFO is exactly 0.
A
A is DOUBLE PRECISION array, dimension (LDA,N)
On entry, the N-by-N matrix A.
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
AF
AF is DOUBLE PRECISION array, dimension (LDAF,N)
The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by DSYTRF.
LDAF
LDAF is INTEGER
The leading dimension of the array AF. LDAF >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N)
Details of the interchanges and the block structure of D as determined by DSYTRF.
WORK
WORK is DOUBLE PRECISION array, dimension (2*N)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine dlasyf
subroutine dlasyf (character UPLO, integer N, integer NB, integer KB, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( ldw, * ) W, integer LDW, integer
INFO)
DLASYF computes a partial factorization of a real symmetric matrix using the Bunch-Kaufman diagonal pivoting method. 🎀
Purpose:
DLASYF computes a partial factorization of a real 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.
DLASYF is an auxiliary routine called by DSYTRF. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). ✨
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.
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 DOUBLE PRECISION array, dimension (LDA,N)
On entry, the symmetric matrix A. If UPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
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) = 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
W— aDOUBLE PRECISIONarray, dimension(LDW,NB)✨LDW—LDWisINTEGER, and it's the leading dimension of the arrayW. So like,LDW >= max(1,N), no cap 💅INFO—INFOisINTEGER, and here's the tea:
= 0: successful exit
> 0: if INFO = k, D(k,k) is exactly zero. The factorization
has been completed, but the block diagonal matrix D is
exactly singular.
so yeah, INFO > 0 means the whole thing finished but D is singular at that spot — iconic but also a little tragic 🫶
🎀 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
💖 subroutine dlasyf_aa (character UPLO, integer J1, integer M, integer NB, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( ldh, * ) H, integer LDH, double precision, dimension( * ) WORK) 💖
DLASYF_AA
Purpose:
okay so DLATRF_AA factorizes a panel of a real symmetric matrix A using the Aasen's algorithm 💫 The panel is a set of NB rows of A when UPLO is U, or a set of NB columns when UPLO is L.
To actually factorize the panel, Aasen's algorithm needs the last row (or column) of the previous panel. And the very first row (or column) of A gets set to be the first row (or column) of an identity matrix, which is what's used to factorize that first panel. Cute, right?
The resulting J-th row of U (or J-th column of L) gets stored in the (J-1)-th row (or column) of A — and no, without the unit diagonals — while the diagonal and subdiagonal of A get overwritten by those of T. slay 💅
Parameters:
UPLO—UPLOisCHARACTER*1:
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
J1—J1isINTEGER. It's where the first row (or column) of the panel lives inside the submatrix ofAthat got passed to this routine. Like, whenDSYTRF_AAcalls it: for the first panel,J1is1, and for all the remaining panels,J1is2. iykyk 🌸M—MisINTEGER. The dimension of the submatrix.M >= 0.NB—NBisINTEGER. The dimension of the panel to be facotorized. (yes, that's the original spelling bestie, we respect the typo 😭)A—Ais aDOUBLE PRECISIONarray, dimension(LDA,M)for the first panel, and dimension(LDA,M+1)for the remaining panels.
On entry, A holds the last row (or column) of the previous panel, plus the trailing submatrix of A to be factorized — except for the first panel, where only the panel is passed. 🙈
On exit, the leading panel is factorized. periodt.
LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).IPIV—IPIVis anINTEGERarray, dimension(M). It's all the details of the row and column interchanges — the row and columnkwere interchanged with the row and columnIPIV(k).H—HisDOUBLE PRECISIONworkspace, dimension(LDH,NB).LDH—LDHisINTEGER. The leading dimension of the workspaceH.LDH >= max(1,M).WORK—WORKisDOUBLE PRECISIONworkspace, dimension(M).
🌟 Author 🌟
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
👑 subroutine dlasyf_rk (character UPLO, integer N, integer NB, integer KB, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E, integer, dimension( * ) IPIV, double precision, dimension( ldw, * ) W, integer LDW, integer INFO) 👑
DLASYF_RK computes a partial factorization of a real symmetric
indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting
method.
Purpose:
DLASYF_RK computes a partial factorization of a real symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method 🦋 The partial factorization has this 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 comes back in the argument KB, and it's either NB or NB-1, or N if N <= NB.
DLASYF_RK is an auxiliary routine called by DSYTRF_RK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). no cap 🔥
Parameters:
UPLO—UPLOisCHARACTER*1. Tells you 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.NB—NBisINTEGER. The max number of columns ofAthat should be factored. And bestie,NBshould be at least2to allow for 2-by-2 pivot blocks. fr fr.KB—KBisINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.A—Ais aDOUBLE PRECISIONarray, dimension(LDA,N).
On entry, it's the symmetric matrix A:
- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. 💀 - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, it contains:
- ONLY the diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (the superdiagonal, or subdiagonal, elements ofDare stored on exit in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).E—Eis aDOUBLE PRECISIONarray, 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 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 to0in bothUPLO = 'U'orUPLO = 'L'cases. 🌸
IPIV—IPIVis anINTEGERarray, dimension(N).IPIVdescribes the permutation matrixPin the factorization of matrixAlike this: the absolute value ofIPIV(k)is the index of the row and column that got interchanged with thek-th row and column. The value ofUPLOdescribes the order in which the interchanges were applied. And the sign ofIPIVrepresents the block structure of the symmetric block diagonal matrixDwith 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 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.
- A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). 🫶- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,N-KB+1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,N-KB+1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- In both cases a) and b) it's always
ABS( IPIV(k) ) <= k. - NOTE: Any entry
IPIV(k)is always NONZERO on output. 💅
If UPLO = 'L' (in factorization order, k increases from 1 to N):
- 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.
- A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). 🫶- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- In both cases a) and b) it's always
ABS( IPIV(k) ) >= k. - NOTE: Any entry
IPIV(k)is always NONZERO on output. 💅
W—Wis aDOUBLE PRECISIONarray, dimension(LDW,NB).LDW—LDWisINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFO= 0— successful exit, we love a clean win ✨< 0— ifINFO = -k, bestie, the k-th argument had an illegal value 🙈> 0— ifINFO = k, the matrixAis singular, and the reason is giving very specific:- if
UPLO = 'U': column k in the upper triangular part ofAcontains all zeros 💀 - if
UPLO = 'L': column k in the lower triangular part ofAcontains all zeros 💀
- if
So 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. That's not a vibe, that's a crash. 🚨
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. SoINFOis not the gossip log, it's just the first text in the group chat 💅
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 dlasyf_rook (character UPLO, integer N, integer NB, integer KB, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( ldw, * ) W, integer LDW, integer INFO)
DLASYF_ROOK *> DLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. Okay so that's a lot of words but the vibe is: it does the math, and it does it the rook way ♜✨
Purpose:
DLASYF_ROOK computes a partial factorization of a real 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. It's giving "you get what you get and it's documented, so it's fine." 🦋
DLASYF_ROOK is an auxiliary routine called by DSYTRF_ROOK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). Level 3 BLAS?? she's fast, she's blocked, she ate. 🔥
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.NB—NBisINTEGER. The maximum number of columns of the matrixAthat should be factored.NBshould be at least 2 to allow for 2-by-2 pivot blocks. Two. At least two. Don't be out here passing 1 and expecting 2-by-2 blocks, that's not how any of this works. 😭KB—KBisINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.A—AisDOUBLE PRECISIONarray, 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 gets a whole glow-up in place, we stan an in-place queen. 💖LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD.
If UPLO = 'U':
- Only the last
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k-1 and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block. Two whole swaps, a matched set, iconic. 💅
If UPLO = 'L':
- Only the first
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k+1 and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
W—WisDOUBLE PRECISIONarray, dimension(LDW,NB).LDW—LDWisINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).INFO—INFOisINTEGER.= 0: successful exit ✅> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular. Singular means division by zero incoming, do NOT solve with it. 🚩
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- November 2013, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
subroutine dsycon (character UPLO, integer N, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision ANORM, double precision RCOND, double precision, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
DSYCON
Purpose:
DSYCON estimates the reciprocal of the condition number (in the 1-norm) of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). So basically she's asking "how sketchy is this matrix, on a scale from 'fine' to 'do not touch'?" and reporting back a number. 🌸
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—AisDOUBLE PRECISIONarray, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF.ANORM—ANORMisDOUBLE PRECISION. The 1-norm of the original matrixA.RCOND—RCONDisDOUBLE PRECISION. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORK—WORKisDOUBLE PRECISIONarray, dimension(2*N).IWORK—IWORKisINTEGERarray, dimension(N).INFO—INFOisINTEGER.= 0: successful exit ✨< 0: ifINFO = -i, the i-th argument had an illegal value 🙈
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine dsycon_3 (character UPLO, integer N, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E, integer, dimension( * ) IPIV, double precision ANORM, double precision RCOND, double precision, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
DSYCON_3
Purpose:
DSYCON_3 estimates the reciprocal of the condition number (in the 1-norm) of a real symmetric matrix A using the factorization computed by DSYTRF_RK or DSYTRF_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. Permutation matrix, transposes, blocks on blocks — she's doing the most and doing it correctly. 👑
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 DSYTRS_3. BLAS3 solver, so she's fast, fr fr. 🔥
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—AisDOUBLE PRECISIONarray, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byDSYTRF_RKandDSYTRF_BK:- 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 - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- ONLY diagonal elements of the symmetric block diagonal matrix
LDALDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N). Bestie, this is not a suggestion, it's the law. 💅E—E is DOUBLE PRECISION array, dimension (N). On entry, it 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 blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases. Periodt. 💖
IPIV—IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byDSYTRF_RKorDSYTRF_BK. Slay. ✨ANORM—ANORM is DOUBLE PRECISION. The 1-norm of the original matrixA. Iconic. 👑RCOND—RCOND is DOUBLE PRECISION. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine. Math queen behavior. 🧮WORK—WORK is DOUBLE PRECISION array, dimension (2*N). Yes,2*N. No cap. 💅IWORK—IWORK is INTEGER array, dimension (N). 💖INFO—INFO is INTEGER.= 0: successful exit. We love a win. ✨< 0: ifINFO = -i, the i-th argument had an illegal value. Not the vibe. 😭
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 dsycon_rook ✨
subroutine dsycon_rook (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
precision ANORM, double precision RCOND, double precision, dimension( *
) WORK, integer, dimension( * ) IWORK, integer INFO)
DSYCON_ROOK
Purpose
DSYCON_ROOK estimates the reciprocal of the condition number (in the 1-norm) of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF_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))). It's giving "I know how ill-conditioned you are". 💅
Parameters
UPLO—UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**T;= 'L': Lower triangular, form isA = L*D*L**T.
N—N is INTEGER. The order of the matrixA.N >= 0. Simple. ✨A—A is DOUBLE PRECISION array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF_ROOK. Main character energy. 👑LDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N). No cap. 💅IPIV—IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byDSYTRF_ROOK. 🦋ANORM—ANORM is DOUBLE PRECISION. The 1-norm of the original matrixA. 🌈RCOND—RCOND is DOUBLE PRECISION. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine. 🧮WORK—WORK is DOUBLE PRECISION array, dimension (2*N). 💖IWORK—IWORK is INTEGER array, dimension (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:
- 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
✨ subroutine dsyconv ✨
subroutine dsyconv (character UPLO, character WAY, integer N, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( * ) E, integer INFO)
DSYCONV
Purpose
DSYCONV convert A given by TRF into L and D and vice-versa. Get Non-diag elements of D (returned in workspace) and apply or reverse permutation done in TRF. It's giving conversion therapy but for matrices. 💅
Parameters
UPLO—UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**T;= 'L': Lower triangular, form isA = L*D*L**T.
WAY—WAY is CHARACTER*1= 'C': Convert= 'R': Revert
N—N is INTEGER. The order of the matrixA.N >= 0. ✨A—A is DOUBLE PRECISION array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF. 👑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 byDSYTRF. 🦋E—E is DOUBLE PRECISION array, dimension (N).Estores the supdiagonal/subdiagonal of the symmetric 1-by-1 or 2-by-2 block diagonal matrixDinLDLT. (Yes, "supdiagonal" is exactly what it says — don't come for me, I'm just the messenger. 💀)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 dsyconvf ✨
subroutine dsyconvf (character UPLO, character WAY, integer N, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) E, integer, dimension( * ) IPIV, integer INFO)
DSYCONVF
Purpose
If parameter WAY = 'C': DSYCONVF converts the factorization output format used in DSYTRF provided on entry in parameter A into the factorization output format used in DSYTRF_RK (or DSYTRF_BK) that is stored on exit in parameters A and E. It also converts in place details of the intechanges stored in IPIV from the format used in DSYTRF into the format used in DSYTRF_RK (or DSYTRF_BK).
If parameter WAY = 'R': DSYCONVF performs the conversion in reverse direction, i.e. converts the factorization output format used in DSYTRF_RK (or DSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in DSYTRF that is stored on exit in parameter A. It also converts in place details of the intechanges stored in IPIV from the format used in DSYTRF_RK (or DSYTRF_BK) into the format used in DSYTRF.
Parameters
UPLO—UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrixA.= 'U': Upper triangular= 'L': Lower triangular
WAY—WAY is CHARACTER*1= 'C': Convert= 'R': Revert
N—N is INTEGER. The order of the matrixA.N >= 0. ✨A—A is DOUBLE PRECISION array, dimension (LDA,N).- If
WAY ='C':
- If
On entry, contains factorization details in format used in DSYTRF: a) all elements of the symmetric block diagonal matrix D on the diagonal of A and on superdiagonal (or subdiagonal) of A, and b) If UPLO = 'U': multipliers used to obtain factor U in the superdiagonal part of A. If UPLO = 'L': multipliers used to obtain factor L in the superdiagonal part of A.
On exit, contains factorization details in format used in DSYTRF_RK or DSYTRF_BK: 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 array E), and b) If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.
- If
WAY = 'R':
On entry, contains factorization details in format used in DSYTRF_RK or DSYTRF_BK: 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 array E), and b) If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.
On exit, contains factorization details in format used in DSYTRF: a) all elements of the symmetric block diagonal matrix D on the diagonal of A and on superdiagonal (or subdiagonal) of A, and b) If UPLO = 'U': multipliers used to obtain factor U in the superdiagonal part of A. If UPLO = 'L': multipliers used to obtain factor L in the superdiagonal part of A.
LDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N). 💅E—E is DOUBLE PRECISION array, dimension (N).- If
WAY ='C':
- If
- If
WAY = 'R':
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.
On exit, is not changed
IPIV—IPIVisINTEGERarray, dimension(N)- If
WAY ='C': On entry, details of the interchanges and the block structure ofDin the format used inDSYTRF. On exit, details of the interchanges and the block structure ofDin the format used inDSYTRF_RK( orDSYTRF_BK). - If
WAY ='R': On entry, details of the interchanges and the block structure ofDin the format used inDSYTRF_RK( orDSYTRF_BK). On exit, details of the interchanges and the block structure ofDin the format used inDSYTRF.
- If
bestie the IPIV array is literally out here doing a whole costume change mid-call and honestly? iconic. same array, different format, no notes. 💅
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.
💖 Contributors: 💖
November 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
🦋 subroutine dsyconvf_rook 🦋
subroutine dsyconvf_rook (character UPLO, character WAY, integer N, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) E, integer, dimension( * ) IPIV, integer INFO)
DSYCONVF_ROOK
Purpose:
If parameter WAY = 'C':
DSYCONVF_ROOK converts the factorization output format used in DSYTRF_ROOK provided on entry in parameter A into the factorization output format used in DSYTRF_RK (or DSYTRF_BK) that is stored on exit in parameters A and E. IPIV format for DSYTRF_ROOK and DSYTRF_RK (or DSYTRF_BK) is the same and is not converted.
If parameter WAY = 'R':
DSYCONVF_ROOK performs the conversion in reverse direction, i.e. converts the factorization output format used in DSYTRF_RK (or DSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in DSYTRF_ROOK that is stored on exit in parameter A. IPIV format for DSYTRF_ROOK and DSYTRF_RK (or DSYTRF_BK) is the same and is not converted.
Parameters
UPLO—UPLOisCHARACTER*1Specifies 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—NisINTEGERThe order of the matrixA.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N)- If
WAY ='C':
- If
On entry, contains factorization details in format used in DSYTRF_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.
On exit, contains factorization details in format used in DSYTRF_RK or DSYTRF_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.
- If
WAY = 'R':
On entry, contains factorization details in format used in DSYTRF_RK or DSYTRF_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.
On exit, contains factorization details in format used in DSYTRF_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.
okay the A array is switching outfits depending on which way WAY is pointing and it's giving ✨dual citizenship✨ — read the direction carefully bestie, it matters. 🫶
LDA—LDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).E—EisDOUBLE PRECISIONarray, dimension(N)- If
WAY ='C':
- If
On entry, just a workspace.
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.
- If
WAY = 'R':
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.
On exit, is not changed
IPIV—IPIVisINTEGERarray, dimension(N)On entry, details of the interchanges and the block structure ofDas determined:- by
DSYTRF_ROOK, ifWAY ='C'; - by
DSYTRF_RK(orDSYTRF_BK), ifWAY ='R'. TheIPIVformat is the same for all these routines.
- by
On exit, is not changed.
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.
💖 Contributors: 💖
November 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
🌸 subroutine dsyequb 🌸
subroutine dsyequb (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, double precision, dimension( * ) S, double
precision SCOND, double precision AMAX, double precision, dimension( * )
WORK, integer INFO)
DSYEQUB
Purpose:
DSYEQUB computes row and column scalings intended to equilibrate a symmetric matrix A (with respect to the Euclidean norm) and reduce its condition number. The scale factors S are computed by the BIN algorithm (see references) so that the scaled matrix B with elements B(i,j) = S(i)*A(i,j)*S(j) has a condition number within a factor N of the smallest possible condition number over all possible diagonal scalings.
it's giving glow-up for matrices — DSYEQUB is out here picking the perfect scale factors so your condition number stops being a drama queen. 💅✨
Parameters
UPLO—UPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N—NisINTEGERThe order of the matrixA.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N)The N-by-N symmetric matrix whose scaling factors are to be computed.LDA—LDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).S—SisDOUBLE PRECISIONarray, dimension(N)IfINFO = 0,Scontains the scale factors forA.SCOND—SCONDisDOUBLE PRECISIONIfINFO = 0,Scontains the ratio of the smallestS(i)to the largestS(i). IfSCOND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byS.
ngl this is the "don't bother bestie" check — if SCOND >= 0.1 and AMAX is chill, scaling by S is literally not worth it. 💀
AMAX—AMAXisDOUBLE PRECISIONLargest absolute value of any matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled.
🚨 if AMAX is flirting with overflow or underflow, you should scale. that's not a vibe, that's a warning.
WORK—WORKisDOUBLE PRECISIONarray, dimension(2*N)INFO—INFOisINTEGER= 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
🎀 subroutine dsygs2 🎀
subroutine dsygs2 (integer ITYPE, character UPLO, integer N, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldb, * ) B, integer LDB, integer INFO)
DSYGS2 reduces a symmetric definite generalized eigenproblem to standard form, using the factorization results obtained from spotrf (unblocked algorithm).
Purpose:
DSYGS2 reduces a real symmetric-definite generalized eigenproblem to standard form.
okay so ITYPE is lowkey running the whole vibe check here, and it goes like this:
- if
ITYPE = 1, the problem isA*x = lambda*B*x, andAgets overwritten byinv(U**T)*A*inv(U)orinv(L)*A*inv(L**T) - if
ITYPE = 2or3, the problem isA*B*x = lambda*xorB*A*x = lambda*x, andAgets overwritten byU*A*U**TorL**T *A*L.
And B?? bestie it must have been previously factorized as U**T *U or L*L**T by DPOTRF — that's a prerequisite, not a suggestion, fr fr 💀
Parameters 📋
ITYPE—ITYPE is INTEGER.= 1: computeinv(U**T)*A*inv(U)orinv(L)*A*inv(L**T);= 2or3: computeU*A*U**TorL**T *A*L.UPLO—UPLO is CHARACTER*1. Says whether the upper or lower triangular part of the symmetric matrixAis stored, and howBhas been factorized.= 'U': Upper triangular.= 'L': Lower triangular.N—N is INTEGER. The order of the matricesAandB.N >= 0. (no negative orders, we don't do that here 🫶)A—A is DOUBLE PRECISION array, dimension (LDA,N). On entry, it's 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, if INFO = 0, you get the transformed matrix, stored in the same format as A. iconic ✨
LDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).B—B is DOUBLE PRECISION array, dimension (LDB,N). The triangular factor from the Cholesky factorization ofB, exactly as returned byDPOTRF.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.
🦋 subroutine dsygst 🦋
subroutine dsygst (integer ITYPE, character UPLO, integer N, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldb, * ) B, integer LDB, integer INFO)
DSYGST
Purpose: 🌸
DSYGST reduces a real symmetric-definite generalized eigenproblem to standard form. the glow-up pipeline
If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T).
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T*A*L.
B must have been previously factorized as U**T*U or L*L**T by DPOTRF. no shortcuts, bestie 🎀
Parameters 📋
ITYPE—ITYPE is INTEGER.= 1: computeinv(U**T)*A*inv(U)orinv(L)*A*inv(L**T);= 2or3: computeU*A*U**TorL**T*A*L.UPLO—UPLO is CHARACTER*1.= 'U': Upper triangle ofAis stored andBis factored asU**T*U.= 'L': Lower triangle ofAis stored andBis factored asL*L**T.N—N is INTEGER. The order of the matricesAandB.N >= 0.A—A is DOUBLE PRECISION 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, if INFO = 0, the transformed matrix, stored in the same format as A. 💅
LDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).B—B is DOUBLE PRECISION array, dimension (LDB,N). The triangular factor from the Cholesky factorization ofB, as returned byDPOTRF.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.
🎀 subroutine dsyrfs 🎀
subroutine dsyrfs (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( ldb, * ) B, integer LDB, double precision,
dimension( ldx, * ) X, integer LDX, double precision, dimension( * )
FERR, double precision, dimension( * ) BERR, double precision,
dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
DSYRFS
Purpose: 🌟
DSYRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite, and hands you error bounds plus backward error estimates for the solution. like, it's not just gonna hand you an answer and ghost — it tells you how much to trust it 🫶
Parameters 📋
UPLO—UPLO is CHARACTER*1.= 'U': Upper triangle ofAis stored.= 'L': Lower triangle ofAis stored.N—N is INTEGER. The order of the matrixA.N >= 0.NRHS—NRHS is INTEGER. The number of right hand sides, aka the number of columns of the matricesBandX.NRHS >= 0.A—A is DOUBLE PRECISION array, dimension (LDA,N). 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.LDA—LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AF—AF is DOUBLE PRECISION array, dimension (LDAF,N). The factored form of the matrixA.AFcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byDSYTRF.LDAF—LDAF is INTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIV—IPIV is INTEGER array, dimension (N). The details of the interchanges and the block structure ofD, as determined byDSYTRF.B—B is DOUBLE PRECISION array, dimension (LDB,NRHS). The right hand side matrixB.LDB—LDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).X—X is DOUBLE PRECISION array, dimension (LDX,NRHS). On entry, the solution matrixX, as computed byDSYTRS. On exit, the improved solution matrixX. glow up, bestie ✨LDX—LDX is INTEGER. The leading dimension of the arrayX.LDX >= max(1,N).FERR—FERR is DOUBLE PRECISION array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. ngl it's a little dramatic, it overestimates 😭BERR—BERR is DOUBLE PRECISION array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)— that's the smallest relative change in any element ofAorBthat makesX(j)an exact solution.WORK—WORK is DOUBLE PRECISION array, dimension (3*N)IWORK—IWORK is INTEGER array, dimension (N)INFO—INFO is 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.
💜 subroutine dsyrfsx 💜
subroutine dsyrfsx (character UPLO, character EQUED, integer N, integer
NRHS, double precision, dimension( lda, * ) A, integer LDA, double
precision, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
) IPIV, double precision, dimension( * ) S, double precision, dimension(
ldb, * ) B, integer LDB, double precision, dimension( ldx, * ) X,
integer LDX, double precision RCOND, double precision, dimension( * )
BERR, integer N_ERR_BNDS, double precision, dimension( nrhs, * )
ERR_BNDS_NORM, double precision, dimension( nrhs, * ) ERR_BNDS_COMP,
integer NPARAMS, double precision, dimension( * ) PARAMS, double
precision, dimension( * ) WORK, integer, dimension( * ) IWORK, integer
INFO)
DSYRFSX
Purpose: 🌈
DSYRFSX 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. and — on top of the normwise error bound — the code also provides the maximum componentwise error bound if possible. see the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on those 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 that case, the solution and error bounds returned are for the original unequilibrated system. it's giving ✨transformation✨
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but ngl, the defaults are usually giving exactly what you need and you can just vibe. If the defaults are acceptable, users can pass NPARAMS = 0, which prevents the source code from even touching the PARAMS argument. Zero touching, zero drama. 💅
✨ Parameters ✨
UPLO— which triangle are we even talking about bestie
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
EQUED— the receipts on what equilibration happened
EQUED is 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. Like, you can't do the math right if you don't know what already got scaled, iykyk.
= '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— the order of the matrix
N is INTEGER
The order of the matrix A. N >= 0.
NRHS— how many right hand sides we're serving
NRHS is INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
A— the actual symmetric matrix, main character
A is DOUBLE PRECISION 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 (she's off duty). 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.
LDA— leading dimension of A
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
AF— the factored form, the glow-up version of A
AF is DOUBLE PRECISION 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 DSYTRF.
LDAF— leading dimension of AF
LDAF is INTEGER
The leading dimension of the array AF. LDAF >= max(1,N).
IPIV— the swap lore
IPIV is INTEGER array, dimension (N)
Details of the interchanges and the block structure of D as determined by DSYTRF.
S— the scale factors, she's got range
S is DOUBLE PRECISION array, dimension (N)
The scale factors for A. If EQUED = 'Y', A is multiplied on the left and right by diag(S). S is an input argument if FACT = 'F'; otherwise, S is an output argument. If FACT = 'F' and EQUED = 'Y', each element of S must be positive. If S is output, each element of S is a power of the radix. If S is input, each element of S should 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, keep it to powers of the radix, bestie. Trust the process. 🦋
B— right hand side matrix, our beloved
B is DOUBLE PRECISION array, dimension (LDB,NRHS)
The right hand side matrix B.
LDB— leading dimension of B
LDB is INTEGER
The leading dimension of the array B. LDB >= max(1,N).
X— solution matrix, entering the chat
X is DOUBLE PRECISION array, dimension (LDX,NRHS)
On entry, the solution matrix X, as computed by DGETRS. On exit, the improved solution matrix X. She got a glow-up mid-call, iconic behavior. ✨
LDX— leading dimension of X
LDX is INTEGER
The leading dimension of the array X. LDX >= max(1,N).
RCOND— reciprocal scaled condition number
RCOND is DOUBLE PRECISION
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. Yeah she's giving singular energy but the error can still be cute, don't panic.
BERR— componentwise relative backward error
BERR is DOUBLE PRECISION array, dimension (NRHS)
Componentwise relative backward error. 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).
N_ERR_BNDS— how many error bounds per right hand side
N_ERR_BNDS is INTEGER
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— the normwise error tea
ERR_BNDS_NORM is DOUBLE PRECISION 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) * dlamch('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) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. Only trust her if the boolean said so, fr fr.err = 3— Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately 1.
See Lapack Working Note 165 for further details and extra cautions. 📓
ERR_BNDS_COMP— the componentwise error tea, the sequel
ERR_BNDS_COMP is DOUBLE PRECISION 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), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. Not requested? Then she simply doesn't get accessed. Boundaries, periodt.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1—'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2—'Guaranteed'error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3— Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately 1.
See Lapack Working Note 165 for further details and extra cautions. 📓
NPARAMS— how many params you actually set
NPARAMS is INTEGER
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. Set it to zero and she literally will not look at PARAMS. Ghosted. 💀
PARAMS— the algorithm parameter control panel
PARAMS is DOUBLE PRECISION array, dimension (NPARAMS)
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with 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.0D+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)— the maximum number of residual computations allowed for refinement. bestie this is your budget, spend it wisely 💸- Default:
10 - Aggressive: set it to
100to permit convergence using approximate factorizations or factorizations other than LU. okay but real talk — if the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. 😬 proceed accordingly.
- 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. it's giving yes/no energy 🫶- Default:
1.0(attempt componentwise convergence)
- Default:
WORK
WORK is DOUBLE PRECISION array, dimension (4*N)
IWORK
IWORK is INTEGER array, dimension (N)
INFO
INFO is INTEGER
= 0: Successful exit. The solution to every right-hand side is guaranteed. slay ✨ every single RHS came through< 0: IfINFO = -i, the i-th argument had an illegal value. not the vibe 💀> 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.= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may 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 smallest J such 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 smallest J such 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. 👑
💖 Author 💖
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
🦋 subroutine dsytd2 🦋
subroutine dsytd2 (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, double precision, dimension( * ) D, double
precision, dimension( * ) E, double precision, dimension( * ) TAU,
integer INFO)
DSYTD2 reduces a symmetric matrix to real symmetric tridiagonal form by an orthogonal similarity transformation (unblocked algorithm). unblocked = it's doing the whole thing itself, no helpers, main character energy 💅
🎯 Purpose
DSYTD2 reduces a real symmetric matrix A to symmetric tridiagonal form T by an orthogonal similarity transformation: Q**T * A * Q = T.
🎀 Parameters
UPLOUPLOisCHARACTER*1- Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
NNisINTEGER- The order of the matrix A.
N >= 0.
AAisDOUBLE PRECISIONarray, 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. IfUPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. - On exit, if
UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the arrayTAU, represent the orthogonal matrix Q as a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.
LDALDAisINTEGER- The leading dimension of the array A.
LDA >= max(1,N).
DDisDOUBLE PRECISIONarray, dimension(N)- The diagonal elements of the tridiagonal matrix T:
D(i) = A(i,i).
EEisDOUBLE PRECISIONarray, dimension(N-1)- The off-diagonal elements of the tridiagonal matrix T:
E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.
TAUTAUisDOUBLE PRECISIONarray, dimension(N-1)- The scalar factors of the elementary reflectors (see Further Details).
INFOINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.
💖 Author 💖
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
🔍 Further Details
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). 🌈
🌸 subroutine dsytf2 🌸
subroutine dsytf2 (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
DSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). pivoting but make it unblocked ✨
🎯 Purpose
DSYTF2 computes the factorization of a real 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. Level 2 BLAS bestie, she's not doing the fancy block stuff, she's just built different 🫶
🎀 Parameters
UPLOUPLOisCHARACTER*1- Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
NNisINTEGER- The order of the matrix A.
N >= 0.
AAisDOUBLE PRECISIONarray, 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. 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
LDALDAisINTEGER- The leading dimension of the array A.
LDA >= max(1,N).
IPIVIPIVisINTEGERarray, dimension(N)- Details of the interchanges and the block structure of D.
- 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
- 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.
- If
INFOINFOisINTEGER= 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 matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. 😭 do not do that
💖 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 🫶✨
09-29-06 — patch from Bobby Cheng, MathWorks
Replace l.204 and l.372
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. DISNAN(ABSAKK) ) THEN
01-01-96 — Based on modifications by J. Lewis, Boeing Computer Services Company A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
1-96 — Based on modifications by J. Lewis, Boeing Computer Services Company
subroutine dsytf2_rk 💖
subroutine dsytf2_rk (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E,
integer, dimension( * ) IPIV, integer INFO)
DSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). bestie, that's the whole vibe right there 💅
Purpose ✨
DSYTF2_RK computes the factorization of a real 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 info, go peek at the Further Details section 👀
Parameters 🌸
UPLO
UPLO is CHARACTER*1
Tells you 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 DOUBLE PRECISION array, dimension (LDA,N)
On entry, the symmetric matrix A.
- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
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 DOUBLE PRECISION 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 to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in 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 the Further Details section 👑
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. 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) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
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 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) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
INFO
INFO is INTEGER
= 0: successful exit 🎉< 0: IfINFO = -k, thek-th argument had an illegal value 😭> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. 🚨
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 dsytf2_rook 💅
subroutine dsytf2_rook (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
integer INFO)
DSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm). 🦋
Purpose ✨
okay so DSYTF2_ROOK is out here computing the factorization of a real symmetric matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method, and bestie, it's giving:
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. lowkey humble of it.
🌸 Parameters 🌸
UPLO—UPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
N—NisINTEGER. The order of the matrix A.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N). On entry, the symmetric 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details, bestie, we get there).
LDA—LDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure of D. 🎀
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.
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 matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. not the vibe, be careful bestie 😭
👑 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 dsytrd 🧚
subroutine dsytrd (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, double precision, dimension( * ) D, double
precision, dimension( * ) E, double precision, dimension( * ) TAU,
double precision, dimension( * ) WORK, integer LWORK, integer INFO)
DSYTRD
Purpose:
DSYTRD reduces a real symmetric matrix A to real symmetric tridiagonal form T by an orthogonal similarity transformation:
Q**T * A * Q = T.
periodt. ✨
🌈 Parameters 🌈
UPLO—UPLOisCHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
N—NisINTEGER. The order of the matrix A.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N). On entry, the symmetric 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, if UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details. 👀
LDA—LDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).D—DisDOUBLE PRECISIONarray, dimension(N). The diagonal elements of the tridiagonal matrix T:D(i) = A(i,i).E—EisDOUBLE PRECISIONarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrix T:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAU—TAUisDOUBLE PRECISIONarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).WORK—WORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORK—LWORKisINTEGER. The dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 🔥
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO—INFOisINTEGER.= 0: successful exit ✨< 0: ifINFO = -i, the i-th argument had an illegal value
👑 Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
🍓 Further Details:
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). 💜
dsytrd_2stage ✨
subroutine dsytrd_2stage (character VECT, character UPLO, integer N, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) D, double precision, dimension( * ) E, double precision,
dimension( * ) TAU, double precision, dimension( * ) HOUS2, integer
LHOUS2, double precision, dimension( * ) WORK, integer LWORK, integer
INFO)
DSYTRD_2STAGE 💖
Purpose 🎀
okay so bestie, what does she actually do. DSYTRD_2STAGE reduces a real symmetric matrix A to real symmetric tridiagonal form T by a orthogonal similarity transformation:
Q1**T Q2**T* A * Q2 * Q1 = T.
that's the whole vibe. two-stage, two Q's, one tridiagonal queen 👑
Parameters 🌸
VECT—CHARACTER*1= 'N': No need for the Housholder representation, in particular for the second stage (Band to tridiagonal) and thusLHOUS2is of sizemax(1, 4*N);= 'V': the Householder representation is needed to either generateQ1 Q2or to applyQ1 Q2, thenLHOUS2is to be queried and computed. (NOT AVAILABLE IN THIS RELEASE).
UPLO—CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N—INTEGER- The order of the matrix
A.N >= 0. (bestie if it's negative we're not doing this 💀)
- The order of the matrix
A—DOUBLE PRECISIONarray, dimension(LDA,N)- On entry, the symmetric matrix
A. 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, if
UPLO = 'U', the band superdiagonal ofAare overwritten by the corresponding elements of the internal band-diagonal matrixAB, and the elements above theKDsuperdiagonal, with the arrayTAU, represent the orthogonal matrixQ1as a product of elementary reflectors; ifUPLO = 'L', the diagonal and band subdiagonal ofAare over- written by the corresponding elements of the internal band-diagonal matrixAB, and the elements below theKDsubdiagonal, with the arrayTAU, represent the orthogonal matrixQ1as a product of elementary reflectors. See Further Details.
- On entry, the symmetric matrix
LDA—INTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
D—DOUBLE PRECISIONarray, dimension(N)- The diagonal elements of the tridiagonal matrix
T. the main character of the whole operation fr 🫶
- The diagonal elements of the tridiagonal matrix
E—DOUBLE PRECISIONarray, dimension(N-1)- The off-diagonal elements of the tridiagonal matrix
T.
- The off-diagonal elements of the tridiagonal matrix
TAU—DOUBLE PRECISIONarray, dimension(N-KD)- The scalar factors of the elementary reflectors of the first stage (see Further Details).
HOUS2—DOUBLE PRECISIONarray, dimension(LHOUS2)- Stores the Householder representation of the stage2 band to tridiagonal.
LHOUS2—INTEGER- The dimension of the array
HOUS2. - If
LWORK = -1, orLHOUS2 = -1, then a query is assumed; the routine only calculates the optimal size of theHOUS2array, returns this value as the first entry of theHOUS2array, and no error message related toLHOUS2is issued byXERBLA. - If
VECT='N',LHOUS2 = max(1, 4*n); ifVECT='V', option not yet available.
- The dimension of the array
WORK—DOUBLE PRECISIONarray, dimension(LWORK)LWORK—INTEGER- The dimension of the array
WORK.LWORK = MAX(1, dimension) - If
LWORK = -1, orLHOUS2=-1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. LWORK = MAX(1, dimension)where
- The dimension of the array
dimension = max(stage1,stage2) + (KD+1)*N
= N*KD + N*max(KD+1,FACTOPTNB)
+ max(2*KD*KD, KD*NTHREADS)
+ (KD+1)*N
- where
KDis the blocking size of the reduction,FACTOPTNBis the blocking used by theQRorLQalgorithm, usuallyFACTOPTNB=128is a good choice,NTHREADSis the number of threads used when openMP compilation is enabled, otherwise=1.
INFO—INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
Author 🎀
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: 💅
Implemented by Azzam Haidar.
All details are available on technical report, SC11, SC13 papers.
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
dsytrd_sy2sb 🦋
subroutine dsytrd_sy2sb (character UPLO, integer N, integer KD, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * )
TAU, double precision, dimension( * ) WORK, integer LWORK, integer INFO)
DSYTRD_SY2SB ✨
Purpose 🌈
DSYTRD_SY2SB reduces a real symmetric matrix A to real symmetric band-diagonal form AB by a orthogonal similarity transformation:
Q**T * A * Q = AB.
she's taking you from full symmetric to band-diagonal, no cap 💅
Parameters 💖
UPLO—CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N—INTEGER- The order of the matrix
A.N >= 0.
- The order of the matrix
KD—INTEGER- The number of superdiagonals of the reduced matrix if
UPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0. - The reduced matrix is stored in the array
AB.
- The number of superdiagonals of the reduced matrix if
A—DOUBLE PRECISIONarray, dimension(LDA,N)- On entry, the symmetric matrix
A. 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, if
UPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare over- written by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. See Further Details.
- On entry, the symmetric matrix
LDA—INTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
AB—DOUBLE PRECISIONarray, dimension(LDAB,N)- On exit, the upper or lower triangle of the symmetric band matrix
A, stored in the firstKD+1rows of the array. The j-th column ofAis stored in the j-th column of the arrayABas follows:
- On exit, the upper or lower triangle of the symmetric band matrix
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
LDAB—INTEGER- The leading dimension of the array
AB.LDAB >= KD+1.
- The leading dimension of the array
TAU—DOUBLE PRECISIONarray, dimension(N-KD)- The scalar factors of the elementary reflectors (see Further Details).
WORK—DOUBLE PRECISIONarray, dimension(LWORK)- On exit, if
INFO = 0, or ifLWORK=-1,WORK(1)returns the size ofLWORK.
- On exit, if
LWORK—INTEGER- The dimension of the array
WORKwhich should be calculated by a workspace query.LWORK = MAX(1, LWORK_QUERY) - If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. LWORK_QUERY = N*KD + N*max(KD,FACTOPTNB) + 2*KD*KD- where
FACTOPTNBis the blocking used by theQRorLQalgorithm, usuallyFACTOPTNB=128is a good choice otherwise puttingLWORK=-1will provide the size ofWORK.
- The dimension of the array
INFO
and that's literally where this part cuts off bestie 😭 INFO's whole description is waiting for you in the next bit 🫶
INFOisINTEGER— the little status report at the end 💌= 0: successful exit, we ate and left no crumbs ✨< 0: ifINFO = -i, the i-th argument had an illegal value 😭 (rude of it, honestly)
Author 🫶
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details: 👑
Implemented by Azzam Haidar.
All details are available on technical report, SC11, SC13 papers.
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
okay bestie, now the shape of Q 💅 — if UPLO = 'U', the matrix Q is represented as a product of elementary reflectors:
Q = H(k)**T . . . H(2)**T H(1)**T, where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i+kd-1) = 0 and v(i+kd) = 1; conjg(v(i+kd+1:n)) is stored on exit in A(i,i+kd+1:n), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(kd+1:i) = 0 and v(i+kd+1) = 1; v(i+kd+2:n) is stored on exit in A(i+kd+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( ab ab/v1 v1 v1 v1 ) ( ab )
( ab ab/v2 v2 v2 ) ( ab/v1 ab )
( ab ab/v3 v3 ) ( v1 ab/v2 ab )
( ab ab/v4 ) ( v1 v2 ab/v3 ab )
( ab ) ( v1 v2 v3 ab/v4 ab )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i)..fi
🌸 subroutine dsytrf 🌸
subroutine dsytrf (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision,
dimension( * ) WORK, integer LWORK, integer INFO)
DSYTRF — say hi to the icon 👑
Purpose: ✨
DSYTRF computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is
A = U**T*D*U or A = L*D*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. (iykyk, that's the fast one 🔥)
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.AAisDOUBLE PRECISIONarray, dimension(LDA,N)On entry, the symmetric 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
LDALDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVIPIVisINTEGERarray, dimension(N)Details of the interchanges and the block structure of D. IfIPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and-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 columns k+1 and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.WORKWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKLWORKisINTEGERThe length of WORK.LWORK >= 1. For best performanceLWORK >= N*NB, where NB is 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.
INFOINFOisINTEGER= 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 matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.
bestie not the singular matrix 💀 if you see INFO > 0 do NOT go solving systems with that thing, division by zero is not the vibe.
Author 🫶
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details: 👑
If UPLO = 'U', then A = U**T*D*U, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
🦋 subroutine dsytrf_aa 🦋
subroutine dsytrf_aa (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
precision, dimension( * ) WORK, integer LWORK, integer INFO)
DSYTRF_AA — same energy, different algorithm, we love a sister routine 💖
Purpose: ✨
DSYTRF_AA computes the factorization of a real 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 symmetric tridiagonal matrix.
This is the blocked version of the algorithm, calling Level 3 BLAS. (again with the Level 3 BLAS, iconic 🔥)
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.AAisDOUBLE PRECISIONarray, dimension(LDA,N)On entry, the symmetric 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, 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 subdiaonals, when UPLO is 'L' (or 'U').
LDALDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).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).WORKWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKLWORKisINTEGERThe length of WORK.LWORK >= MAX(1,2*N). For optimum performanceLWORK >= 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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. 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 dsytrf_aa_2stage 🦋
subroutine dsytrf_aa_2stage (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, double precision, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, double precision, dimension( * ) WORK, integer LWORK, integer
INFO)
DSYTRF_AA_2STAGE
✨ Purpose: ✨
DSYTRF_AA_2STAGE computes the factorization of a real 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 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. periodt 💅
🌸 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.
- The order of the matrix
A—A is DOUBLE PRECISION array, dimension (LDA,N)- On entry, the symmetric matrix
A. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. - On exit,
Lis stored below (or above) the subdiagonal blocks, whenUPLOis'L'(or'U').
- On entry, the symmetric matrix
LDA—LDA is INTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
TB—TB is DOUBLE PRECISION 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 selectNBsuch thatLTB >= (3*NB+1)*N. - If
LTB = -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.
- The size of the array
IPIV—IPIV is INTEGER array, dimension (N)- On exit, it contains the details of the interchanges, i.e., the row and column
kofAwere interchanged with the row and columnIPIV(k).
- On exit, it contains the details of the interchanges, i.e., the row and column
IPIV2—IPIV2 is INTEGER array, dimension (N)- On exit, it contains the details of the interchanges, i.e., the row and column
kofTwere interchanged with the row and columnIPIV2(k).
- On exit, it contains the details of the interchanges, i.e., the row and column
WORK—WORK is DOUBLE PRECISION workspace of size LWORKLWORK—LWORK is INTEGER- The size of
WORK.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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
- The size of
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.
🎀 subroutine dsytrf_rk 🎀
subroutine dsytrf_rk (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E,
integer, dimension( * ) IPIV, double precision, dimension( * ) WORK,
integer LWORK, integer INFO)
DSYTRF_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm). bestie this one is A LOT, buckle up 🫶
✨ Purpose: ✨
DSYTRF_RK computes the factorization of a real 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
Ais stored: = 'U': Upper triangular= 'L': Lower triangular
- Specifies whether the upper or lower triangular part of the symmetric matrix
N—N is INTEGER- The order of the matrix
A.N >= 0.
- The order of the matrix
A—A is DOUBLE PRECISION array, dimension (LDA,N)- On entry, the symmetric matrix
A.- If
UPLO = 'U': the leading N-by-N upper triangular part 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, 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.
- ONLY diagonal elements of the symmetric block diagonal matrix
- On entry, the symmetric matrix
LDA—LDA is INTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
E—E is DOUBLE PRECISION array, dimension (N)- 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. - NOTE: For 1-by-1 diagonal block
D(k), where1 <= k <= N, the elementE(k)is set to0in bothUPLO = 'U'orUPLO = 'L'cases.
- On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
IPIV—IPIV is INTEGER array, dimension (N)IPIVdescribes the permutation matrixPin the factorization of matrixAas follows. The absolute value ofIPIV(k)represents the index of row and column that were interchanged with the k-th row and column. The value ofUPLOdescribes the order in which the interchanges were applied. Also, the sign ofIPIVrepresents the block structure of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section.- If
UPLO = 'U', ( in factorization order,kdecreases fromNto1):- 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. - A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- In both cases a) and b), always
ABS( IPIV(k) ) <= k. - NOTE: Any entry
IPIV(k)is always NONZERO on output.
- A single positive entry
- If
UPLO = 'L', ( in factorization order,kincreases from1toN):- 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. - A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- In both cases a) and b), always
ABS( IPIV(k) ) >= k.
- A single positive entry
d)NOTE: any entryIPIV(k)is always NONZERO on output. like, always. bestie you can trust that one. 💅WORK—WORKis aDOUBLE PRECISIONarray, dimension( MAX(1,LWORK) ). On exit, ifINFO = 0,WORK(1)hands you back the optimalLWORK. ✨LWORK—LWORKisINTEGER, and it's the length ofWORK. Rule one:LWORK >=1. But if you want it to actually perform,LWORK >= N*NB, whereNBis the block size returned byILAENV. obsessed with that.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. it's giving "just window shopping, don't yell at me" 🛍️
INFO—INFOisINTEGER= 0: successful exit 🎉< 0: IfINFO = -k, the k-th argument had an illegal value 😭> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': column k in the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': column k in 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. division by zero. do not do that. that is not the vibe. 💀
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. so it's like, it tells you about the first red flag and then just keeps going. 🚩
Author 🌸
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: 🦋
TODO: put correct description
not the TODO in the manpage 😭 they really just left it there fr fr. iconic honestly.
Contributors: 👑
- December 2016, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
subroutine dsytrf_rook (character UPLO, integer N, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( * ) WORK, integer LWORK, integer INFO)
DSYTRF_ROOK
Purpose: 🎀
DSYTRF_ROOK computes the factorization of a real 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. blocked = fast = we love her. 🔥
Parameters 🌈
UPLO—UPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N—NisINTEGER. The order of the matrixA.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N).
On entry, the symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). she comes back different. glow up. ✨
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 columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k-1 and-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 columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k+1 and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
WORK—WORKisDOUBLE PRECISIONarray, 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: 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. again: do NOT divide by that zero. she's singular and she means it.
Author 🌸
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: 🧚
If UPLO = 'U', then A = U*D*U**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: 👑
- 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
subroutine dsytri (character UPLO, integer N, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( * ) WORK, integer INFO)
DSYTRI
Purpose: 🦋
DSYTRI 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 DSYTRF. she's the follow-up act. the encore. the "we already did the hard part, now we flip it." 🔥
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—AisDOUBLE PRECISIONarray, dimension(LDA,N).
On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by DSYTRF.
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.
bestie, she does not read the half of the matrix she doesn't need. she's efficient like that. 💅
LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF.WORK—WORKisDOUBLE PRECISIONarray, dimension(N).INFO—INFOisINTEGER= 0: successful exit 🎉< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. no inverse for you. she said no. respectfully. 😭
Author 🌸
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
🌸 dsytri2 — the little setup bestie that hands off the real work
subroutine dsytri2 (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision,
dimension( * ) WORK, integer LWORK, integer INFO)
Purpose 💖
DSYTRI2 computes the inverse of a DOUBLE PRECISION symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF. And then — plot twist — DSYTRI2 sets the LEADING DIMENSION of the workspace before calling DSYTRI2X, because DSYTRI2X is the one that actually computes the inverse. So like, dsytri2 is the hype girl setting up the stage, and dsytri2x walks out and eats. 💅
Parameters 🎀
UPLO— it's aCHARACTER*1, bestie. It says whether 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—NisINTEGER. The order of the matrixA.N >= 0. (Zero is allowed, no gatekeeping here. 👑)A—Ais aDOUBLE PRECISIONarray, dimension(LDA,N).- On entry: the block diagonal matrix
Dand the multipliers used to obtain the factorUorLas computed byDSYTRF. So it walks in carrying the receipts fromDSYTRF. 🧾 - On exit, if
INFO = 0: the (symmetric) inverse of the original matrix. And here's the vibe check — 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 like, half ofAis literally just vibing and nobody's looking at it. 🙈
- On entry: the block diagonal matrix
LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVis anINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF.WORK—WORKis aDOUBLE PRECISIONarray, dimension(N+NB+1)*(NB+3). That's the exact shape, don't come at me with anything else. ✨LWORK—LWORKisINTEGER. 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.
- the optimal size of the
- Like, it's the "asking for a friend" mode.
-1and she just tells you the size, no drama, noXERBLAscreaming. 🫶
- If
INFO—INFOisINTEGER.= 0: successful exit 🎉< 0: ifINFO = -i, the i-th argument had an illegal value 💀> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. Yeah so that's the "it's giving singular, no inverse for you" situation. 😭
Author ✨
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
🦋 dsytri2x — the one who actually does the inverse
subroutine dsytri2x (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision,
dimension( n+nb+1,* ) WORK, integer NB, integer INFO)
Purpose 💜
DSYTRI2X 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 DSYTRF. No hand-off, no middleman, she just does it. Main character energy fr fr. 👑
Parameters 🌈
UPLO—CHARACTER*1, same deal as always. It 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—DOUBLE PRECISIONarray, dimension(LDA,N).- On entry: the
NNBdiagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF. - On exit, if
INFO = 0: the (symmetric) inverse of the original matrix. And again — 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. Half of it is just there for the aesthetic, we don't read it. 🙈
- On entry: the
LDA—INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—INTEGERarray, dimension(N). Details of the interchanges and theNNBstructure ofDas determined byDSYTRF.WORK—DOUBLE PRECISIONarray, dimension(N+NB+1,NB+3).NB—INTEGER. Block size. That's it, that's the whole description. Short queen. 🎀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.
🌟 dsytri_3 — the blocked version, Level 3 BLAS girlie
subroutine dsytri_3 (character UPLO, integer N, double precision, dimension(
lda, * ) A, integer LDA, double precision, dimension( * ) E, integer,
dimension( * ) IPIV, double precision, dimension( * ) WORK, integer
LWORK, integer INFO)
Purpose ⭐
DSYTRI_3 computes the inverse of a real symmetric indefinite matrix A using the factorization computed by DSYTRF_RK or DSYTRF_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.
And okay so — DSYTRI_3 sets the leading dimension of the workspace before calling DSYTRI_3X that actually computes the inverse. This is the blocked version of the algorithm, calling Level 3 BLAS. She's optimized, she's fast, she's THAT girl. 🔥
Parameters 🧚
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—DOUBLE PRECISIONarray, dimension(LDA,N).- On entry: the diagonal of the block diagonal matrix
Dand factorsUorLas computed byDSYTRF_RKandDSYTRF_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—DOUBLE PRECISIONarray, 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 blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases. She's just sitting there unread, minding her business. 💀
- On entry: contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix
IPIV—INTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF_RKorDSYTRF_BK.WORK—DOUBLE PRECISIONarray, 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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. Yep, it says "the optimal size of the optimal size" — we don't fix it, we report it, that's the whole brand. 🫶
- If
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.
Contributors: 🎀
November 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
💜 dsytri_3x — blocked algorithm, part two, the sequel nobody asked for but everybody needed
subroutine dsytri_3x (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E,
integer, dimension( * ) IPIV, double precision, dimension( n+nb+1, * )
WORK, integer NB, integer INFO)
Purpose ✨
DSYTRI_3X computes the inverse of a real symmetric indefinite matrix A using the factorization computed by DSYTRF_RK or DSYTRF_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. Same energy as her sister, just doing the actual computing. 💅
Parameters 🌈
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— bestie hold that thought, this one keeps going in the next part 💅
On entry, the diagonal of the block diagonal matrix D and factors U or L as computed by DSYTRF_RK and DSYTRF_BK:
- a) ONLY the diagonal elements of the symmetric block diagonal matrix
Dsit on the diagonal ofA, i.e.D(k,k) = A(k,k); (and the superdiagonal — or subdiagonal — elements ofDshould be handed to you on entry in the arrayE), and - b) if
UPLO = 'U': factorUlives in the superdiagonal part ofA. IfUPLO = 'L': factorLlives in the subdiagonal part ofA.
On exit, if INFO = 0, you get 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—LDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).E—Eis DOUBLE PRECISION array, dimension (N). On entry, it 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 a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in both theUPLO = 'U'andUPLO = 'L'cases. like, neither. ok? 🙈
IPIV—IPIVis INTEGER array, dimension (N). All the tea on the interchanges and the block structure ofD, as determined byDSYTRF_RKorDSYTRF_BK.WORK—WORKis DOUBLE PRECISION array, dimension (N+NB+1,NB+3).NB—NBis INTEGER. Block size. ✨INFO—INFOis 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. she's singular bestie, no inverse for you 😭
Author 🫶
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors: 👑
June 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
subroutine dsytri_rook 🦋
subroutine dsytri_rook (character UPLO, integer N, double precision,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
precision, dimension( * ) WORK, integer INFO)
DSYTRI_ROOK 💜
Purpose:
DSYTRI_ROOK computes the inverse of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF_ROOK. iconic behavior honestly
Parameters 🎀
UPLO—UPLOis CHARACTER*1. Tells you whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**T;= 'L': Lower triangular, form isA = L*D*L**T.
N—Nis INTEGER. The order of the matrixA.N >= 0.A—Ais DOUBLE PRECISION array, dimension (LDA,N). On entry, the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF_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—LDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVis INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byDSYTRF_ROOK.WORK—WORKis DOUBLE PRECISION array, dimension (N).INFO—INFOis 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. rip 😭
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
subroutine dsytrs 🌸
subroutine dsytrs (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( ldb, * ) B, integer LDB, integer
INFO)
DSYTRS 🧚
Purpose:
DSYTRS solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF. solving systems, we love to see it
Parameters 🎀
UPLO—UPLOis 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—Nis INTEGER. The order of the matrixA.N >= 0.NRHS—NRHSis INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.A—Ais DOUBLE PRECISION array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF.LDA—LDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVis INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byDSYTRF.B—Bis DOUBLE PRECISION array, dimension (LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. the glow-up arc of arrays fr frLDB—LDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).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.
subroutine dsytrs2 🦋
subroutine dsytrs2 (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( ldb, * ) B, integer LDB, double
precision, dimension( * ) WORK, integer INFO)
DSYTRS2 💅
Purpose:
DSYTRS2 solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF and converted by DSYCONV. note the plot twist, bestie
Parameters 🎀
UPLO—UPLOis 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—Nis INTEGER. The order of the matrixA.N >= 0.NRHS—NRHSis INTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.A—Ais DOUBLE PRECISION array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF.
Note thatAis input / output. This might be counter-intuitive, and one may think thatAis input only.Ais input / output. This is because, at the start of the subroutine, we permuteAin a 'better' form and then we permuteAback to its original form at the end. she leaves, she comes back, she's the same girl 😌
LDA—LDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVis INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byDSYTRF.B—Bis DOUBLE PRECISION array, dimension (LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX.LDB—LDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORK—WORKis DOUBLE PRECISION array, dimension (N).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.
subroutine dsytrs_3 🌈
subroutine dsytrs_3 (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) E, integer, dimension( * ) IPIV, double precision,
dimension( ldb, * ) B, integer LDB, integer INFO)
DSYTRS_3 👑
Purpose:
DSYTRS_3 solves a system of linear equations A * X = B with a real symmetric matrix A using the factorization computed by DSYTRF_RK or DSYTRF_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.
This algorithm is using Level 3 BLAS. fast girl summer 🔥
Parameters 🎀
UPLO—UPLO— it'sCHARACTER*1, bestie. It 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.NRHS—NRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byDSYTRF_RKandDSYTRF_BK:- 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 - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- ONLY diagonal elements of the symmetric block diagonal matrix
LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).E—EisDOUBLE PRECISIONarray, 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 blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF_RKorDSYTRF_BK.B—BisDOUBLE PRECISIONarray, 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.
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
DSYTRS_AA ✨
subroutine dsytrs_aa (character UPLO, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( ldb, * ) B, integer LDB, double precision, dimension( * ) WORK, integer LWORK, integer INFO)
Purpose:
DSYTRS_AA solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by DSYTRF_AA.
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—AisDOUBLE PRECISIONarray, dimension(LDA,N). Details of factors computed byDSYTRF_AA.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges as computed byDSYTRF_AA.B—BisDOUBLE PRECISIONarray, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX.LDB—LDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORK—WORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)).LWORK—LWORKisINTEGER. The dimension of the arrayWORK.LWORK >= max(1,3*N-2).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.
DSYTRS_AA_2STAGE 🎀
subroutine dsytrs_aa_2stage (character UPLO, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, double precision, dimension( ldb, * ) B, integer LDB, integer INFO)
Purpose:
DSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by DSYTRF_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—AisDOUBLE PRECISIONarray, dimension(LDA,N). Details of factors computed byDSYTRF_AA_2STAGE.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TB—TBisDOUBLE PRECISIONarray, dimension(LTB). Details of factors computed byDSYTRF_AA_2STAGE.LTB—LTBisINTEGER. The size of the arrayTB.LTB >= 4*N.IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges as computed byDSYTRF_AA_2STAGE.IPIV2—IPIV2isINTEGERarray, dimension(N). Details of the interchanges as computed byDSYTRF_AA_2STAGE.B—BisDOUBLE PRECISIONarray, 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.
DSYTRS_ROOK 🦋
subroutine dsytrs_rook (character UPLO, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision, dimension( ldb, * ) B, integer LDB, integer INFO)
Purpose:
DSYTRS_ROOK solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF_ROOK.
Parameters
UPLO—UPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**T;= 'L': Lower triangular, form isA = L*D*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—AisDOUBLE PRECISIONarray, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byDSYTRF_ROOK.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIV—IPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byDSYTRF_ROOK.B—BisDOUBLE PRECISIONarray, 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.
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
DTGSYL 🌸
subroutine dtgsyl (character TRANS, integer IJOB, integer M, integer N, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( ldb, * ) B, integer LDB, double precision, dimension( ldc, * ) C, integer LDC, double precision, dimension( ldd, * ) D, integer LDD, double precision, dimension( lde, * ) E, integer LDE, double precision, dimension( ldf, * ) F, integer LDF, double precision SCALE, double precision DIF, double precision, dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
Purpose:
bestie, the details for DTGSYL are literally about to start in the next part — stay ready 💅
so like, DTGSYL solves the generalized Sylvester equation:
A * R - L * B = scale * C (1)
D * R - L * E = scale * F
where R and L are the unknown m-by-n matrices, and (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 real entries. bestie, listen: (A, D) and (B, E) must be in generalized (real) Schur canonical form, i.e. A, B are upper quasi triangular and D, E are upper triangular. no exceptions, that's the vibe check 🫶
The solution (R, L) overwrites (C, F). And 0 <= SCALE <= 1 is an output scaling factor chosen to avoid overflow. protecting your numbers, as it should 💅
In matrix notation (1) is equivalent to solve Zx = scale b, where Z is defined as
Z = [ kron(In, A) -kron(B**T, Im) ] (2)
[ kron(In, D) -kron(E**T, Im) ].
Here Ik is the identity matrix of size k and X**T is the transpose of X. kron(X, Y) is the Kronecker product between the matrices X and Y. iconic math behavior, honestly ✨
If TRANS = 'T', DTGSYL solves the transposed system Z**T*y = scale*b, which is equivalent to solve for R and L in
A**T * R + D**T * L = scale * C (3)
R * B**T + L * E**T = scale * -F
This case (TRANS = 'T') 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 DLACON. iykyk 🌸
If IJOB >= 1, DTGSYL 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. See [1-2] for more information. 📚
This is a level 3 BLAS algorithm. level 3 BLAS?! she ate. 🔥
🫶 Parameters 🫶
TRANS—TRANSisCHARACTER*1= 'N': solve the generalized Sylvester equation (1).= 'T': solve the 'transposed' system (3).
IJOB—IJOBisINTEGER. Specifies what kind of functionality to be performed.= 0: solve (1) only.= 1: The functionality of 0 and 3.= 2: The functionality of 0 and 4.= 3: Only an estimate ofDif[(A,D), (B,E)]is computed. (look ahead strategyIJOB = 1is used).= 4: Only an estimate ofDif[(A,D), (B,E)]is computed. (DGECONon sub-systems is used ).- Not referenced if
TRANS = 'T'.
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—AisDOUBLE PRECISIONarray, dimension(LDA, M). The upper quasi triangular matrixA.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1, M).B—BisDOUBLE PRECISIONarray, dimension(LDB, N). The upper quasi triangular matrixB.LDB—LDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1, N).C—CisDOUBLE PRECISIONarray, dimension(LDC, N).- On entry,
Ccontains the right-hand-side of the first matrix equation in (1) or (3). - On exit, if
IJOB = 0,1or2,Chas been overwritten by the solutionR. IfIJOB = 3or4andTRANS = 'N',CholdsR, the solution achieved during the computation of the Dif-estimate. she contains multitudes tbh
- On entry,
LDC—LDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1, M).D—DisDOUBLE PRECISIONarray, dimension(LDD, M). The upper triangular matrixD.LDD—LDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1, M).E—EisDOUBLE PRECISIONarray, dimension(LDE, N). The upper triangular matrixE.LDE—LDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1, N).F—FisDOUBLE PRECISIONarray, dimension(LDF, N).- On entry,
Fcontains the right-hand-side of the second matrix equation in (1) or (3). - On exit, if
IJOB = 0,1or2,Fhas been overwritten by the solutionL. IfIJOB = 3or4andTRANS = 'N',FholdsL, the solution achieved during the computation of the Dif-estimate.
- On entry,
LDF—LDFisINTEGER. The leading dimension of the arrayF.LDF >= max(1, M).DIF—DIFisDOUBLE PRECISION. 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 = 'T',DIFis not touched.SCALE—SCALEisDOUBLE PRECISION. 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,CandFhold the solutionsRandL, respectively, to the homogeneous system withC = F = 0. Normally,SCALE = 1.WORK—WORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. 👑LWORK—LWORKisINTEGER. The dimension of the arrayWORK.LWORK > = 1.- If
IJOB = 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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. workspace query my beloved 🎀
- If
IWORK—IWORKisINTEGERarray, dimension(M+N+6).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 close eigenvalues. not the slay we wanted, bestie — them eigenvalues are getting too close 😭
💖 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. the OGs fr fr 🫶
📚 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 dtrsyl 🔥
subroutine dtrsyl (character TRANA, character TRANB, integer ISGN, integer
M, integer N, double precision, dimension( lda, * ) A, integer LDA,
double precision, dimension( ldb, * ) B, integer LDB, double precision,
dimension( ldc, * ) C, integer LDC, double precision SCALE, integer
INFO)
DTRSYL 💅
✨ Purpose: ✨
DTRSYL solves the real 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**T, and A and B are both upper quasi-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. safety first, always 🦋
A and B must be in Schur canonical form (as returned by DHSEQR), that is, block upper triangular with 1-by-1 and 2-by-2 diagonal blocks; each 2-by-2 diagonal block has its diagonal elements equal and its off-diagonal elements of opposite sign. that's the law, bestie, no cap
🎀 Parameters 🎀
TRANA—TRANAisCHARACTER*1. Specifies the optionop(A):= 'N':op(A) = A(No transpose)= 'T':op(A) = A**T(Transpose)= 'C':op(A) = A**H(Conjugate transpose = Transpose)
TRANB—TRANBisCHARACTER*1. Specifies the optionop(B):= 'N':op(B) = B(No transpose)= 'T':op(B) = B**T(Transpose)= 'C':op(B) = B**H(Conjugate transpose = Transpose)
ISGN—ISGNisINTEGER. 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—MisINTEGER. The order of the matrixA, and the number of rows in the matricesXandC.M >= 0.N—NisINTEGER. The order of the matrixB, and the number of columns in the matricesXandC.N >= 0.A—AisDOUBLE PRECISIONarray, dimension(LDA,M). The upper quasi-triangular matrixA, in Schur canonical form.LDA—LDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).B—BisDOUBLE PRECISIONarray, dimension(LDB,N). The upper quasi-triangular matrixB, in Schur canonical form.LDB—LDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).C—CisDOUBLE PRECISIONarray, dimension(LDC,N).- On entry, the
M-by-Nright hand side matrixC. - On exit,
Cis overwritten by the solution matrixX. glow up: right-hand side to solution ✨
- On entry, the
LDC—LDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M)SCALE—SCALEisDOUBLE PRECISION. The scale factor,scale, set<= 1to avoid overflow inX.INFO—INFOisINTEGERINFOisINTEGER— okay bestie, this is the lil' status report the routine hands back, and here's the whole vibe check 💅= 0: successful exit ✨ everything slayed, no notes.< 0: ifINFO = -i, the i-th argument had an illegal value 😭 like, argument number i was simply not it.= 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.
✨ Author ✨
Generated automatically by Doxygen for LAPACK from the source code.
and that's the whole page, bestie!! 🫶 this lil' icon came to you courtesy of LAPACK, version 3.11.0, dated Sun Nov 27 2022 — she's serving documentation realness and we're obsessed 💖✨
📦 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