complexGBcomputational(3)
complexGBcomputational(3) π
okay bestie, welcome to complexGBcomputational from the LAPACK manual, section 3. this is the group chat where all the complex GB matrix computational functions hang out. it's long, so buckle up π
NAME β¨
complexGBcomputational β it's giving complex. that's literally it, that's the name. π
SYNOPSIS πΈ
Functions π¦
here's the whole roster, no gatekeeping:
subroutine cgbbrd (VECT, M, N, NCC, KL, KU, AB, LDAB, D, E, Q, LDQ, PT, LDPT, C, LDC, WORK, RWORK, INFO)
CGBBRD β the icon itself.
subroutine cgbcon (NORM, N, KL, KU, AB, LDAB, IPIV, ANORM, RCOND, WORK, RWORK, INFO)
CGBCON β periodt.
subroutine cgbequ (M, N, KL, KU, AB, LDAB, R, C, ROWCND, COLCND, AMAX, INFO)
CGBEQU β yes queen.
subroutine cgbequb (M, N, KL, KU, AB, LDAB, R, C, ROWCND, COLCND, AMAX, INFO)
CGBEQUB β her sister, equally slay.
subroutine cgbrfs (TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)
CGBRFS β main character energy fr.
subroutine cgbrfsx (TRANS, EQUED, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB, IPIV, R, C, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)
CGBRFSX β the extended cut π.
subroutine cgbtf2 (M, N, KL, KU, AB, LDAB, IPIV, INFO)
CGBTF2 β bestie, she computes the LU factorization of a general band matrix using the unblocked version of the algorithm. lowkey the blueprint.
subroutine cgbtrf (M, N, KL, KU, AB, LDAB, IPIV, INFO)
CGBTRF β iconic.
subroutine cgbtrs (TRANS, N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO)
CGBTRS β ate.
subroutine cggbak (JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V, LDV, INFO)
CGGBAK β obsessed with her.
subroutine cggbal (JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE, WORK, INFO)
CGGBAL β queen behavior.
subroutine cla_gbamv (TRANS, M, N, KL, KU, ALPHA, AB, LDAB, X, INCX, BETA, Y, INCY)
CLA_GBAMV β she performs a matrix-vector operation to calculate error bounds. no cap.
real function cla_gbrcond_c (TRANS, N, KL, KU, AB, LDAB, AFB, LDAFB, IPIV, C, CAPPLY, INFO, WORK, RWORK)
CLA_GBRCOND_C β she computes the infinity norm condition number of op(A)*inv(diag(c)) for general banded matrices. π
real function cla_gbrcond_x (TRANS, N, KL, KU, AB, LDAB, AFB, LDAFB, IPIV, X, INFO, WORK, RWORK)
CLA_GBRCOND_X β she computes the infinity norm condition number of op(A)*diag(x) for general banded matrices. π
subroutine cla_gbrfsx_extended (PREC_TYPE, TRANS_TYPE, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB, IPIV, COLEQU, C, B, LDB, Y, LDY, BERR_OUT, N_NORMS, ERR_BNDS_NORM, ERR_BNDS_COMP, RES, AYB, DY, Y_TAIL, RCOND, ITHRESH, RTHRESH, DZ_UB, IGNORE_CWISE, INFO)
CLA_GBRFSX_EXTENDED β she improves the computed solution to a system of linear equations for general banded matrices by performing extra-precise iterative refinement, and provides error bounds and backward error estimates for the solution. the way that she does ALL of that. π
real function cla_gbrpvgrw (N, KL, KU, NCOLS, AB, LDAB, AFB, LDAFB)
CLA_GBRPVGRW β she computes the reciprocal pivot growth factor norm(A)/norm(U) for a general banded matrix. β
subroutine cungbr (VECT, M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
CUNGBR β the moment. π
Detailed Description π
okay so. this is the group of complex computational functions for GB matrices. that's the whole vibe. π¦
Function Documentation π
subroutine cgbbrd πΈ
subroutine cgbbrd (character VECT, integer M, integer N, integer NCC, integer KL, integer KU, complex, dimension( ldab, * ) AB, integer LDAB, real, dimension( * ) D, real, dimension( * ) E, complex, dimension( ldq, * ) Q, integer LDQ, complex, dimension( ldpt, * ) PT, integer LDPT, complex, dimension( ldc, * ) C, integer LDC, complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO)
CGBBRD β the one and only.
Purpose: β¨
CGBBRD reduces a complex general m-by-n band matrix A to real upper bidiagonal form B by a unitary transformation: Q**H * A * P = B.
The routine computes B, and optionally forms Q or P**H, or computes Q**H*C for a given matrix C.
Parameters π«Ά
VECTβVECT is CHARACTER*1. Specifies whether or not the matrices Q and P**H are to be formed:= 'N': do not form Q or P**H`;= 'Q': form Q only;= 'P': form P**H only;= 'B': form both.
MβM is INTEGER. The number of rows of the matrix A.M >= 0.NβN is INTEGER. The number of columns of the matrix A.N >= 0.NCCβNCC is INTEGER. The number of columns of the matrix C.NCC >= 0.KLβKL is INTEGER. The number of subdiagonals of the matrix A.KL >= 0.KUβKU is INTEGER. The number of superdiagonals of the matrix A.KU >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). On entry, the m-by-n band matrix A, stored in rows 1 toKL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows:AB(ku+1+i-j,j) = A(i,j)formax(1,j-ku)<=i<=min(m,j+kl). On exit, A is overwritten by values generated during the reduction. (yeah, she replaces A, that's just how she moves π )LDABβLDAB is INTEGER. The leading dimension of the array A.LDAB >= KL+KU+1.DβD is REAL array, dimension (min(M,N)). The diagonal elements of the bidiagonal matrix B.EβE is REAL array, dimension (min(M,N)-1). The superdiagonal elements of the bidiagonal matrix B.QβQ is COMPLEX array, dimension (LDQ,M). IfVECT = 'Q'or'B', the m-by-m unitary matrix Q. IfVECT = 'N'or'P', the array Q is not referenced.LDQβLDQ is INTEGER. The leading dimension of the array Q.LDQ >= max(1,M)ifVECT = 'Q'or'B';LDQ >= 1otherwise.PTβPT is COMPLEX array, dimension (LDPT,N). IfVECT = 'P'or'B', the n-by-n unitary matrix P'. IfVECT = 'N'or'Q', the array PT is not referenced.LDPTβLDPT is INTEGER. The leading dimension of the array PT.LDPT >= max(1,N)ifVECT = 'P'or'B';LDPT >= 1otherwise.CβC is COMPLEX array, dimension (LDC,NCC). On entry, an m-by-ncc matrix C. On exit, C is overwritten byQ**H*C. C is not referenced ifNCC = 0.LDCβLDC is INTEGER. The leading dimension of the array C.LDC >= max(1,M)ifNCC > 0;LDC >= 1ifNCC = 0.WORKβWORK is COMPLEX array, dimension (max(M,N))RWORKβRWORK is REAL array, dimension (max(M,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 cgbcon π¦
subroutine cgbcon (character NORM, integer N, integer KL, integer KU, complex, dimension( ldab, * ) AB, integer LDAB, integer, dimension( * ) IPIV, real ANORM, real RCOND, complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO)
CGBCON β her.
Purpose: β¨
CGBCON estimates the reciprocal of the condition number of a complex general band matrix A, in either the 1-norm or the infinity-norm, using the LU factorization computed by CGBTRF.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / ( norm(A) * norm(inv(A)) ).
Parameters π«Ά
NORMβNORM is CHARACTER*1. Specifies whether the 1-norm condition number or the infinity-norm condition number is required:= '1'or'O': 1-norm;= 'I': Infinity-norm.
NβN is INTEGER. The order of the matrix A.N >= 0.KLβKL is INTEGER. The number of subdiagonals within the band of A.KL >= 0.KUβKU is INTEGER. The number of superdiagonals within the band of A.KU >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). Details of the LU factorization of the band matrix A, as computed by CGBTRF. U is stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows 1 toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDABβLDAB is INTEGER. The leading dimension of the array AB.LDAB >= 2*KL+KU+1.IPIVβIPIV is INTEGER array, dimension (N). The pivot indices; for1 <= i <= N, row i of the matrix was interchanged with rowIPIV(i).ANORMβANORM is REAL. IfNORM = '1'or'O', the 1-norm of the original matrix A. IfNORM = 'I', the infinity-norm of the original matrix A.RCONDβRCOND is REAL. The reciprocal of the condition number of the matrix A, computed asRCOND = 1/(norm(A) * norm(inv(A))).WORKβWORK is COMPLEX array, dimension (2*N)RWORKβRWORK is REAL 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.
subroutine cgbequ π
subroutine cgbequ (integer M, integer N, integer KL, integer KU, complex, dimension( ldab, * ) AB, integer LDAB, real, dimension( * ) R, real, dimension( * ) C, real ROWCND, real COLCND, real AMAX, integer INFO)
CGBEQU β the equilibration queen.
Purpose: β¨
CGBEQU computes row and column scalings intended to equilibrate an M-by-N band matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
R(i) and C(j) are restricted to be between SMLNUM = smallest safe number and BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice. (translation: bestie, she tries, and honestly she usually eats, but it's not a promise π
)
Parameters π«Ά
MβM is INTEGER. The number of rows of the matrix A.M >= 0.NβN is INTEGER. The number of columns of the matrix A.N >= 0.KLKLβ INTEGER energy. This is how many subdiagonals live inside the band ofA. Rule of the land:KL >= 0.KUβ also INTEGER. The number of superdiagonals chillin' within the band ofA.KU >= 0, bestie, no exceptions.ABβ COMPLEX array, dimension(LDAB,N). This is the band matrixAitself, stored in rows1toKL+KU+1. The j-th column ofAgets parked in the j-th column of the arrayABlike so:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
LDABβ INTEGER. The leading dimension of the arrayAB. Gotta beLDAB >= KL+KU+1.Rβ REAL array, dimension(M). IfINFO = 0, orINFO > M, thenRis holding the row scale factors forA. π«ΆCβ REAL array, dimension(N). IfINFO = 0,Ccontains the column scale factors forA.ROWCNDβ REAL. IfINFO = 0orINFO > M,ROWCNDholds the ratio of the smallestR(i)to the largestR(i). And fr fr: ifROWCND >= 0.1andAMAXis neither too big nor too tiny, it is not worth scaling byR.COLCNDβ REAL. IfINFO = 0,COLCNDholds the ratio of the smallestC(i)to the largestC(i). IfCOLCND >= 0.1, it is not worth scaling byC. periodt.AMAXβ REAL. The absolute value of the largest matrix element. IfAMAXis super close to overflow or super close to underflow, then bestieβ¦ the matrix should be scaled. πINFOβ INTEGER. The vibe check:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, andiis<= M: the i-th row ofAis exactly zero> M: the(i-M)-th column ofAis exactly zero
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ cgbequb
subroutine cgbequb (integer M, integer N, integer KL, integer KU, complex,
dimension( ldab, * ) AB, integer LDAB, real, dimension( * ) R, real,
dimension( * ) C, real ROWCND, real COLCND, real AMAX, integer INFO)
CGBEQUB β say it with me now π
π Purpose
CGBEQUB computes row and column scalings intended to equilibrate an M-by-N matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most the radix.
R(i) and C(j) are restricted to be a power of the radix between SMLNUM = smallest safe number and BIGNUM = largest safe number. Heads up though: use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice. π¦
This routine differs from CGEEQU by restricting the scaling factors to a power of the radix. Barring over- and underflow, scaling by these factors introduces no additional rounding errors. However, the scaled entries' magnitudes are no longer approximately 1 but lie between sqrt(radix) and 1/sqrt(radix). the way that math works⦠iconic honestly.
β¨ Parameters
Mβ INTEGER. The number of rows of the matrixA.M >= 0.Nβ INTEGER. The number of columns of the matrixA.N >= 0.KLβ INTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβ INTEGER. The number of superdiagonals within the band ofA.KU >= 0.ABβ COMPLEX array, dimension(LDAB,N). On entry, the matrixAin band storage, in rows1toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABas follows:
AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
LDABβ INTEGER. The leading dimension of the arrayA.LDAB >= max(1,M).Rβ REAL array, dimension(M). IfINFO = 0orINFO > M,Rcontains the row scale factors forA.Cβ REAL array, dimension(N). IfINFO = 0,Ccontains the column scale factors forA.ROWCNDβ REAL. IfINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). IfROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDβ REAL. IfINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). IfCOLCND >= 0.1, it is not worth scaling byC.AMAXβ REAL. Absolute value of largest matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled.INFOβ INTEGER:= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, andiis<= M: the i-th row ofAis exactly zero> M: the(i-M)-th column ofAis exactly zero
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ cgbrfs
subroutine cgbrfs (character TRANS, integer N, integer KL, integer KU,
integer NRHS, complex, dimension( ldab, * ) AB, integer LDAB, complex,
dimension( ldafb, * ) AFB, integer LDAFB, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( ldx, *
) X, integer LDX, real, dimension( * ) FERR, real, dimension( * ) BERR,
complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO)
CGBRFS β glow up your solution, bestie π β¨
π Purpose
CGBRFS improves the computed solution to a system of linear equations when the coefficient matrix is banded, and provides error bounds and backward error estimates for the solution. she's thorough, she's precise, she's doing the most and we love her for it π«Ά
π Parameters
TRANSβ CHARACTER*1. Specifies the form of the system of equations:= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose)
Nβ INTEGER. The order of the matrixA.N >= 0.KLβ INTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβ INTEGER. The number of superdiagonals within the band ofA.KU >= 0.NRHSβ INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.ABβ COMPLEX array, dimension(LDAB,N). The original band matrixA, stored in rows1toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABas follows:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
LDABβ INTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBβ COMPLEX array, dimension(LDAFB,N). Details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFBβ INTEGER. The leading dimension of the arrayAFB.LDAFB >= 2*KL*KU+1.IPIVβ INTEGER array, dimension(N). The pivot indices fromCGBTRF; for1<=i<=N, rowiof the matrix was interchanged with rowIPIV(i).Bβ COMPLEX array, dimension(LDB,NRHS). The right hand side matrixB.LDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xβ COMPLEX array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byCGBTRS. On exit, the improved solution matrixX. β¨ the glow up β¨LDXβ INTEGER. The leading dimension of the arrayX.LDX >= max(1,N).FERRβ REAL array, dimension(NRHS). The estimated forward error bound for each solution vectorX(j)(the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. she's a little dramatic, that's fine.BERRβ REAL array, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKβ COMPLEX array, dimension(2*N)RWORKβ REAL array, dimension(N)INFOβ 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 cgbrfsx (character TRANS, character EQUED, integer N, integer KL,
integer KU, integer NRHS, complex, dimension( ldab, * ) AB, integer
LDAB, complex, dimension( ldafb, * ) AFB, integer LDAFB, integer,
dimension( * ) IPIV, real, dimension( * ) R, real, dimension( * ) C,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( ldx , *
) X, integer LDX, real RCOND, real, dimension( * ) BERR, integer
N_ERR_BNDS, real, dimension( nrhs, * ) ERR_BNDS_NORM, real, dimension(
nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, real, dimension( * ) PARAMS,
complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO)
CGBRFSX
Purpose π
CGBRFSX is out here doing the most: it takes your already-computed solution to a linear system and makes it better, then hands you error bounds and backward error estimates for that solution. Bestie, it's giving glow-up. β¨
Not only does it do the normwise error bound thing, it also gives you the maximum componentwise error bound when it can. If you wanna know the deets on those bounds, go peek at the comments for ERR_BNDS_NORM and ERR_BNDS_COMP β they spill all the tea. π«
Here's the part you actually need to clock: the original system you're solving might have been equilibrated before you called this routine. That's what the EQUED, R, and C arguments are telling it. And if that's the case, then the solution and error bounds it hands back are for the original, unequilibrated system β not the scaled one. Iconic behavior honestly. π
Some optional parameters are bundled up in the PARAMS array. These settings decide how the refinement gets done, but ngl, the defaults are usually totally fine. And if the defaults are fine for you? Just pass NPARAMS = 0 and the source code won't even touch the PARAMS argument. No cap, it just skips it. π
Parameters π
TRANSβTRANS is CHARACTER*1, and it says which form of the system we're dealing with:= 'N':A * X = B(no transpose, the chill one)= 'T':A**T * X = B(transpose)= 'C':A**H * X = B(conjugate transpose)
EQUEDβEQUED is CHARACTER*1, telling you what kind of equilibration got done toAbefore you called this routine. This matters, because without it the solution and error bounds can't be computed correctly. So like, don't fumble this one. π«Ά= 'N': no equilibration at all, clean slate= 'R': row equilibration βAgot premultiplied bydiag(R)= 'C': column equilibration βAgot postmultiplied bydiag(C)= 'B': both, bestie!Awas replaced bydiag(R) * A * diag(C), and the right hand sideBwas changed accordingly
NβN is INTEGER, the order of the matrixA.N >= 0.KLβKL is INTEGER, how many subdiagonals live inside the band ofA.KL >= 0.KUβKU is INTEGER, how many superdiagonals live inside the band ofA.KU >= 0.NRHSβNRHS is INTEGER, the number of right hand sides, aka the number of columns inBandX.NRHS >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). This is your original band matrixA, stored in rows1toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABlike so:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl)
LDABβLDAB is INTEGER, the leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBβAFB is COMPLEX array, dimension (LDAFB,N). All the details of theLUfactorization of the band matrixA, exactly as computed byCGBTRF. Here's the layout, keep up:Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization live in rowsKL+KU+2to2*KL+KU+1. π§LDAFBβLDAFB is INTEGER, the leading dimension of the arrayAFB.LDAFB >= 2*KL*KU+1.IPIVβIPIV is INTEGER array, dimension (N). The pivot indices fromCGETRF; for1<=i<=N, rowiof the matrix got swapped with rowIPIV(i). Shuffling the deck, basically. π₯RβR is REAL array, dimension (N). The row scale factors forA. IfEQUED = 'R'or'B', thenAis multiplied on the left bydiag(R); ifEQUED = 'N'or'C', thenRdoesn't get accessed at all, it's just vibing.Ris an input argument ifFACT = 'F'; otherwise,Ris an output argument. IfFACT = 'F'andEQUED = 'R'or'B', then every element ofRmust be positive. IfRis output, each element ofRis a power of the radix. IfRis input, each element ofRshould be a power of the radix to make sure you get a reliable solution and reliable error estimates. Scaling by powers of the radix doesn't cause rounding errors β unless the result underflows or overflows, that is. π And rounding errors during scaling lead to refining with a matrix that isn't equivalent to the input matrix, which produces error estimates that may not be reliable. So like, be careful.CβC is REAL array, dimension (N). The column scale factors forA. IfEQUED = 'C'or'B', thenAis multiplied on the right bydiag(C); ifEQUED = 'N'or'R', thenCdoesn't get accessed at all.Cis an input argument ifFACT = 'F'; otherwise,Cis an output argument. IfFACT = 'F'andEQUED = 'C'or'B', every element ofCmust be positive. IfCis output, each element ofCis a power of the radix. IfCis input, each element ofCshould be a power of the radix so your solution and error estimates are actually reliable. Scaling by powers of the radix doesn't cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that isn't equivalent to the input matrix, and then your error estimates may not be reliable. Same energy asR, fr fr.BβB is COMPLEX array, dimension (LDB,NRHS). The right hand side matrixB. Simple as that. πLDBβLDB is INTEGER, the leading dimension of the arrayB.LDB >= max(1,N).XβX is COMPLEX array, dimension (LDX,NRHS). On entry, this is the solution matrixX, as computed byCGETRS. On exit, it's the improved solution matrixX. Main character transformation arc, honestly. β¨LDXβLDX is INTEGER, the leading dimension of the arrayX.LDX >= max(1,N).RCONDβRCOND is REAL. The reciprocal scaled condition number β an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if that happened). If this is less than the machine precision (and especially if it's zero), then the matrix is singular to working precision. π¨ But heads up: the error can still be small even when this number is tiny and the matrix looks ill-conditioned.BERRβBERR is REAL array, dimension (NRHS). Componentwise relative backward error. That's the componentwise relative backward error of each solution vectorX(j)β i.e., the smallest relative change in any element ofAorBthat would makeX(j)an exact solution.N_ERR_BNDSβN_ERR_BNDS is INTEGER. How many error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow. πERR_BNDS_NORMβERR_BNDS_NORM is REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array holds info about various error bounds and condition numbers corresponding to the normwise relative error, which is defined like this:
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, described below. There are currently up to three pieces of info returned. π
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1β 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β 'Guaranteed' error bound: the estimated forward error, almost certainly within a factor of10of the true error, so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3β Reciprocal condition number: estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
See Lapack Working Note 165 for further details and extra cautions. π
ERR_BNDS_COMPβERR_BNDS_COMP is REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array holds info about various error bounds and condition numbers corresponding to the componentwise relative error, defined like this:
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 (which is what the componentwise relative error depends on) and the type of error information, described below. There are currently up to three pieces of info 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.
and it's giving three whole fields, so let's break it down bestie π
err = 1β the 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β the 'Guaranteed' error bound. This is 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. no cap π«Άerr = 3β the reciprocal condition number. This is the estimated componentwise reciprocal condition number. It gets 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.
And how is that Z built, you ask? Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1. iconic scaling behavior honestly β¨
See Lapack Working Note 165 for further details and extra cautions. Read it fr fr, there's lore there π
πΈ NPARAMS πΈ
NPARAMS is INTEGER
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. (so like, it doesn't even get a glance π)
π PARAMS π
PARAMS is REAL array, dimension NPARAMS
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. cute, low-effort, love that for you π
PARAMS(LA_LINRX_ITREF_I = 1)β whether to perform iterative refinement or not.- Default:
1.0 = 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)β maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: set to
100to permit convergence using approximate factorizations or factorizations other thanLU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. β οΈ like, proceed with caution bestie
- Default:
PARAMS(LA_LINRX_CWISE_I = 3)β flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
π¦ WORK π¦
WORK is COMPLEX array, dimension (2*N)
π RWORK π
RWORK is REAL array, dimension (2*N)
β INFO β
INFO is INTEGER
= 0: Successful exit. The solution to every right-hand side is guaranteed. slay π< 0: IfINFO = -i, the i-th argument had an illegal value.> 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 sidesKwithK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallestJsuch thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP. (one report only, the algorithm is not a gossip π )
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ subroutine cgbtf2 π§
subroutine cgbtf2 (integer M, integer N, integer KL, integer KU, complex,
dimension( ldab, * ) AB, integer LDAB, integer, dimension( * ) IPIV,
integer INFO)
CGBTF2 computes the LU factorization of a general band matrix using the unblocked version of the algorithm. (the unblocked one, the scrappy little sibling π«Ά)
β¨ Purpose β¨
CGBTF2 computes an LU factorization of a complex m-by-n band matrix A using partial pivoting with row interchanges.
This is the unblocked version of the algorithm, calling Level 2 BLAS.
π Parameters π
MMisINTEGER- The number of rows of the matrix
A.M >= 0.
NNisINTEGER- The number of columns of the matrix
A.N >= 0.
KLKLisINTEGER- The number of subdiagonals within the band of
A.KL >= 0.
KUKUisINTEGER- The number of superdiagonals within the band of
A.KU >= 0.
ABABisCOMPLEXarray, dimension(LDAB,N)- On entry, the matrix
Ain band storage, in rowsKL+1to2*KL+KU+1; rows1toKLof the array need not be set. - The j-th column of
Ais stored in the j-th column of the arrayABas follows: AB(kl+ku+1+i-j,j) = A(i,j)formax(1,j-ku)<=i<=min(m,j+kl)- On exit, details of the factorization:
Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1. See below for further details.
LDABLDABisINTEGER- The leading dimension of the array
AB.LDAB >= 2*KL+KU+1.
IPIVIPIVisINTEGERarray, dimension(min(M,N))- The pivot indices; for
1 <= i <= min(M,N), rowiof the matrix was interchanged with rowIPIV(i).
INFOINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = +i,U(i,i)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. π danger
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
The band storage scheme is illustrated by the following example, when M = N = 6, KL = 2, KU = 1:
On entry: On exit:
* * * + + + * * * u14 u25 u36
* * + + + + * * u13 u24 u35 u46
* a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 *
a31 a42 a53 a64 * * m31 m42 m53 m64 * *
Array elements marked * are not used by the routine; elements marked + need not be set on entry, but are required by the routine to store elements of U, because of fill-in resulting from the row interchanges.
π₯ subroutine cgbtrf π₯
subroutine cgbtrf (integer M, integer N, integer KL, integer KU, complex,
dimension( ldab, * ) AB, integer LDAB, integer, dimension( * ) IPIV,
integer INFO)
CGBTRF
β¨ Purpose β¨
CGBTRF computes an LU factorization of a complex m-by-n band matrix A using partial pivoting with row interchanges.
This is the blocked version of the algorithm, calling Level 3 BLAS. (glow up unlocked β¨)
π Parameters π
MMisINTEGER- The number of rows of the matrix
A.M >= 0.
NNisINTEGER- The number of columns of the matrix
A.N >= 0.
KLKLisINTEGER- The number of subdiagonals within the band of
A.KL >= 0.
KUKUisINTEGER- The number of superdiagonals within the band of
A.KU >= 0.
ABABisCOMPLEXarray, dimension(LDAB,N)- On entry, the matrix
Ain band storage, in rowsKL+1to2*KL+KU+1; rows1toKLof the array need not be set. - The j-th column of
Ais stored in the j-th column of the arrayABas follows: AB(kl+ku+1+i-j,j) = A(i,j)formax(1,j-ku)<=i<=min(m,j+kl)- On exit, details of the factorization:
Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1. See below for further details.
LDABLDABisINTEGER- The leading dimension of the array
AB.LDAB >= 2*KL+KU+1.
IPIVIPIVisINTEGERarray, dimension(min(M,N))- The pivot indices; for
1 <= i <= min(M,N), rowiof the matrix was interchanged with rowIPIV(i).
INFO
π INFO π
and bestie, this one keeps going β next part's got the rest π
INFOβ INTEGER bestie, here's the whole vibe:= 0: successful exit, we love that for us π< 0: ifINFO = -i, the i-th argument had an illegal value, so something's sus π> 0: ifINFO = +i,U(i,i)is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. NOT the vibe, bestie β division by zero is a crime scene.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
The band storage scheme is illustrated by the following example, when M = N = 6, KL = 2, KU = 1:
The band storage scheme is illustrated by the following example, when
M = N = 6, KL = 2, KU = 1:
On entry: On exit:
* * * + + + * * * u14 u25 u36
* * + + + + * * u13 u24 u35 u46
* a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56
a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66
a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 *
a31 a42 a53 a64 * * m31 m42 m53 m64 * *
Array elements marked * are not used by the routine; elements marked
+ need not be set on entry, but are required by the routine to store
elements of U because of fill-in resulting from the row interchanges.
β¨ subroutine cgbtrs β¨
subroutine cgbtrs (character TRANS, integer N, integer KL, integer KU,
integer NRHS, complex, dimension( ldab, * ) AB, integer LDAB, integer,
dimension( * ) IPIV, complex, dimension( ldb, * ) B, integer LDB,
integer INFO)
CGBTRS
Purpose:
CGBTRS solves a system of linear equations
A * X = B, A**T * X = B, or A**H * X = B
with a general band matrix A using the LU factorization computed
by CGBTRF.
Parameters
TRANSβ CHARACTER*1 bestie, this tells us the form of the system. It can be:'N':A * X = B(No transpose)'T':A**T * X = B(Transpose)'C':A**H * X = B(Conjugate transpose)
Nβ INTEGER the order of the matrixA.N >= 0. Periodt.KLβ INTEGER the number of subdiagonals within the band ofA.KL >= 0.KUβ INTEGER the number of superdiagonals within the band ofA.KU >= 0.NRHSβ INTEGER the number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.ABβ COMPLEX array, dimension (LDAB,N) details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDABβ INTEGER the leading dimension of the arrayAB.LDAB >= 2*KL+KU+1.IPIVβ INTEGER array, dimension (N) the pivot indices; for1 <= i <= N, rowiof the matrix was interchanged with rowIPIV(i).Bβ COMPLEX array, dimension (LDB,NRHS) on entry, the right hand side matrixB. On exit, the solution matrixX.LDBβ INTEGER the leading dimension of the arrayB.LDB >= max(1,N).INFOβ INTEGER exit status, bestie:= 0: successful exit, we ate π< 0: ifINFO = -i, the i-th argument had an illegal value, so fix it π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
β¨ subroutine cggbak β¨
subroutine cggbak (character JOB, character SIDE, integer N, integer ILO,
integer IHI, real, dimension( * ) LSCALE, real, dimension( * ) RSCALE,
integer M, complex, dimension( ldv, * ) V, integer LDV, integer INFO)
CGGBAK
Purpose:
CGGBAK forms the right or left eigenvectors of a complex generalized
eigenvalue problem A*x = lambda*B*x, by backward transformation on
the computed eigenvectors of the balanced pair of matrices output by
CGGBAL.
Parameters
JOBβ CHARACTER*1 specifies the type of backward transformation required:'N': do nothing, return immediately;'P': do backward transformation for permutation only;'S': do backward transformation for scaling only;'B': do backward transformations for both permutation and scaling.JOBmust be the same as the argumentJOBsupplied toCGGBAL.
SIDEβ CHARACTER*1:'R':Vcontains right eigenvectors;'L':Vcontains left eigenvectors.
Nβ INTEGER the number of rows of the matrixV.N >= 0.ILOβ INTEGER bestie, that's it.IHIβ INTEGER the integersILOandIHIdetermined byCGGBAL.1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0.LSCALEβ REAL array, dimension (N) details of the permutations and/or scaling factors applied to the left side ofAandB, as returned byCGGBAL.RSCALEβ REAL array, dimension (N) details of the permutations and/or scaling factors applied to the right side ofAandB, as returned byCGGBAL.Mβ INTEGER the number of columns of the matrixV.M >= 0.Vβ COMPLEX array, dimension (LDV,M) on entry, the matrix of right or left eigenvectors to be transformed, as returned byCTGEVC. On exit,Vis overwritten by the transformed eigenvectors.LDVβ INTEGER the leading dimension of the matrixV.LDV >= max(1,N).INFOβ INTEGER exit status:= 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:
See R.C. Ward, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
β¨ subroutine cggbal β¨
subroutine cggbal (character JOB, integer N, complex, dimension( lda, * ) A,
integer LDA, complex, dimension( ldb, * ) B, integer LDB, integer ILO,
integer IHI, real, dimension( * ) LSCALE, real, dimension( * ) RSCALE,
real, dimension( * ) WORK, integer INFO)
CGGBAL
Purpose:
CGGBAL balances a pair of general complex matrices (A,B). This
involves, first, permuting A and B by similarity transformations to
isolate eigenvalues in the first 1 to ILO$-$1 and last IHI+1 to N
elements on the diagonal; and second, applying a diagonal similarity
transformation to rows and columns ILO to IHI to make the rows
and columns as close in norm as possible. Both steps are optional.
Balancing may reduce the 1-norm of the matrices, and improve the
accuracy of the computed eigenvalues and/or eigenvectors in the
generalized eigenvalue problem A*x = lambda*B*x.
Parameters
JOBβ CHARACTER*1 specifies the operations to be performed onAandB:'N': none: simply setILO = 1,IHI = N,LSCALE(I) = 1.0andRSCALE(I) = 1.0fori=1,...,N;'P': permute only;'S': scale only;'B': both permute and scale.
Nβ INTEGER the order of the matricesAandB.N >= 0.Aβ COMPLEX array, dimension (LDA,N) on entry, the input matrixA. On exit,Ais overwritten by the balanced matrix. IfJOB = 'N',Ais not referenced.LDAβ INTEGER the leading dimension of the arrayA.LDA >= max(1,N).Bβ COMPLEX array, dimension (LDB,N) on entry, the input matrixB. On exit,Bis overwritten by the balanced matrix. IfJOB = 'N',Bis not referenced.LDBβ INTEGER the leading dimension of the arrayB.LDB >= max(1,N).ILOβ INTEGER bestie, that's it.IHIβ INTEGERILOandIHIare set to integers such that on exitA(i,j) = 0andB(i,j) = 0ifi > jandj = 1,...,ILO-1ori = IHI+1,...,N. IfJOB = 'N'or'S',ILO = 1andIHI = N.LSCALEβ REAL array, dimension (N) details of the permutations and scaling factors applied to the left side ofAandB. IfP(j)is the index of the row interchanged with rowj, andD(j)is the scaling factor applied to rowj, then
LSCALE(j) = P(j) for J = 1,...,ILO-1
= D(j) for J = ILO,...,IHI
= P(j) for J = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
RSCALEβ REAL array, dimension (N) details of the permutations and scaling factors applied to the right side ofAandB. IfP(j)is the index of the column interchanged with columnj, andD(j)is the scaling factor applied to columnj, then
RSCALE(j) = P(j) for J = 1,...,ILO-1
= D(j) for J = ILO,...,IHI
= P(j) for J = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
WORKβ REAL array, dimension (lwork)lworkmust be at leastmax(1,6*N)whenJOB = 'S'or'B', and at least1whenJOB = 'N'or'P'.INFOβ INTEGER exit status:= 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.
- NAG Ltd.
Further Details π‘
See R.C. WARD, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.
Like, if you wanna go deeper bestie, the receipts are right there π
subroutine cla_gbamv π¦
subroutine cla_gbamv (integer TRANS, integer M, integer N, integer KL,
integer KU, real ALPHA, complex, dimension( ldab, * ) AB, integer LDAB,
complex, dimension( * ) X, integer INCX, real BETA, real, dimension( * )
Y, integer INCY)
CLA_GBAMV does a matrix-vector operation to calculate error bounds. it's giving very precise, very demure π
Purpose β¨
so basically CLA_GBAMV performs one of these two matrix-vector operations, and you pick which one with TRANS:
y := alpha*abs(A)*abs(x) + beta*abs(y),
or y := alpha*abs(A)**T*abs(x) + beta*abs(y),
where alpha and beta are scalars, x and y are vectors and A is an m by n matrix π
ngl this function's whole job is calculating error bounds. and here's the tea: to protect against underflow while it's evaluating, components in the resulting vector get perturbed away from zero by (N+1) times the underflow threshold π«£ but β and this is the iconic part β to prevent unnecessarily large errors for block-structure embedded in general matrices, 'symbolically' zero components are not perturbed. a zero entry counts as 'symbolic' if all the multiplications involved in computing that entry have at least one zero multiplicand. no cap, that's the rule π
Parameters π
TRANSβTRANSisINTEGER. On entry,TRANSspecifies the operation to be performed as follows:
BLAS_NO_TRANS y := alpha*abs(A)*abs(x) + beta*abs(y)
BLAS_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
BLAS_CONJ_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
Unchanged on exit.
MβMisINTEGER. On entry,Mspecifies the number of rows of the matrixA.Mmust be at least zero. Unchanged on exit.NβNisINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.KLβKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.ALPHAβALPHAisREAL. On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.ABβABisCOMPLEXarray, dimension(LDAB,n). Before entry, the leadingmbynpart of the arrayABmust contain the matrix of coefficients. Unchanged on exit.LDABβLDABisINTEGER. On entry,LDABspecifies the first dimension ofABas declared in the calling (sub) program.LDABmust be at leastmax( 1, m ). Unchanged on exit.XβXisCOMPLEXarray, dimension( 1 + ( n - 1 )*abs( INCX ) )whenTRANS = 'N'or'n'and at least( 1 + ( m - 1 )*abs( INCX ) )otherwise. Before entry, the incremented arrayXmust contain the vectorx. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβBETAisREAL. On entry,BETAspecifies the scalarbeta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YβYisREALarray, dimension( 1 + ( m - 1 )*abs( INCY ) )whenTRANS = 'N'or'n'and at least( 1 + ( n - 1 )*abs( INCY ) )otherwise. Before entry withBETAnon-zero, the incremented arrayYmust contain the vectory. On exit,Yis overwritten by the updated vectory.INCYβINCYisINTEGER. On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit.
Level 2 Blas routine. π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
real function cla_gbrcond_c π§
real function cla_gbrcond_c (character TRANS, integer N, integer KL, integer
KU, complex, dimension( ldab, * ) AB, integer LDAB, complex, dimension(
ldafb, * ) AFB, integer LDAFB, integer, dimension( * ) IPIV, real,
dimension( * ) C, logical CAPPLY, integer INFO, complex, dimension( * )
WORK, real, dimension( * ) RWORK)
CLA_GBRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general banded matrices. she's a math girlie fr fr πβ¨
Purpose πΈ
okay so CLA_GBRCOND_C computes the infinity norm condition number of
op(A) * inv(diag(C))
where C is a REAL vector. periodt π
Parameters π
TRANSβTRANSisCHARACTER*1. Specifies the form of the system of equations:
= 'N': A * X = B (No transpose)
= 'T': A**T * X = B (Transpose)
= 'C': A**H * X = B (Conjugate Transpose = Transpose)
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.KLβKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.ABβABisCOMPLEXarray, dimension(LDAB,N). On entry, the matrixAin band storage, in rows1toKL+KU+1. Thej-th column ofAis stored in thej-th column of the arrayABas follows:
AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
LDABβLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBβAFBisCOMPLEXarray, dimension(LDAFB,N). Details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFBβLDAFBisINTEGER. The leading dimension of the arrayAFB.LDAFB >= 2*KL+KU+1.IPIVβIPIVisINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byCGBTRF; rowiof the matrix was interchanged with rowIPIV(i).CβCisREALarray, dimension(N). The vectorCin the formulaop(A) * inv(diag(C)).CAPPLYβCAPPLYisLOGICAL. If.TRUE.then access the vectorCin the formula above.INFOβINFOisINTEGER.
= 0: Successful exit.
i > 0: The ith argument is invalid.
WORKβWORKisCOMPLEXarray, dimension(2*N). Workspace.RWORKβRWORKisREALarray, dimension(N). Workspace.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
real function cla_gbrcond_x π¦
real function cla_gbrcond_x (character TRANS, integer N, integer KL, integer
KU, complex, dimension( ldab, * ) AB, integer LDAB, complex, dimension(
ldafb, * ) AFB, integer LDAFB, integer, dimension( * ) IPIV, complex,
dimension( * ) X, integer INFO, complex, dimension( * ) WORK, real,
dimension( * ) RWORK)
CLA_GBRCOND_X computes the infinity norm condition number of op(A)*diag(x) for general banded matrices. the _X version, bestie β she's the main character here π
Purpose πΈ
CLA_GBRCOND_X computes the infinity norm condition number of
op(A) * diag(X)
where X is a COMPLEX vector. iconic, honestly π
Parameters π
TRANSβTRANSisCHARACTER*1. Specifies the form of the system of equations:
= 'N': A * X = B (No transpose)
= 'T': A**T * X = B (Transpose)
= 'C': A**H * X = B (Conjugate Transpose = Transpose)
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.KLβKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.ABβABisCOMPLEXarray, dimension(LDAB,N). On entry, the matrixAin band storage, in rows1toKL+KU+1. Thej-th column ofAis stored in thej-th column of the arrayABas follows:
AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)
LDABβLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBβAFBisCOMPLEXarray, dimension(LDAFB,N). Details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFBβLDAFBisINTEGER. The leading dimension of the arrayAFB.LDAFB >= 2*KL+KU+1.IPIVβIPIVisINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byCGBTRF; rowiof the matrix was interchanged with rowIPIV(i).XβXisCOMPLEXarray, dimension(N). The vectorXin the formulaop(A) * diag(X).INFOβINFOisINTEGER.
= 0: Successful exit.
i > 0: The ith argument is invalid.
WORKβWORKisCOMPLEXarray, dimension(2*N). Workspace.RWORKβRWORKisREALarray, dimension(N). Workspace.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
RCONDβ bestie, we were doing so good and then the source text justβ¦ stops π fr fr, this is exactly where the original cuts off β the parameter nameRCONDshows up and then β¨nothingβ¨, no type, no description, no vibe. So the tea on whatRCONDactually does gets spilled in the next part, no cap. Not me gatekeeping a parameter I literally cannot see π
Anyway β that's the edge of what this part has for you. The parameter list is still going, so hold that thought and keep scrolling π«Ά
RCONDβRCOND is REAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. πITHRESHβITHRESH is INTEGER. The maximum number of residual computations allowed for refinement. The default is10. For'aggressive'set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inERR_BNDS_NORMandERR_BNDS_COMPmay no longer be trustworthy. π©RTHRESHβRTHRESH is REAL. Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i)wherenorm(Z)is the infinity norm ofZ.RTHRESHsatisfies0 < RTHRESH <= 1. The default value is0.5. For'aggressive'set to0.9to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. β¨DZ_UBβDZ_UB is REAL. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, which we define as the relative change in each component being less thanDZ_UB. The default value is0.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. Slay. π< 0: ifINFO = -i, theith argument toCGBTRShad an illegal value. π
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
real function cla_gbrpvgrw π
real function cla_gbrpvgrw (integer N, integer KL, integer KU, integer
NCOLS, complex, dimension( ldab, * ) AB, integer LDAB, complex,
dimension( ldafb, * ) AFB, integer LDAFB)
CLA_GBRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a general banded matrix.
Purpose β¨
CLA_GBRPVGRW 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. So if this number is tiny, maybe don't trust those error bounds, bestie. π©
Parameters π
NβN is INTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.KLβKL is INTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUβKU is INTEGER. The number of superdiagonals within the band ofA.KU >= 0.NCOLSβNCOLS is INTEGER. The number of columns of the matrixA.NCOLS >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). On entry, the matrixAin band storage, in rows1toKL+KU+1. Thej-th column ofAis stored in thej-th column of the arrayABas follows:AB(KU+1+i-j,j) = A(i,j)formax(1,j-KU)<=i<=min(N,j+kl)LDABβLDAB is INTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBβAFB is COMPLEX array, dimension (LDAFB,N). Details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFBβLDAFB is INTEGER. The leading dimension of the arrayAFB.LDAFB >= 2*KL+KU+1.
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine cungbr π
subroutine cungbr (character VECT, integer M, integer N, integer K, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) TAU,
complex, dimension( * ) WORK, integer LWORK, integer INFO)
CUNGBR
Purpose β¨
CUNGBR generates one of the complex unitary matrices Q or P**H determined by CGEBRD when reducing a complex matrix A to bidiagonal form: A = Q * B * P**H. Q and P**H are defined as products of elementary reflectors H(i) or G(i) respectively.
If VECT = 'Q', A is assumed to have been an M-by-K matrix, and Q is of order M:
- if
m >= k,Q = H(1) H(2) . . . H(k)andCUNGBRreturns the firstncolumns ofQ, wherem >= n >= k; - if
m < k,Q = H(1) H(2) . . . H(m-1)andCUNGBRreturnsQas anM-by-Mmatrix.
If VECT = 'P', A is assumed to have been a K-by-N matrix, and P**H is of order N:
- if
k < n,P**H = G(k) . . . G(2) G(1)andCUNGBRreturns the firstmrows ofP**H, wheren >= m >= k; - if
k >= n,P**H = G(n-1) . . . G(2) G(1)andCUNGBRreturnsP**Has anN-by-Nmatrix.
Parameters π
VECTβVECT is CHARACTER*1. Specifies whether the matrixQor the matrixP**His required, as defined in the transformation applied byCGEBRD:= 'Q': generateQ;= 'P': generateP**H.
MβM is INTEGER. The number of rows of the matrixQorP**Hto be returned.M >= 0.NβN is INTEGER. The number of columns of the matrixQorP**Hto be returned.N >= 0. IfVECT = 'Q',M >= N >= min(M,K); ifVECT = 'P',N >= M >= min(N,K).KβK is INTEGER. IfVECT = 'Q', the number of columns in the originalM-by-Kmatrix reduced byCGEBRD. IfVECT = 'P', the number of rows in the originalK-by-Nmatrix reduced byCGEBRD.K >= 0.AβA is COMPLEX array, dimension (LDA,N). On entry, the vectors which define the elementary reflectors, as returned byCGEBRD. On exit, theM-by-NmatrixQorP**H.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= M.TAUβTAU is COMPLEX array, dimension(min(M,K))ifVECT = 'Q'(min(N,K))ifVECT = 'P'TAU(i)must contain the scalar factor of the elementary reflectorH(i)orG(i), which determinesQorP**H, as returned byCGEBRDin its array argumentTAUQorTAUP.WORKβWORK is COMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER. The dimension of the arrayWORK.LWORK >= max(1,min(M,N)). For optimum performanceLWORK >= min(M,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βINFO is INTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Author π«Ά
Generated automatically by Doxygen for LAPACK from the source code.
That's the tea, bestie! This page is from LAPACK version 3.11.0, generated on Sun Nov 27 2022 for complexGBcomputational(3). Stay slay, and remember: every flag and parameter matters. π
β¨
π¦ 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