complexOTHERauxiliary(3)
complexOTHERauxiliary(3) β LAPACK manual, bestie π
okay so this is the complexOTHERauxiliary(3) page from the LAPACK manual β¨. Itβs part 1 of 25, so settle in π.
β¨ NAME β¨
complexOTHERauxiliaryβ complex
part 1 of 25, donβt go anywhere π
β¨ SYNOPSIS β¨
β¨ Functions β¨
okay so here's the entire function lineup from this section, bestie. every signature is copied exactly, every description is translated into our language, and absolutely nothing is skipped. π
subroutine clabrd (M, N, NB, A, LDA, D, E, TAUQ, TAUP, X, LDX, Y, LDY)β CLABRD reduces the firstnbrows and columns of a general matrix to a bidiagonal form. it's giving bidiagonal glow-up, no cap. β¨subroutine clacgv (N, X, INCX)β CLACGV conjugates a complex vector. literally just conjugation, periodt. πsubroutine clacn2 (N, V, X, EST, KASE, ISAVE)β CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. iykyk. π₯subroutine clacon (N, V, X, EST, KASE)β CLACON estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. same energy as CLACN2, different signature. πsubroutine clacp2 (UPLO, M, N, A, LDA, B, LDB)β CLACP2 copies all or part of a real two-dimensional array to a complex array. real-to-complex pipeline, slay. π¦subroutine clacpy (UPLO, M, N, A, LDA, B, LDB)β CLACPY copies all or part of one two-dimensional array to another. it's the copy-paste icon. πsubroutine clacrm (M, N, A, LDA, B, LDB, C, LDC, RWORK)β CLACRM multiplies a complex matrix by a square real matrix. complex meets real, and they ate. π₯subroutine clacrt (N, CX, INCX, CY, INCY, C, S)β CLACRT performs a linear transformation of a pair of complex vectors. transformation? main character energy. πcomplex function cladiv (X, Y)β CLADIV performs complex division in real arithmetic, avoiding unnecessary overflow. she's careful, she's precise, she's not overflowing. πsubroutine claein (RIGHTV, NOINIT, N, H, LDH, W, V, B, LDB, RWORK, EPS3, SMLNUM, INFO)β CLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iteration. eigenvector hunt, fr fr. πΈsubroutine claev2 (A, B, C, RT1, RT2, CS1, SN1)β CLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. tiny matrix, big output. β¨subroutine clags2 (UPPER, A1, A2, A3, B1, B2, B3, CSU, SNU, CSV, SNV, CSQ, SNQ)β CLAGS2 β okay the original description is literally justCLAGS2. that's it. no extra lore, bestie. πsubroutine clagtm (TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA, B, LDB)β CLAGTM performs a matrix-matrix product of the formC = Ξ±AB+Ξ²C, where A is a tridiagonal matrix, B and C are rectangular matrices, and Ξ± and Ξ² are scalars, which may be 0, 1, or -1. math but make it tridiagonal. π₯subroutine clahqr (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, INFO)β CLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. QR algorithm, but make it double-shift/single-shift. πsubroutine clahr2 (N, K, NB, A, LDA, TAU, T, LDT, Y, LDY)β CLAHR2 reduces the specified number of first columns of a general rectangular matrix A so that elements below the specified subdiagonal are zero, and returns auxiliary matrices which are needed to apply the transformation to the unreduced part of A. reduction with receipts. π§subroutine claic1 (JOB, J, X, SEST, W, GAMMA, SESTPR, S, C)β CLAIC1 applies one step of incremental condition estimation. one step, but make it incremental. π«real function clangt (NORM, N, DL, D, DU)β CLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix. norm options on deck. πreal function clanhb (NORM, UPLO, N, K, AB, LDAB, WORK)β CLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix. Hermitian band matrix, normed. πΆreal function clanhp (NORM, UPLO, N, AP, WORK)β CLANHP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix supplied in packed form. packed form, unpacked norms. πreal function clanhs (NORM, N, A, LDA, WORK)β CLANHS returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of an upper Hessenberg matrix. Hessenberg norms, no cap. π₯real function clanht (NORM, N, D, E)β CLANHT returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian tridiagonal matrix. tridiagonal Hermitian, normed. πreal function clansb (NORM, UPLO, N, K, AB, LDAB, WORK)β CLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix. symmetric band, norm vibes. πreal function clansp (NORM, UPLO, N, AP, WORK)β CLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form. packed symmetric, normed. π¦real function clantb (NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)β CLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix. triangular band, normed. πΊreal function clantp (NORM, UPLO, DIAG, N, AP, WORK)β CLANTP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular matrix supplied in packed form. triangular packed, normed. πreal function clantr (NORM, UPLO, DIAG, M, N, A, LDA, WORK)β CLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix. trapezoidal or triangular, normed. πsubroutine clapll (N, X, INCX, Y, INCY, SSMIN)β CLAPLL measures the linear dependence of two vectors. are they dependent? let's measure. πsubroutine clapmr (FORWRD, M, N, X, LDX, K)β CLAPMR rearranges rows of a matrix as specified by a permutation vector. row shuffle, as requested. πsubroutine clapmt (FORWRD, M, N, X, LDX, K)β CLAPMT performs a forward or backward permutation of the columns of a matrix. column shuffle, forward or backward. πsubroutine claqhb (UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED)β CLAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ. scaling factors fromcpbequ, periodt. βοΈsubroutine claqhp (UPLO, N, AP, S, SCOND, AMAX, EQUED)β CLAQHP scales a Hermitian matrix stored in packed form. packed Hermitian, scaled. πsubroutine claqp2 (M, N, OFFSET, A, LDA, JPVT, TAU, VN1, VN2, WORK)β CLAQP2 computes a QR factorization with column pivoting of the matrix block. QR with column pivoting, block edition. π§±subroutine claqps (M, N, OFFSET, NB, KB, A, LDA, JPVT, TAU, VN1, VN2, AUXV, F, LDF)β CLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BLAS level 3. one step, BLAS level 3 energy. β‘subroutine claqr0 (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO)β CLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. eigenvalues, optional Schur matrices. πsubroutine claqr1 (N, H, LDH, S1, S2, V)β CLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts. small matrix, big shift energy. π₯subroutine claqr2 (WANTT, WANTZ, N, KTOP, KBOT, NW, H, LDH, ILOZ, IHIZ, Z, LDZ, NS, ND, SH, V, LDV, NH, T, LDT, NV, WV, LDWV, WORK, LWORK)β CLAQR2 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). aggressive early deflation, she's not waiting. πsubroutine claqr3 (WANTT, WANTZ, N, KTOP, KBOT, NW, H, LDH, ILOZ, IHIZ, Z, LDZ, NS, ND, SH, V, LDV, NH, T, LDT, NV, WV, LDWV, WORK, LWORK)β CLAQR3 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). same as CLAQR2, still aggressive, still early. β‘subroutine claqr4 (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO)β CLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. eigenvalues and optional Schur matrices, again. πsubroutine claqr5 (WANTT, WANTZ, KACC22, N, KTOP, KBOT, NSHFTS, S, H, LDH, ILOZ, IHIZ, Z, LDZ, V, LDV, U, LDU, NV, WV, LDWV, NH, WH, LDWH)β CLAQR5 performs a single small-bulge multi-shift QR sweep. small bulge, multi-shift, single sweep. πsubroutine claqsb (UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED)β CLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ. scaling factors fromspbequ. βοΈsubroutine claqsp (UPLO, N, AP, S, SCOND, AMAX, EQUED)β CLAQSP scales a symmetric/Hermitian matrix in packed storage, using scaling factors computed by sppequ. packed storage,sppequscaling factors. πsubroutine clar1v (N, B1, BN, LAMBDA, D, L, LD, LLD, PIVMIN, GAPTOL, Z, WANTNC, NEGCNT, ZTZ, MINGMA, R, ISUPPZ, NRMINV, RESID, RQCORR, WORK)β CLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the tridiagonal matrixLDLT - Ξ»I. inverse column, scaled, r-th, tridiagonal. πsubroutine clar2v (N, X, Y, Z, INCX, C, S, INCC)β CLAR2V applies a vector of plane rotations with real cosines and complex sines from both sides to a sequence of 2-by-2 symmetric/Hermitian matrices. plane rotations, both sides, 2-by-2. π¦subroutine clarcm (M, N, A, LDA, B, LDB, C, LDC, RWORK)β CLARCM copies all or part of a real two-dimensional array to a complex array. real to complex copy, again but different name. πsubroutine clarf (SIDE, M, N, V, INCV, TAU, C, LDC, WORK)β CLARF applies an elementary reflector to a general rectangular matrix. elementary reflector, rectangular matrix, done. β¨subroutine clarfb (SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, T, LDT, C, LDC, WORK, LDWORK)β CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix. block reflector or conjugate-transpose, choose your fighter. πsubroutine clarfb_gett (IDENT, M, N, K, T, LDT, A, LDA, B, LDB, WORK, LDWORK)β CLARFB_GETT β the original gives us nothing but the name here. no description, no crumbs. πsubroutine clarfg (N, ALPHA, X, INCX, TAU)β CLARFG generates an elementary reflector (Householder matrix). Householder matrix, generated. πsubroutine clarfgp (N, ALPHA, X, INCX, TAU)β CLARFGP generates an elementary reflector (Householder matrix) with non-negative beta. same Householder energy, but beta is non-negative. πsubroutine clarft (DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT)β CLARFT forms the triangular factor T of a block reflectorH = I - vtvH. triangular factor T, block reflector, no cap. πΊsubroutine clarfx (SIDE, M, N, V, TAU, C, LDC, WORK)β CLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the reflector has order β€ 10. loop unrolling when order β€ 10, she's optimized. β‘subroutine clarfy (UPLO, N, V, INCV, TAU, C, LDC, WORK)β CLARFY β again, the original description is just the name. that's all, bestie. πsubroutine clargv (N, X, INCX, Y, INCY, C, INCC)β CLARGV generates a vector of plane rotations with real cosines and complex sines. plane rotations, real cosines, complex sines. π‘subroutine clarnv (IDIST, ISEED, N, X)β CLARNV returns a vector of random numbers from a uniform or normal distribution. random numbers, uniform or normal. π²subroutine clarrv (N, VL, VU, D, L, PIVMIN, ISPLIT, M, DOL, DOU, MINRGP, RTOL1, RTOL2, W, WERR, WGAP, IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ, WORK, IWORK, INFO)β CLARRV computes the eigenvectors of the tridiagonal matrixT = L D LTgiven L, D and the eigenvalues ofL D LT. eigenvectors from tridiagonal, given L, D, and eigenvalues. πΈsubroutine clartv (N, X, INCX, Y, INCY, C, S, INCC)β CLARTV applies a vector of plane rotations with real cosines and complex sines to the elements of a pair of vectors. plane rotations to a pair of vectors. πsubroutine clascl (TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)β CLASCL multiplies a general rectangular matrix by a real scalar defined ascto/cfrom. scalar iscto/cfrom, matrix gets multiplied. βοΈsubroutine claset (UPLO, M, N, ALPHA, BETA, A, LDA)β CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. off-diagonal and diagonal get set. π―subroutine clasr (SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA)β CLASR applies a sequence of plane rotations to a general rectangular matrix. sequence of plane rotations, rectangular matrix. π‘subroutine claswp(N, A, LDA, K1, K2, IPIV, INCX)β CLASWP does a whole bunch of row swaps on a general rectangular matrix. like, a series of them. bestie it's swapping rows. that's the whole gig. π«subroutine clatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)β CLATBS solves a triangular banded system of equations. triangular, banded, solved. slay. πsubroutine clatdf(IJOB, N, Z, LDZ, RHS, RDSUM, RDSCAL, IPIV, JPIV)β CLATDF takes the LU factorization of the n-by-n matrix thatsgetc2computed and works out a contribution to the reciprocal Dif-estimate. yes it's giving niche but we respect it. β¨subroutine clatps(UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)β CLATPS solves a triangular system of equations, but the matrix is held in packed storage. compact queen. πsubroutine clatrd(UPLO, N, NB, A, LDA, E, TAU, W, LDW)β CLATRD reduces the firstnbrows and columns of a symmetric/Hermitian matrixAdown to real tridiagonal form using a unitary similarity transformation. glow down fr. π¦subroutine clatrs(UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE, CNORM, INFO)β CLATRS solves a triangular system of equations with the scale factor set so it literally cannot overflow. safety first, always. π₯subroutine clauu2(UPLO, N, A, LDA, INFO)β CLAUU2 computes the productUUHorLHL, whereUandLare upper or lower triangular matrices. this one's the unblocked algorithm, fyi. π§subroutine clauum(UPLO, N, A, LDA, INFO)β CLAUUM computes the productUUHorLHL, whereUandLare upper or lower triangular matrices. and this one is the blocked algorithm. same job, different vibe. πsubroutine crot(N, CX, INCX, CY, INCY, C, S)β CROT applies a plane rotation to a pair of complex vectors, with a real cosine and a complex sine. okay mixologist. πsubroutine cspmv(UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)β CSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix. πΈsubroutine cspr(UPLO, N, ALPHA, X, INCX, AP)β CSPR performs the symmetrical rank-1 update of a complex symmetric packed matrix. β¨subroutine csrscl(N, SA, SX, INCX)β CSRSCL multiplies a vector by the reciprocal of a real scalar. divide-and-conquer but make it multiply. πsubroutine ctprfb(SIDE, TRANS, DIRECT, STOREV, M, N, K, L, V, LDV, T, LDT, A, LDA, B, LDB, WORK, LDWORK)β CTPRFB applies a complex 'triangular-pentagonal' block reflector to a complex matrix, and that matrix is composed of two blocks. pentagonal?? iconic honestly. π«Άinteger function icmax1(N, CX, INCX)β ICMAX1 finds the index of the first vector element of maximum absolute value. first, not last. remember that. βinteger function ilaclc(M, N, A, LDA)β ILACLC scans a matrix for its last non-zero column. where's the last one bestie. πinteger function ilaclr(M, N, A, LDA)β ILACLR scans a matrix for its last non-zero row. same energy, other axis. πinteger function izmax1(N, ZX, INCX)β IZMAX1 finds the index of the first vector element of maximum absolute value. πreal function scsum1(N, CX, INCX)β SCSUM1 forms the 1-norm of the complex vector using the true absolute value. no shortcuts, only truth. π
β¨ Detailed Description β¨
This is the group of complex other auxiliary routines. the complex-other-auxiliary-outines girlies. we contain multitudes. π
π Function Documentation π
subroutine clabrd (integer M, integer N, integer NB, complex, dimension( lda, * ) A, integer LDA, real, dimension( * ) D, real, dimension( * ) E, complex, dimension( * ) TAUQ, complex, dimension( * ) TAUP, complex, dimension( ldx, * ) X, integer LDX, complex, dimension( ldy, * ) Y, integer LDY)
CLABRD reduces the first nb rows and columns of a general matrix to a bidiagonal form. π
Purpose
CLABRD reduces the first NB rows and columns of a complex general m by n matrix A to upper or lower real bidiagonal form by a unitary transformation Q**H * A * P, and returns the matrices X and Y which are needed to apply the transformation to the unreduced part of A.
If m >= n, A is reduced to upper bidiagonal form; if m < n, to lower bidiagonal form.
This is an auxiliary routine called by CGEBRD. (so like, it's the support act, but it ate. π)
Parameters
M
M is INTEGER The number of rows in the matrix A.
N
N is INTEGER The number of columns in the matrix A.
NB
NB is INTEGER The number of leading rows and columns of A to be reduced.
A
A is COMPLEX array, dimension (LDA,N) On entry, the m by n general matrix to be reduced. On exit, the first NB rows and columns of the matrix are overwritten; the rest of the array is unchanged. If m >= n, elements on and below the diagonal in the first NB columns, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors; and elements above the diagonal in the first NB rows, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors. If m < n, elements below the diagonal in the first NB columns, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors, and elements on and above the diagonal in the first NB rows, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors. See Further Details.
LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M).
D
D is REAL array, dimension (NB) The diagonal elements of the first NB rows and columns of the reduced matrix. D(i) = A(i,i).
E
E is REAL array, dimension (NB) The off-diagonal elements of the first NB rows and columns of the reduced matrix.
TAUQ
TAUQ is COMPLEX array, dimension (NB) The scalar factors of the elementary reflectors which represent the unitary matrix Q. See Further Details.
TAUP
TAUP is COMPLEX array, dimension (NB) The scalar factors of the elementary reflectors which represent the unitary matrix P. See Further Details.
X
X is COMPLEX array, dimension (LDX,NB) The m-by-nb matrix X required to update the unreduced part of A.
LDX
LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).
Y
Y is COMPLEX array, dimension (LDY,NB) The n-by-nb matrix Y required to update the unreduced part of A.
LDY
LDY is INTEGER The leading dimension of the array Y. LDY >= max(1,N).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details
The matrices Q and P are represented as products of elementary reflectors:
Q = H(1) H(2) . . . H(nb) and P = G(1) G(2) . . . G(nb)
Each H(i) and G(i) has the form:
H(i) = I - tauq * v * v**H and G(i) = I - taup * u * u**H
where tauq and taup are complex scalars, and v and u are complex vectors.
If m >= n, v(1:i-1) = 0, v(i) = 1, and v(i:m) is stored on exit in A(i:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i).
If m < n, v(1:i) = 0, v(i+1) = 1, and v(i+1:m) is stored on exit in A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i:n) is stored on exit in A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i).
The elements of the vectors v and u together form the m-by-nb matrix V and the nb-by-n matrix U**H which are needed, with X and Y, to apply the transformation to the unreduced part of the matrix, using a block update of the form: A := A - V*Y**H - X*U**H.
The contents of A on exit are illustrated by the following examples with nb = 2:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( 1 1 u1 u1 u1 ) ( 1 u1 u1 u1 u1 u1 )
( v1 1 1 u2 u2 ) ( 1 1 u2 u2 u2 u2 )
( v1 v2 a a a ) ( v1 1 a a a a )
( v1 v2 a a a ) ( v1 v2 a a a a )
( v1 v2 a a a ) ( v1 v2 a a a a )
( v1 v2 a a a )
where a denotes an element of the original matrix which is unchanged, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i).
subroutine clacgv (integer N, complex, dimension( * ) X, integer INCX)
CLACGV conjugates a complex vector. that's it, that's the function, and it devoured. π
Purpose
CLACGV conjugates a complex vector of length N.
Parameters
N
N is INTEGER The length of the vector X. N >= 0.
X
X is COMPLEX array, dimension (1+(N-1)*abs(INCX)) On entry, the vector of length N to be conjugated. On exit, X is overwritten with conjg(X).
INCX
INCX is INTEGER The spacing between successive elements of X.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clacn2 (integer N, complex, dimension( * ) V, complex, dimension( * ) X, real EST, integer KASE, integer, dimension( 3 ) ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. reverse communication?? the way that it hands the work back to you. πβ¨
Purpose
CLACN2 estimates the 1-norm of a square, complex matrix A. Reverse communication is used for evaluating matrix-vector products.
Parameters
N
N is INTEGER The order of the matrix. N >= 1.
V
V is COMPLEX array, dimension (N) On the final return, V = A*W, where EST = norm(V)/norm(W) (W is not returned). rude of it honestly. π
X
X is COMPLEX array, dimension (N) On an intermediate return, X should be overwritten by
A * X, if KASE=1,
A**H * X, if KASE=2,
where A**H is the conjugate transpose of A, and CLACN2 must be re-called with all the other parameters unchanged.
EST
EST is REAL On entry with KASE = 1 or 2 and ISAVE(1) = 3, EST should be unchanged from the previous call to CLACN2. On exit, EST is an estimate (a lower bound) for norm(A).
KASEKASEβKASEis INTEGER. First call? Set it to0, bestie. On an intermediate return it'll come back as1or2, and that's literally the universe telling you whetherXshould be overwritten byA * XorA**H * X. On the final return fromCLACN2,KASEgoes right back to0. Full circle. π¦ISAVEβISAVEis INTEGER array, dimension (3). It's the little memory box that saves variables between calls toSLACN2. π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π
Originally named CONEST, dated March 16, 1988.
Last modified: April, 1999
This is a thread safe version of CLACON, which uses the array ISAVE in place of a SAVE statement, as follows:
CLACON CLACN2
JUMP ISAVE(1)
J ISAVE(2)
ITER ISAVE(3)
Contributors: π«Ά
Nick Higham, University of Manchester
References: π
N.J. Higham, 'FORTRAN codes for estimating the one-norm of a real or complex matrix, with applications to condition estimation', ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.
subroutine clacon (integer N, complex, dimension( n ) V, complex, dimension( n ) X, real EST, integer KASE)
CLACON estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. So iconic of it. β¨
Purpose:
CLACON estimates the 1-norm of a square, complex matrix A. Reverse communication is used for evaluating matrix-vector products.
Parameters πΈ
NβNis INTEGER. The order of the matrix.N >= 1.VβVis COMPLEX array, dimension (N). On the final return,V = A*W, whereEST = norm(V)/norm(W)(Wis not returned). Rude ofWhonestly but okay. πXβXis COMPLEX array, dimension (N). On an intermediate return,Xshould be overwritten by
A * X, if KASE=1,
A**H * X, if KASE=2,
where A**H is the conjugate transpose of A, and CLACON must be re-called with all the other parameters unchanged.
ESTβESTis REAL. On entry withKASE = 1or2andJUMP = 3,ESTshould be unchanged from the previous call toCLACON. On exit,ESTis an estimate (a lower bound) fornorm(A).KASEβKASEis INTEGER. On the initial call toCLACON,KASEshould be0. On an intermediate return,KASEwill be1or2, indicating whetherXshould be overwritten byA * XorA**H * X. On the final return fromCLACON,KASEwill again be0.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
Originally named CONEST, dated March 16, 1988.
Last modified: April, 1999
Contributors: π«Ά
Nick Higham, University of Manchester
References: π
N.J. Higham, 'FORTRAN codes for estimating the one-norm of a real or complex matrix, with applications to condition estimation', ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.
subroutine clacp2 (character UPLO, integer M, integer N, real, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB)
CLACP2 copies all or part of a real two-dimensional array to a complex array. Copy-paste but make it β¨complexβ¨.
Purpose:
CLACP2 copies all or part of a real two-dimensional matrix A to a complex matrix B.
Parameters π
UPLOβUPLOis CHARACTER*1. Specifies the part of the matrixAto be copied toB.
= 'U': Upper triangular part
= 'L': Lower triangular part
Otherwise: All of the matrix A
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.N >= 0.AβAis REAL array, dimension (LDA,N). The m by n matrixA. IfUPLO = 'U', only the upper trapezium is accessed; ifUPLO = 'L', only the lower trapezium is accessed. Trapezium only, no cap. π¦LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis COMPLEX array, dimension (LDB,N). On exit,B = Ain the locations specified byUPLO.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,M).
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clacpy (character UPLO, integer M, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB)
CLACPY copies all or part of one two-dimensional array to another. The blueprint behavior we all deserve. π
Purpose:
CLACPY copies all or part of a two-dimensional matrix A to another matrix B.
Parameters π
UPLOβUPLOis CHARACTER*1. Specifies the part of the matrixAto be copied toB.
= 'U': Upper triangular part
= 'L': Lower triangular part
Otherwise: All of the matrix A
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.N >= 0.AβAis COMPLEX array, dimension (LDA,N). The m by n matrixA. IfUPLO = 'U', only the upper trapezium is accessed; ifUPLO = 'L', only the lower trapezium is accessed.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis COMPLEX array, dimension (LDB,N). On exit,B = Ain the locations specified byUPLO.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,M).
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clacrm (integer M, integer N, complex, dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer LDB, complex, dimension( ldc, * ) C, integer LDC, real, dimension( * ) RWORK)
CLACRM multiplies a complex matrix by a square real matrix. Mixing worlds, main character energy only. π
Purpose:
CLACRM performs a very simple matrix-matrix multiplication:
C := A * B,
where A is M by N and complex; B is N by N and real; C is M by N and complex.
Parameters β
MβMis INTEGER. The number of rows of the matrixAand of the matrixC.M >= 0.NβNis INTEGER. The number of columns and rows of the matrixBand the number of columns of the matrixC.N >= 0.AβAis COMPLEX array, dimension (LDA, N). On entry,Acontains the M by N matrixA.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >=max(1,M).BβBis REAL array, dimension (LDB, N). On entry,Bcontains the N by N matrixB.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >=max(1,N).CβCis COMPLEX array, dimension (LDC, N). On exit,Ccontains the M by N matrixC.LDCβLDCis INTEGER. The leading dimension of the arrayC.LDC >=max(1,N).RWORKβRWORKis REAL array, dimension (2*M*N).
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clacrt (integer N, complex, dimension( * ) CX, integer INCX, complex, dimension( * ) CY, integer INCY, complex C, complex S)
CLACRT performs a linear transformation of a pair of complex vectors. A glow-up for two vectors at once, fr fr. β¨
Purpose:
CLACRT performs the operation
( c s )( x ) ==> ( x )
( -s c )( y ) ( y )
where c and s are complex and the vectors x and y are complex.
Parameters πΈ
NβNis INTEGER. The number of elements in the vectorsCXandCY.CXβCXis COMPLEX array, dimension (N). On input, the vectorx. On output,CXis overwritten withc*x + s*y.INCXβINCXis INTEGER. The increment between successive values ofCX.INCX <> 0.CYβCYis COMPLEX array, dimension (N). On input, the vectory. On output,CYis overwritten with-s*x + c*y.INCYβINCYis INTEGER. The increment between successive values ofCY.INCY <> 0.CβCis COMPLEX.SβSis COMPLEX.CandSdefine the matrix
[ C S ].
[ -S C ]
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
complex function cladiv (complex X, complex Y)
CLADIV performs complex division in real arithmetic, avoiding unnecessary overflow. She's careful, she's precise, she's not letting anything spill over. π«Ά
Purpose:
CLADIV := X / Y, where X and Y are complex. The computation of X / Y will not overflow on an intermediary step unless the results overflows.
Parameters π
XβXis COMPLEX.YβYis COMPLEX. The complex scalarsXandY.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine claein (logical RIGHTV, logical NOINIT, integer N, complex, dimension( ldh, * ) H, integer LDH, complex W, complex, dimension( * ) V, complex, dimension( ldb, * ) B, integer LDB, real, dimension( * ) RWORK, real EPS3, real SMLNUM, integer INFO)
CLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iteration. Eigenvector hunting era. π₯
Purpose:
CLAEIN uses inverse iteration to find a right or left eigenvector corresponding to the eigenvalue W of a complex upper Hessenberg matrix H.
Parameters π
RIGHTVRIGHTVisLOGICAL. Bestie, this is the fork in the road π := .TRUE.β we compute the right eigenvector;= .FALSE.β we compute the left eigenvector.NOINITisLOGICAL. Did you bring a starter or not π«Ά:= .TRUE.β no initial vector supplied inV;= .FALSE.β initial vector supplied inV.NisINTEGER. The order of the matrixH.N >= 0.HisCOMPLEX array, dimension (LDH,N). The upper Hessenberg matrixH. She's giving upper Hessenberg, no cap.LDHisINTEGER. The leading dimension of the arrayH.LDH >= max(1,N).WisCOMPLEX. The eigenvalue ofHwhose corresponding right or left eigenvector is to be computed. This is THE girl we're chasing π.VisCOMPLEX array, dimension (N). On entry, ifNOINIT = .FALSE.,Vmust contain a starting vector for inverse iteration; otherwiseVneed not be set. On exit,Vcontains the computed eigenvector, normalized so that the component of largest magnitude has magnitude 1; here the magnitude of a complex number(x,y)is taken to be|x| + |y|. Iconic exit behaviour honestly.BisCOMPLEX array, dimension (LDB,N).LDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).RWORKisREAL array, dimension (N).EPS3isREAL. A small machine-dependent value which is used to perturb close eigenvalues, and to replace zero pivots. Tiny but she's doing SO much work β¨.SMLNUMisREAL. A machine-dependent value close to the underflow threshold.INFOisINTEGER. The vibe report at the end:= 0: successful exit π= 1: inverse iteration did not converge;Vis set to the last iterate.
Not converging is not a fail, bestie, it's just a "we ran out of patience" moment β V still gets the last iterate, so you at least have something to look at. π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine claev2 (complex A, complex B, complex C, real RT1, real RT2, real CS1, complex SN1) π
CLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Tiny matrix, huge main character energy π.
Purpose:
CLAEV2 computes the eigendecomposition of a 2-by-2 Hermitian matrix
[ A B ]
[ CONJG(B) C ].
On return, RT1 is the eigenvalue of larger absolute value, RT2 is the eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right eigenvector for RT1, giving the decomposition
[ CS1 CONJG(SN1) ] [ A B ] [ CS1 -CONJG(SN1) ] = [ RT1 0 ]
[-SN1 CS1 ] [ CONJG(B) C ] [ SN1 CS1 ] [ 0 RT2 ].
Parameters
AisCOMPLEX. The(1,1)element of the 2-by-2 matrix.BisCOMPLEX. The(1,2)element and the conjugate of the(2,1)element of the 2-by-2 matrix.CisCOMPLEX. The(2,2)element of the 2-by-2 matrix.RT1isREAL. The eigenvalue of larger absolute value.RT2isREAL. The eigenvalue of smaller absolute value.CS1isREAL.SN1isCOMPLEX. The vector(CS1, SN1)is a unit right eigenvector forRT1.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
RT1is accurate to a few ulps barring over/underflow.RT2may be inaccurate if there is massive cancellation in the determinantA*C-B*B; higher precision or correctly rounded or correctly truncated arithmetic would be needed to computeRT2accurately in all cases. Yeah she's the messy one π.CS1andSN1are accurate to a few ulps barring over/underflow.- Overflow is possible only if
RT1is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceedsunderflow_threshold / macheps.
subroutine clags2 (logical UPPER, real A1, complex A2, real A3, real B1, complex B2, real B3, real CSU, complex SNU, real CSV, complex SNV, real CSQ, complex SNQ) π¦
CLAGS2 (that's literally all the tagline says, she's mysterious like that π).
Purpose:
CLAGS2 computes 2-by-2 unitary matrices U, V and Q, such that if ( UPPER ) then
U**H *A*Q = U**H *( A1 A2 )*Q = ( x 0 )
( 0 A3 ) ( x x )
and
V**H*B*Q = V**H *( B1 B2 )*Q = ( x 0 )
( 0 B3 ) ( x x )
or if ( .NOT.UPPER ) then
U**H *A*Q = U**H *( A1 0 )*Q = ( x x )
( A2 A3 ) ( 0 x )
and
V**H *B*Q = V**H *( B1 0 )*Q = ( x x )
( B2 B3 ) ( 0 x )
where
U = ( CSU SNU ), V = ( CSV SNV ),
( -SNU**H CSU ) ( -SNV**H CSV )
Q = ( CSQ SNQ )
( -SNQ**H CSQ )
The rows of the transformed A and B are parallel. Moreover, if the input 2-by-2 matrix A is not zero, then the transformed (1,1) entry of A is not zero. If the input matrices A and B are both not zero, then the transformed (2,2) element of B is not zero, except when the first rows of input A and B are parallel and the second rows are zero. Very specific, very demure π.
Parameters
UPPERisLOGICAL.= .TRUE.: the input matricesAandBare upper triangular.= .FALSE.: the input matricesAandBare lower triangular.A1isREAL.A2isCOMPLEX.A3isREAL. On entry,A1,A2andA3are elements of the input 2-by-2 upper (lower) triangular matrixA.B1isREAL.B2isCOMPLEX.B3isREAL. On entry,B1,B2andB3are elements of the input 2-by-2 upper (lower) triangular matrixB.CSUisREAL.SNUisCOMPLEX. The desired unitary matrixU.CSVisREAL.SNVisCOMPLEX. The desired unitary matrixV.CSQisREAL.SNQisCOMPLEX. The desired unitary matrixQ.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clagtm (character TRANS, integer N, integer NRHS, real ALPHA, complex, dimension( * ) DL, complex, dimension( * ) D, complex, dimension( * ) DU, complex, dimension( ldx, * ) X, integer LDX, real BETA, complex, dimension( ldb, * ) B, integer LDB) π₯
CLAGTM performs a matrix-matrix product of the form C = Ξ±AB+Ξ²C, where A is a tridiagonal matrix, B and C are rectangular matrices, and Ξ± and Ξ² are scalars, which may be 0, 1, or -1. Look at her, doing algebra with Greek letters and absolutely slaying it β¨.
Purpose:
CLAGTM performs a matrix-vector product of the form
B := alpha * A * X + beta * B
where A is a tridiagonal matrix of order N, B and X are N by NRHS matrices, and alpha and beta are real scalars, each of which may be 0., 1., or -1..
Parameters
TRANSisCHARACTER*1. Specifies the operation applied toA.= 'N': No transpose,B := alpha * A * X + beta * B= 'T': Transpose,B := alpha * A**T * X + beta * B= 'C': Conjugate transpose,B := alpha * A**H * X + beta * B
NisINTEGER. The order of the matrixA.N >= 0.NRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesXandB.ALPHAisREAL. The scalaralpha.ALPHAmust be0.,1., or-1.; otherwise, it is assumed to be0. Rude of it to just silently assume, but okay π.DLisCOMPLEX array, dimension (N-1). The(n-1)sub-diagonal elements ofT.DisCOMPLEX array, dimension (N). The diagonal elements ofT.DUisCOMPLEX array, dimension (N-1). The(n-1)super-diagonal elements ofT.XisCOMPLEX array, dimension (LDX,NRHS). TheNbyNRHSmatrixX.LDXisINTEGER. The leading dimension of the arrayX.LDX >= max(N,1).BETAisREAL. The scalarbeta.BETAmust be0.,1., or-1.; otherwise, it is assumed to be1.BisCOMPLEX array, dimension (LDB,NRHS). On entry, theNbyNRHSmatrixB. On exit,Bis overwritten by the matrix expressionB := alpha * A * X + beta * B.LDBisINTEGER. The leading dimension of the arrayB.LDB >= max(N,1).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine clahqr (logical WANTT, logical WANTZ, integer N, integer ILO, integer IHI, complex, dimension( ldh, * ) H, integer LDH, complex, dimension( * ) W, integer ILOZ, integer IHIZ, complex, dimension( ldz, * ) Z, integer LDZ, integer INFO) π
CLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. The algorithm name alone is a whole aesthetic, fr fr π
.
Purpose:
CLAHQR is an auxiliary routine called by CHSEQR to update the eigenvalues and Schur decomposition already computed by CHSEQR, by dealing with the Hessenberg submatrix in rows and columns ILO to IHI. She's the supporting actress who eats every scene, honestly.
Parameters
WANTTisLOGICAL.= .TRUE.: the full Schur formTis required;= .FALSE.: only eigenvalues are required.WANTZisLOGICAL.= .TRUE.: the matrix of Schur vectorsZis required;= .FALSE.: Schur vectors are not required.NisINTEGER. The order of the matrixH.N >= 0.ILOisINTEGER.IHIIHIβ INTEGER, bestie. The vibe here is: H is already assumed upper triangular in rows and columnsIHI+1:N, andH(ILO,ILO-1) = 0(unlessILO = 1, bestie, no exceptions).CLAHQRmostly does its thing with the Hessenberg submatrix sitting in rows and columnsILOtoIHI, but it'll reach out and apply transformations to all of H ifWANTTis.TRUE.. The rules:1 <= ILO <= max(1,IHI)andIHI <= N. πHβ COMPLEX array, dimension(LDH,N). On entry, this is the upper Hessenberg matrix H. On exit β and this is where it gets spicy β ifINFOis zero andWANTTis.TRUE., then H is upper triangular in rows and columnsILO:IHI. IfINFOis zero andWANTTis.FALSE., then the contents of H are unspecified on exit (so don't come crying to her about it, she warned you). The output state of H in caseINFis positive? That's explained down below under theINFOdescription. β¨LDHβ INTEGER. The leading dimension of the array H.LDH >= max(1,N). That's the whole tea. π«ΆWβ COMPLEX array, dimension(N). The computed eigenvaluesILOtoIHIget stored in the corresponding elements of W. IfWANTTis.TRUE., those eigenvalues are stored in the same order as on the diagonal of the Schur form returned in H, withW(i) = H(i,i). Iconic, lowkey. πΈILOZβ INTEGER. That's it. That's the description. Sometimes the manpage just vibes and says nothing. πIHIZβ INTEGER. This one specifies the rows of Z that transformations must be applied to, ifWANTZis.TRUE.. Rules of the road:1 <= ILOZ <= ILOandIHI <= IHIZ <= N. πZβ COMPLEX array, dimension(LDZ,N). IfWANTZis.TRUE., then on entry Z must contain the current matrix Z of transformations accumulated byCHSEQR, and on exit Z has been updated. The transformations only get applied to the submatrixZ(ILOZ:IHIZ,ILO:IHI)β not the whole thing, she's precise like that. IfWANTZis.FALSE., Z is not referenced. Not even looked at. Ghosted. πLDZβ INTEGER. The leading dimension of the array Z.LDZ >= max(1,N). πINFOβ INTEGER. Okay bestie, here's where the plot thickens:= 0: successful exit. We love a happy ending. π> 0: ifINFO = i,CLAHQRfailed to compute all the eigenvaluesILOtoIHIin a total of 30 iterations per eigenvalue. In that case, elementsi+1:ihiof W contain those eigenvalues which have been successfully computed. So it's a partial slay. π- If
INFO > 0andWANTTis.FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix with rows and columnsILOthroughINFOof the final, output value of H. - If
INFO > 0andWANTTis.TRUE., then on exit:
- If
(*) (initial value of H)*U = U*(final value of H)
where U is an orthogonal matrix. The final value of H is upper Hessenberg and triangular in rows and columns INFO+1 through IHI. β¨
- If
INFO > 0andWANTZis.TRUE., then on exit:
(final value of Z) = (initial value of Z)*U
where U is the orthogonal matrix in (*) β and yes, that's regardless of the value of WANTT. π
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: π
02-96Based on modifications by David Day, Sandia National Laboratory, USA12-04Further modifications by Ralph Byers, University of Kansas, USA
This is a modified version of CLAHQR from LAPACK version 3.0. It is (1) more robust against overflow and underflow and (2) adopts the more conservative Ahues & Tisseur stopping criterion (LAWN 122, 1997). Glow-up behavior, honestly. β¨
subroutine clahr2 (integer N, integer K, integer NB, complex, dimension( lda, * ) A, integer LDA, complex, dimension( nb ) TAU, complex, dimension( ldt, nb ) T, integer LDT, complex, dimension( ldy, nb ) Y, integer LDY)
CLAHR2 reduces the specified number of first columns of a general rectangular matrix A so that elements below the specified subdiagonal are zero, and returns auxiliary matrices which are needed to apply the transformation to the unreduced part of A. Very "I'll do the hard part and hand you the receipts" energy. π
Purpose:
CLAHR2 reduces the first NB columns of A complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero. The reduction is performed by an unitary similarity transformation Q**H * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*v**H, and also the matrix Y = A * V * T.
This is an auxiliary routine called by CGEHRD. iykyk. π¦
Parameters
Nβ INTEGER. The order of the matrix A. βKβ INTEGER. The offset for the reduction. Elements below thek-th subdiagonal in the firstNBcolumns are reduced to zero.K < N. π«ΆNBβ INTEGER. The number of columns to be reduced. πAβ COMPLEX array, dimension(LDA,N-K+1). On entry, then-by-(n-k+1)general matrix A. On exit, the elements on and above thek-th subdiagonal in the firstNBcolumns are overwritten with the corresponding elements of the reduced matrix; the elements below thek-th subdiagonal, with the arrayTAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details for the full lore. πLDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N). πTAUβ COMPLEX array, dimension(NB). The scalar factors of the elementary reflectors. See Further Details. β¨Tβ COMPLEX array, dimension(LDT,NB). The upper triangular matrix T. πLDTβ INTEGER. The leading dimension of the array T.LDT >= NB. πYβ COMPLEX array, dimension(LDY,NB). Then-by-nbmatrix Y. πΈLDYβ INTEGER. The leading dimension of the array Y.LDY >= N. π«Ά
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details: π¦
The matrix Q is represented as a product of nb elementary reflectors
Q = H(1) H(2) . . . H(nb).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).
The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V**H) * (A - Y*V**H).
The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:
( a a a a a )
( a a a a a )
( a a a a a )
( h h a a a )
( v1 h a a a )
( v1 v2 a a a )
( v1 v2 a a a )
where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i). Chef's kiss diagram, honestly. ππ
This subroutine is a slight modification of LAPACK-3.0's CLAHRD incorporating improvements proposed by Quintana-Orti and Van de Gejin. Note that the entries of A(1:K,2:NB) differ from those returned by the original LAPACK-3.0's CLAHRD routine. (This subroutine is not backward compatible with LAPACK-3.0's CLAHRD.) So heads up, bestie β don't assume it behaves like the old one. π¨
References: π
Gregorio Quintana-Orti and Robert van de Geijn, 'Improving the performance of reduction to Hessenberg form,' ACM Transactions on Mathematical Software, 32(2):180-194, June 2006.
subroutine claic1 (integer JOB, integer J, complex, dimension( j ) X, real SEST, complex, dimension( j ) W, complex GAMMA, real SESTPR, complex S, complex C)
CLAIC1 applies one step of incremental condition estimation. Just one step. It's giving "small but mighty". π
Purpose:
CLAIC1 applies one step of incremental condition estimation in its simplest version:
Let x, twonorm(x) = 1, be an approximate singular vector of an j-by-j lower triangular matrix L, such that
twonorm(L*x) = sest
Then CLAIC1 computes sestpr, s, c such that the vector
[ s*x ]
xhat = [ c ]
is an approximate singular vector of
[ L 0 ]
Lhat = [ w**H gamma ]
in the sense that
twonorm(Lhat*xhat) = sestpr.
Depending on JOB, an estimate for the largest or smallest singular value is computed. π
Note that [s c]**H and sestpr**2 is an eigenpair of the system
diag(sest*sest, 0) + [alpha gamma] * [ conjg(alpha) ]
[ conjg(gamma) ]
where alpha = x**H*w. β
Parameters
JOBβ INTEGER.= 1: an estimate for the largest singular value is computed. π= 2: an estimate for the smallest singular value is computed. π¦
Jβ INTEGER. Length of X and W. πXβ COMPLEX array, dimension(J). Thej-vectorx. πSESTβ REAL. Estimated singular value ofjbyjmatrix L. β¨Wβ COMPLEX array, dimension(J). Thej-vectorw. πΈGAMMAβ COMPLEX. The diagonal elementgamma. π«ΆSESTPRβ REAL. Estimated singular value of(j+1)by(j+1)matrixLhat. π₯Sβ COMPLEX. Sine needed in formingxhat. πCβ COMPLEX. Cosine needed in formingxhat. π
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ clangt
real function clangt (character NORM, integer N, complex, dimension( * ) DL,
complex, dimension( * ) D, complex, dimension( * ) DU)
bestie!! CLANGT hands you back the 1-norm, the Frobenius norm, the infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix. She's a norm girlie and she contains multitudes π
πΈ Purpose
CLANGT returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex tridiagonal matrix A.
π Returns
CLANGT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum),
normI denotes the infinity norm of a matrix (maximum row sum) and
normF denotes the Frobenius norm of a matrix (square root of sum of
squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
heads up bestie: max(abs(A(i,j))) is NOT a consistent matrix norm. she's built different and the math girlies know it π
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANGTas described above.NβN is INTEGER. The order of the matrixA.N >= 0. WhenN = 0,CLANGTis set to zero.DLβDL is COMPLEX array, dimension (N-1). The(n-1)sub-diagonal elements ofA.DβD is COMPLEX array, dimension (N). The diagonal elements ofA.DUβDU is COMPLEX array, dimension (N-1). The(n-1)super-diagonal elements ofA.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π clanhb
real function clanhb (character NORM, character UPLO, integer N, integer K,
complex, dimension( ldab, * ) AB, integer LDAB, real, dimension( * )
WORK)
CLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix. banded, hermitian, unbothered β¨
πΈ Purpose
CLANHB returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n hermitian band matrix A, with k super-diagonals.
π Returns
CLANHB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum),
normI denotes the infinity norm of a matrix (maximum row sum) and
normF denotes the Frobenius norm of a matrix (square root of sum of
squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANHBas described above.UPLOβUPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the band matrixAis supplied.= 'U':Upper triangular= 'L':Lower triangular
NβN is INTEGER. The order of the matrixA.N >= 0. WhenN = 0,CLANHBis set to zero.KβK is INTEGER. The number of super-diagonals or sub-diagonals of the band matrixA.K >= 0.ABβAB is COMPLEX array, dimension (LDAB,N). The upper or lower triangle of the hermitian band matrixA, stored in the firstK+1rows ofAB. The j-th column ofAis stored in the j-th column of the arrayABas follows:- if
UPLO = 'U',AB(k+1+i-j,j) = A(i,j)formax(1,j-k)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+k).
- if
Note that the imaginary parts of the diagonal elements need not be set and are assumed to be zero.
LDABβLDAB is INTEGER. The leading dimension of the arrayAB.LDAB >= K+1.WORKβWORK is REAL array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise,WORKis not referenced.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ clanhp
real function clanhp (character NORM, character UPLO, integer N, complex,
dimension( * ) AP, real, dimension( * ) WORK)
CLANHP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix supplied in packed form. packed = no wasted space, we love an efficient queen π«Ά
πΈ Purpose
CLANHP returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex hermitian matrix A, supplied in packed form.
π Returns
CLANHP = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum),
normI denotes the infinity norm of a matrix (maximum row sum) and
normF denotes the Frobenius norm of a matrix (square root of sum of
squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANHPas described above.UPLOβUPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the hermitian matrixAis supplied.= 'U':Upper triangular part ofAis supplied= 'L':Lower triangular part ofAis supplied
NβN is INTEGER. The order of the matrixA.N >= 0. WhenN = 0,CLANHPis set to zero.APβAP is COMPLEX array, dimension (N*(N+1)/2). The upper or lower triangle of the hermitian matrixA, packed columnwise in a linear array. The j-th column ofAis stored in the arrayAPas follows:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
Note that the imaginary parts of the diagonal elements need not be set and are assumed to be zero.
WORKβWORK is REAL array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise,WORKis not referenced.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π clanhs
real function clanhs (character NORM, integer N, complex, dimension( lda, *
) A, integer LDA, real, dimension( * ) WORK)
CLANHS returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of an upper Hessenberg matrix. Hessenberg said "everything below the first sub-diagonal is none of my business" and honestly? iconic π
πΈ Purpose
CLANHS returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hessenberg matrix A.
π Returns
CLANHS = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum),
normI denotes the infinity norm of a matrix (maximum row sum) and
normF denotes the Frobenius norm of a matrix (square root of sum of
squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANHSas described above.NβN is INTEGER. The order of the matrixA.N >= 0. WhenN = 0,CLANHSis set to zero.AβA is COMPLEX array, dimension (LDA,N). Thenbynupper Hessenberg matrixA; the part ofAbelow the first sub-diagonal is not referenced.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(N,1).WORKβWORK is REAL array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'; otherwise,WORKis not referenced.
not me double-checking this one π«£ β forCLANHSit is literally onlyNORM = 'I'that needsWORK. not'1', not'O'. just'I'. read it twice bestie.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π clanht
real function clanht (character NORM, integer N, real, dimension( * ) D,
complex, dimension( * ) E)
CLANHT returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian tridiagonal matrix. tridiagonal but make it hermitian π
πΈ Purpose
CLANHT returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian tridiagonal matrix A.
π Returns
CLANHT = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum),
normI denotes the infinity norm of a matrix (maximum row sum) and
normF denotes the Frobenius norm of a matrix (square root of sum of
squares). Note that max(abs(A(i,j))) is not a consistent matrix norm.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANHTas described above.N
π bestie the page literally cuts off right here, mid-parameter. theNentry forCLANHTkeeps going β next part has the rest, hold on π«Ά
NβNisINTEGER. It's the order of the matrixA, andN >= 0is non-negotiable bestie. WhenN = 0,CLANHTgets set to zero, and honestly? iconic behaviour. πDβDisREAL array, dimension(N). These are the diagonal elements ofAβ the main character entries of the whole matrix, no cap. β¨EβEisCOMPLEX array, dimension(N-1). The(n-1)sub-diagonal or super-diagonal elements ofA. the supporting cast, but make it complex π¦
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π real function clansb
real function clansb (character NORM, character UPLO, integer N, integer K,
complex, dimension( ldab, * ) AB, integer LDAB, real, dimension( * )
WORK)
CLANSB hands you the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix. it's giving "tell me how big this matrix is" energy π₯
π Purpose
CLANSB returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n symmetric band matrix A, with k super-diagonals.
π« Returns
CLANSB
CLANSB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. π¨ like, it said what it said and it's not sorry.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANSBas described above. you're literally picking the norm, bestie.UPLOβUPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the band matrix A is supplied.= 'U': Upper triangular part is supplied= 'L': Lower triangular part is supplied
NβN is INTEGER. The order of the matrix A.N >= 0. WhenN = 0,CLANSBis set to zero.KβK is INTEGER. The number of super-diagonals or sub-diagonals of the band matrix A.K >= 0.ABβAB is COMPLEX array, dimension(LDAB,N). The upper or lower triangle of the symmetric band matrix A, stored in the firstK+1rows of AB. The j-th column of A is stored in the j-th column of the array AB as follows:- if
UPLO = 'U',AB(k+1+i-j,j) = A(i,j)formax(1,j-k)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+k).
- if
LDABβLDAB is INTEGER. The leading dimension of the array AB.LDAB >= K+1.WORKβWORK is REAL array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise,WORKis not referenced. she's only here when she needs to be π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π real function clansp
real function clansp (character NORM, character UPLO, integer N, complex,
dimension( * ) AP, real, dimension( * ) WORK)
CLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form. packed = squeezed, and she ate. π
π Purpose
CLANSP returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix A, supplied in packed form.
π« Returns
CLANSP
CLANSP = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. β οΈ
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANSPas described above.UPLOβUPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is supplied.= 'U': Upper triangular part of A is supplied= 'L': Lower triangular part of A is supplied
NβN is INTEGER. The order of the matrix A.N >= 0. WhenN = 0,CLANSPis set to zero.APβAP is COMPLEX array, dimension(N*(N+1)/2). The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
WORKβWORK is REAL array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise,WORKis not referenced. lowkey she's optional π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ real function clantb
real function clantb (character NORM, character UPLO, character DIAG,
integer N, integer K, complex, dimension( ldab, * ) AB, integer LDAB,
real, dimension( * ) WORK)
CLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular band matrix. triangular AND banded? she's doing the most and we're obsessed. π₯
π Purpose
CLANTB returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an n by n triangular band matrix A, with ( k + 1 ) diagonals.
π« Returns
CLANTB
CLANTB = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. π¨ fr fr.
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANTBas described above.UPLOβUPLO is CHARACTER*1. Specifies whether the matrix A is upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
DIAGβDIAG is CHARACTER*1. Specifies whether or not the matrix A is unit triangular.= 'N': Non-unit triangular= 'U': Unit triangular
NβN is INTEGER. The order of the matrix A.N >= 0. WhenN = 0,CLANTBis set to zero.KβK is INTEGER. The number of super-diagonals of the matrix A ifUPLO = 'U', or the number of sub-diagonals of the matrix A ifUPLO = 'L'.K >= 0.ABβAB is COMPLEX array, dimension(LDAB,N). The upper or lower triangular band matrix A, stored in the firstk+1rows of AB. The j-th column of A is stored in the j-th column of the array AB as follows:- if
UPLO = 'U',AB(k+1+i-j,j) = A(i,j)formax(1,j-k)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+k).
- if
Note that when DIAG = 'U', the elements of the array AB corresponding to the diagonal elements of the matrix A are not referenced, but are assumed to be one. the ones are just... implied. the audacity π
LDABβLDAB is INTEGER. The leading dimension of the array AB.LDAB >= K+1.WORKβWORK is REAL array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'; otherwise,WORKis not referenced. note: only'I'gets the WORK treatment here, don't get it twisted π«Ά
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ real function clantp
real function clantp (character NORM, character UPLO, character DIAG,
integer N, complex, dimension( * ) AP, real, dimension( * ) WORK)
CLANTP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular matrix supplied in packed form. triangular + packed = she's compact and she's powerful. π
π Purpose
CLANTP returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular matrix A, supplied in packed form.
π« Returns
CLANTP
CLANTP = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. β οΈ
π Parameters
NORMβNORM is CHARACTER*1. Specifies the value to be returned inCLANTPas described above.UPLOβUPLO is CHARACTER*1. Specifies whether the matrix A is upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
DIAGβDIAG is CHARACTER*1. Specifies whether or not the matrix A is unit triangular.= 'N': Non-unit triangular= 'U': Unit triangular
NβN is INTEGER
N is INTEGER π
The order of the matrix A. N >= 0. And when N = 0, CLANTP is set to zero β literally just hands you a zero and moves on. no notes. β¨
AP is COMPLEX array, dimension (N*(N+1)/2) π¦
The upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:
if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
Note that when DIAG = 'U', the elements of the array AP corresponding to the diagonal elements of the matrix A are not referenced, but are assumed to be one. the way it just skips them and assumes bestie is a 1?? iconic behaviour π
WORK is REAL array, dimension (MAX(1,LWORK)), where LWORK >= N when NORM = 'I'; otherwise, WORK is not referenced. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ clantr π¦
real function clantr (character NORM, character UPLO, character DIAG,
integer M, integer N, complex, dimension( lda, * ) A, integer LDA, real,
dimension( * ) WORK)
CLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix. π
β¨ Purpose β¨
CLANTR returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix A. it's giving "norm girlie, pick your fave" π
π Returns π
CLANTR = ( max(abs(A(i,j))), NORM = 'M' or 'm'
(
( norm1(A), NORM = '1', 'O' or 'o'
(
( normI(A), NORM = 'I' or 'i'
(
( normF(A), NORM = 'F', 'f', 'E' or 'e'
where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. π like she's out here doing her own thing fr fr.
π«Ά Parameters π«Ά
NORM is CHARACTER*1 πΈ
Specifies the value to be returned in CLANTR as described above.
UPLO is CHARACTER*1 π
Specifies whether the matrix A is upper or lower trapezoidal.
= 'U':Upper trapezoidal= 'L':Lower trapezoidal
Note that A is triangular instead of trapezoidal if M = N. lowkey a glow-up when they match β¨
DIAG is CHARACTER*1 π
Specifies whether or not the matrix A has unit diagonal.
= 'N':Non-unit diagonal= 'U':Unit diagonal
M is INTEGER π
The number of rows of the matrix A. M >= 0, and if UPLO = 'U', M <= N. When M = 0, CLANTR is set to zero. π«₯
N is INTEGER π
The number of columns of the matrix A. N >= 0, and if UPLO = 'L', N <= M. When N = 0, CLANTR is set to zero.
A is COMPLEX array, dimension (LDA,N) π¦
The trapezoidal matrix A (A is triangular if M = N).
- If
UPLO = 'U', the leading m by n upper trapezoidal part of the array A contains the upper trapezoidal matrix, and the strictly lower triangular part of A is not referenced. - If
UPLO = 'L', the leading m by n lower trapezoidal part of the array A contains the lower trapezoidal matrix, and the strictly upper triangular part of A is not referenced.
Note that when DIAG = 'U', the diagonal elements of A are not referenced and are assumed to be one. she's self-confident like that π
LDA is INTEGER π
The leading dimension of the array A. LDA >= max(M,1).
WORK is REAL array, dimension (MAX(1,LWORK)), where LWORK >= M when NORM = 'I'; otherwise, WORK is not referenced. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ clapll π§
subroutine clapll (integer N, complex, dimension( * ) X, integer INCX,
complex, dimension( * ) Y, integer INCY, real SSMIN)
CLAPLL measures the linear dependence of two vectors. it's giving "are u two even that close or nah" π
β¨ Purpose β¨
Given two column vectors X and Y, let
A = ( X Y ).
The subroutine first computes the QR factorization of A = Q*R, and then computes the SVD of the 2-by-2 upper triangular matrix R. The smaller singular value of R is returned in SSMIN, which is used as the measurement of the linear dependency of the vectors X and Y. π« two steps, one little number, periodt.
π«Ά Parameters π«Ά
N is INTEGER πΈ
The length of the vectors X and Y.
X is COMPLEX array, dimension (1+(N-1)*INCX) π¦
On entry, X contains the N-vector X. On exit, X is overwritten. rip bestie, she's gone π
INCX is INTEGER β¨
The increment between successive elements of X. INCX > 0.
Y is COMPLEX array, dimension (1+(N-1)*INCY) π¦
On entry, Y contains the N-vector Y. On exit, Y is overwritten. also gone. not me grieving two vectors at once π
INCY is INTEGER β¨
The increment between successive elements of Y. INCY > 0.
SSMIN is REAL π
The smallest singular value of the N-by-2 matrix A = ( X Y ).
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π clapmr π
subroutine clapmr (logical FORWRD, integer M, integer N, complex, dimension(
ldx, * ) X, integer LDX, integer, dimension( * ) K)
CLAPMR rearranges rows of a matrix as specified by a permutation vector. rows only bestie, do not touch the columns π«Ά
β¨ Purpose β¨
CLAPMR rearranges the rows of the M by N matrix X as specified by the permutation K(1),K(2),...,K(M) of the integers 1,...,M.
If FORWRD = .TRUE., forward permutation:
X(K(I),*) is moved X(I,*) for I = 1,2,...,M.
If FORWRD = .FALSE., backward permutation:
X(I,*) is moved to X(K(I),*) for I = 1,2,...,M.
π«Ά Parameters π«Ά
FORWRD is LOGICAL π
= .TRUE.,forward permutation= .FALSE.,backward permutation
M is INTEGER π
The number of rows of the matrix X. M >= 0.
N is INTEGER π
The number of columns of the matrix X. N >= 0.
X is COMPLEX array, dimension (LDX,N) π¦
On entry, the M by N matrix X. On exit, X contains the permuted matrix X. β¨ she's changed, but in a good way.
LDX is INTEGER π
The leading dimension of the array X, LDX >= MAX(1,M).
K is INTEGER array, dimension (M) πΈ
On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output. she does the work AND puts everything back?? we love a tidy queen π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π clapmt π
subroutine clapmt (logical FORWRD, integer M, integer N, complex, dimension(
ldx, * ) X, integer LDX, integer, dimension( * ) K)
CLAPMT performs a forward or backward permutation of the columns of a matrix. yes queen, columns this time π
β¨ Purpose β¨
CLAPMT rearranges the columns of the M by N matrix X as specified by the permutation K(1),K(2),...,K(N) of the integers 1,...,N.
If FORWRD = .TRUE., forward permutation:
X(*,K(J)) is moved X(*,J) for J = 1,2,...,N.
If FORWRD = .FALSE., backward permutation:
X(*,J) is moved to X(*,K(J)) for J = 1,2,...,N.
π«Ά Parameters π«Ά
FORWRD is LOGICAL π
= .TRUE.,forward permutation= .FALSE.,backward permutation
M is INTEGER π
The number of rows of the matrix X. M >= 0.
N is INTEGER π
The number of columns of the matrix X. N >= 0.
X is COMPLEX array, dimension (LDX,N) π¦
On entry, the M by N matrix X. On exit, X contains the permuted matrix X. π
LDX is INTEGER π
The leading dimension of the array X, LDX >= MAX(1,M).
K is INTEGER array, dimension (N) πΈ
On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output. again!! so polite, so considerate, the moment π«Ά
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π claqhb π
subroutine claqhb (character UPLO, integer N, integer KD, complex,
dimension( ldab, * ) AB, integer LDAB, real, dimension( * ) S, real
SCOND, real AMAX, character EQUED)
CLAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ. teamwork makes the dream work β¨
β¨ Purpose β¨
CLAQHB equilibrates an Hermitian band matrix A using the scaling factors in the vector S. balance restored, we love to see it π§ββοΈ
π«Ά Parameters π«Ά
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 is INTEGER π
The order of the matrix A. N >= 0.
KD is INTEGER π
The number of super-diagonals of the matrix A if UPLO = 'U', or the number of sub-diagonals if UPLO = 'L'. KD >= 0. she's extra in both directions π
AB is COMPLEX array, dimension (LDAB,N) π¦
On entry, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
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).
On exit, if INFO = 0, the triangular factor U or L from the Cholesky factorization A = U**H *U or A = L*L**H of the band matrix A, in the same storage format as A. β¨ glow-up complete.
LDAB is INTEGER π
The leading dimension of the array AB. LDAB >= KD+1.
S
SβSis a REAL array, dimension (N). These are the scale factors forA, bestie. That's it. That's the whole vibe. β¨SCONDβSCONDis REAL. It's the ratio of the smallestS(i)to the largestS(i). Like, the little guy vs the big guy. πAMAXβAMAXis REAL. Absolute value of the biggest matrix entry. The main character of the matrix, honestly. πEQUEDβEQUEDis CHARACTER*1. Tells you whether equilibration happened or not, no cap:= 'N': No equilibration. We left it alone. π«= 'Y': Equilibration WAS done, meaningAhas been replaced bydiag(S) * A * diag(S). Glow-up complete. π
Internal Parameters:
THRESHis a threshold value used to decide if scaling should be done based on the ratio of the scaling factors. IfSCOND < THRESH, scaling is done. Simple as that. πLARGEandSMALLare threshold values used to decide if scaling should be done based on the absolute size of the largest matrix element. IfAMAX > LARGEorAMAX < SMALL, scaling is done. Them's the rules. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine claqhp (character UPLO, integer N, complex, dimension( * ) AP, real, dimension( * ) S, real SCOND, real AMAX, character EQUED)
CLAQHP scales a Hermitian matrix stored in packed form. Packed form, bestie β no room for zeros, it's giving minimalist. π¦
Purpose:
CLAQHP equilibrates a Hermitian matrix A using the scaling factors
in the vector S.
Parameters
UPLOβUPLOis CHARACTER*1. Says whether we're storing the upper or lower triangular part of the Hermitian matrixA:= 'U': Upper triangular β¬οΈ= 'L': Lower triangular β¬οΈ
NβNis INTEGER. The order of the matrixA.N >= 0.APβAPis COMPLEX array, dimension (N*(N+1)/2). On entry, it's the upper or lower triangle of the Hermitian matrixA, packed columnwise in a linear array. The j-th column ofAlives inAPlike this:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
On exit, you get the equilibrated matrix diag(S) * A * diag(S), in the exact same storage format as A. She's transformed but she's still the same girl. π
SβSis REAL array, dimension (N). The scale factors forA.SCONDβSCONDis REAL. Ratio of the smallestS(i)to the largestS(i).AMAXβAMAXis REAL. Absolute value of largest matrix entry.EQUEDβEQUEDis CHARACTER*1. Specifies whether or not equilibration was done:= 'N': No equilibration.= 'Y': Equilibration was done, i.e.,Ahas been replaced bydiag(S) * A * diag(S).
Internal Parameters:
THRESHis a threshold value used to decide if scaling should be done based on the ratio of the scaling factors. IfSCOND < THRESH, scaling is done.LARGEandSMALLare threshold values used to decide if scaling should be done based on the absolute size of the largest matrix element. IfAMAX > LARGEorAMAX < SMALL, scaling is done.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine claqp2 (integer M, integer N, integer OFFSET, complex, dimension( lda, * ) A, integer LDA, integer, dimension( * ) JPVT, complex, dimension( * ) TAU, real, dimension( * ) VN1, real, dimension( * ) VN2, complex, dimension( * ) WORK)
CLAQP2 computes a QR factorization with column pivoting of the matrix block. Pivoting but make it blocky. π₯
Purpose:
CLAQP2 computes a QR factorization with column pivoting of
the block A(OFFSET+1:M,1:N).
The block A(1:OFFSET,1:N) is accordingly pivoted, but not factorized.
Read that again: pivoted but NOT factorized. She's involved but she's not doing the work. Respect. π
Parameters
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.N >= 0.OFFSETβOFFSETis INTEGER. The number of rows of the matrixAthat must be pivoted but no factorized.OFFSET >= 0.AβAis COMPLEX array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit, the upper triangle of blockA(OFFSET+1:M,1:N)is the triangular factor obtained; the elements in blockA(OFFSET+1:M,1:N)below the diagonal, together with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. BlockA(1:OFFSET,1:N)has been accordingly pivoted, but no factorized. (Say it with me: pivoted, not factorized.) πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).JPVTβJPVTis INTEGER array, dimension (N). On entry, ifJPVT(i) .ne. 0, the i-th column ofAis permuted to the front ofA*P(a leading column); ifJPVT(i) = 0, the i-th column ofAis a free column. On exit, ifJPVT(i) = k, then the i-th column ofA*Pwas the k-th column ofA. Character development, honestly. πΈTAUβTAUis COMPLEX array, dimension (min(M,N)). The scalar factors of the elementary reflectors.VN1βVN1is REAL array, dimension (N). The vector with the partial column norms.VN2βVN2is REAL array, dimension (N). The vector with the exact column norms. Exact. No rounding slander. πWORKβWORKis COMPLEX array, dimension (N).
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
- X. Sun, Computer Science Dept., Duke University, USA
- Partial column norm updating strategy modified on April 2011 Z. Drmac and Z. Bujanovic, Dept. of Mathematics, University of Zagreb, Croatia.
References:
- LAPACK Working Note 176
subroutine claqps (integer M, integer N, integer OFFSET, integer NB, integer KB, complex, dimension( lda, * ) A, integer LDA, integer, dimension( * ) JPVT, complex, dimension( * ) TAU, real, dimension( * ) VN1, real, dimension( * ) VN2, complex, dimension( * ) AUXV, complex, dimension( ldf, * ) F, integer LDF)
CLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BLAS level 3. BLAS-3 energy only, we don't do level 1 around here. π₯
Purpose:
CLAQPS computes a step of QR factorization with column pivoting
of a complex M-by-N matrix A by using Blas-3. It tries to factorize
NB columns from A starting from the row OFFSET+1, and updates all
of the matrix with Blas-3 xGEMM.
In some cases, due to catastrophic cancellations, it cannot
factorize NB columns. Hence, the actual number of factorized
columns is returned in KB.
Block A(1:OFFSET,1:N) is accordingly pivoted, but not factorized.
Okay so real talk: catastrophic cancellations can happen and she simply cannot factorize allNBcolumns. That's why you getKBback β the actual number she managed. Don't be mad at her, be mad at floating point. π
Parameters
MβMis INTEGER. The number of rows of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.N >= 0OFFSETβOFFSETis INTEGER. The number of rows ofAthat have been factorized in previous steps.NBβNBis INTEGER. The number of columns to factorize. (The dream. β¨)KBβKBis INTEGER. The number of columns actually factorized. (The reality. π« )AβAis COMPLEX array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit, blockA(OFFSET+1:M,1:KB)is the triangular factor obtained and blockA(1:OFFSET,1:N)has been accordingly pivoted, but no factorized. The rest of the matrix, blockA(OFFSET+1:M,KB+1:N)has been updated.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).JPVTβJPVTis INTEGER array, dimension (N).JPVT(I) = K <==> Column K of the full matrix A has been permuted into position I in AP.TAUβTAUis COMPLEX array, dimension (KB). The scalar factors of the elementary reflectors.VN1βVN1is REAL array, dimension (N). The vector with the partial column norms.VN2βVN2is REAL array, dimension (N). The vector with the exact column norms.AUXVβAUXVis COMPLEX array, dimension (NB). Auxiliary vector. The little helper. π§FβFis COMPLEX array, dimension (LDF,NB). MatrixF**H = L * Y**H * A.LDFβLDFis INTEGER. The leading dimension of the arrayF.LDF >= max(1,N).
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
- X. Sun, Computer Science Dept., Duke University, USA
- Partial column norm updating strategy modified on April 2011 Z. Drmac and Z. Bujanovic, Dept. of Mathematics, University of Zagreb, Croatia.
References:
- LAPACK Working Note 176
subroutine claqr0 (logical WANTT, logical WANTZ, integer N, integer ILO, integer IHI, complex, dimension( ldh, * ) H, integer LDH, complex, dimension( * ) W, integer ILOZ, integer IHIZ, complex, dimension( ldz, * ) Z, integer LDZ, complex, dimension( * ) WORK, integer LWORK, integer INFO)
CLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. Eigenvalues AND maybe the Schur stuff?? She does both, she contains multitudes. π
Purpose:
CLAQR0 computes the eigenvalues of a Hessenberg matrix H
and, optionally, the matrices T and Z from the Schur decomposition
H = Z T Z**H, where T is an upper triangular matrix (the
Schur form), and Z is the unitary matrix of Schur vectors.
Optionally Z may be postmultiplied into an input unitary
matrix Q so that this routine can give the Schur factorization
of a matrix A which has been reduced to the Hessenberg form H
by the unitary matrix Q: A = Q*H*Q**H = (QZ)*H*(QZ)**H.
Parameters
WANTTWANTTisLOGICALβ bestie, set this to.TRUE.and the full Schur formTis required; set it to.FALSE.and only eigenvalues are required. β¨WANTZisLOGICALβ.TRUE.means the matrix of Schur vectorsZis required;.FALSE.means Schur vectors are not required. No cap. πNisINTEGERβ the order of the matrixH.N >= 0. πΈILOisINTEGERβ that's the whole vibe, literally just that. πIHIisINTEGERβ okay so it is assumed thatHis already upper triangular in rows and columns1:ILO-1andIHI+1:Nand, ifILO > 1,H(ILO,ILO-1)is zero.ILOandIHIare normally set by a previous call toCGEBAL, and then passed toCGEHRDwhen the matrix output byCGEBALis reduced to Hessenberg form. Otherwise,ILOandIHIshould be set to1andN, respectively. IfN > 0, then1 <= ILO <= IHI <= N. IfN = 0, thenILO = 1andIHI = 0. π¦HisCOMPLEXarray, dimension(LDH,N)β on entry, the upper Hessenberg matrixH. On exit, ifINFO = 0andWANTTis.TRUE., thenHcontains the upper triangular matrixTfrom the Schur decomposition (the Schur form). IfINFO = 0andWANTis.FALSE., then the contents ofHare unspecified on exit. (The output value ofHwhenINFO > 0is given under the description ofINFObelow.) This subroutine may explicitly setH(i,j) = 0fori > jandj = 1, 2, ... ILO-1orj = IHI+1, IHI+2, ... N. πLDHisINTEGERβ the leading dimension of the arrayH.LDH >= max(1,N). πWisCOMPLEXarray, dimension(N)β the computed eigenvalues ofH(ILO:IHI,ILO:IHI)are stored inW(ILO:IHI). IfWANTTis.TRUE., then the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withW(i) = H(i,i). βILOZisINTEGERβ just vibes, no extra description. π«ΆIHIZisINTEGERβ specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO;IHI <= IHIZ <= N. πZisCOMPLEXarray, dimension(LDZ,IHI)β ifWANTZis.FALSE., thenZis not referenced. IfWANTZis.TRUE., thenZ(ILO:IHI,ILOZ:IHIZ)is replaced byZ(ILO:IHI,ILOZ:IHIZ)*UwhereUis the orthogonal Schur factor ofH(ILO:IHI,ILO:IHI). (The output value ofZwhenINFO > 0is given under the description ofINFObelow.) π₯LDZisINTEGERβ the leading dimension of the arrayZ. ifWANTZis.TRUE.thenLDZ >= MAX(1,IHIZ). Otherwise,LDZ >= 1. πWORKisCOMPLEXarray, dimensionLWORKβ on exit, ifLWORK = -1,WORK(1)returns an estimate of the optimal value forLWORK. πLWORKisINTEGERβ the dimension of the arrayWORK.LWORK >= max(1,N)is sufficient, butLWORKtypically as large as6*Nmay be required for optimal performance. A workspace query to determine the optimal workspace size is recommended. IfLWORK = -1, thenCLAQR0does a workspace query. In this case,CLAQR0checks the input parameters and estimates the optimal workspace size for the given values ofN,ILOandIHI. The estimate is returned inWORK(1). No error message related toLWORKis issued byXERBLA. NeitherHnorZare accessed. π§INFOisINTEGERβ= 0: successful exit.> 0: ifINFO = i,CLAQR0failed to compute all of the eigenvalues. Elements1:ilo-1andi+1:nofWRandWIcontain those eigenvalues which have been successfully computed. (Failures are rare.) IfINFO > 0andWANTis.FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. IfINFO > 0andWANTTis.TRUE., then on exit
(*) (initial value of H)*U = U*(final value of H)
where U is a unitary matrix. The final value of H is upper Hessenberg and triangular in rows and columns INFO+1 through IHI. If INFO > 0 and WANTZ is .TRUE., then on exit
(final value of Z(ILO:IHI,ILOZ:IHIZ)
= (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U
where U is the unitary matrix in (*) (regardless of the value of WANTT.) If INFO > 0 and WANTZ is .FALSE., then Z is not accessed. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA.
π References:
K. Braman, R. Byers and R. Mathias, The Multi-Shift QR
Algorithm Part I: Maintaining Well Focused Shifts, and Level 3
Performance, SIAM Journal of Matrix Analysis, volume 23, pages
929--947, 2002.
K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm
Part II: Aggressive Early Deflation, SIAM Journal of Matrix
Analysis, volume 23, pages 948--973, 2002.
π subroutine claqr1
subroutine claqr1 (integer N, complex, dimension( ldh, * ) H, integer LDH,
complex S1, complex S2, complex, dimension( * ) V)
CLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts. β¨
π Purpose:
Given a 2-by-2 or 3-by-3 matrix H, CLAQR1 sets v to a scalar multiple of the first column of the product
(*) K = (H - s1*I)*(H - s2*I)
scaling to avoid overflows and most underflows.
This is useful for starting double implicit shift bulges in the QR algorithm.
π Parameters
NisINTEGERβ order of the matrixH.Nmust be either2or3. πHisCOMPLEXarray, dimension(LDH,N)β the 2-by-2 or 3-by-3 matrixHin(*). πΈLDHisINTEGERβ the leading dimension ofHas declared in the calling procedure.LDH >= N. π¦S1isCOMPLEXβ that's it. β¨S2isCOMPLEXβS1andS2are the shifts definingKin(*)above. πVisCOMPLEXarray, dimension(N)β a scalar multiple of the first column of the matrixKin(*). π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά Contributors:
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA.
π₯ subroutine claqr2
subroutine claqr2 (logical WANTT, logical WANTZ, integer N, integer KTOP,
integer KBOT, integer NW, complex, dimension( ldh, * ) H, integer LDH,
integer ILOZ, integer IHIZ, complex, dimension( ldz, * ) Z, integer LDZ,
integer NS, integer ND, complex, dimension( * ) SH, complex, dimension(
ldv, * ) V, integer LDV, integer NH, complex, dimension( ldt, * ) T,
integer LDT, integer NV, complex, dimension( ldwv, * ) WV, integer LDWV,
complex, dimension( * ) WORK, integer LWORK)
CLAQR2 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). π
π Purpose:
CLAQR2 is identical to CLAQR3 except that it avoids recursion by calling CLAHQR instead of CLAQR4.
Aggressive early deflation:
This subroutine accepts as input an upper Hessenberg matrix H and performs an unitary similarity transformation designed to detect and deflate fully converged eigenvalues from a trailing principal submatrix. On output H has been overwritten by a new Hessenberg matrix that is a perturbation of an unitary similarity transformation of H. It is to be hoped that the final version of H has many zero subdiagonal entries. β¨
π¦ Parameters
WANTTisLOGICALβ if.TRUE., then the Hessenberg matrixHis fully updated so that the triangular Schur factor may be computed (in cooperation with the calling subroutine). If.FALSE., then only enough ofHis updated to preserve the eigenvalues. πWANTZisLOGICALβ if.TRUE., then the unitary matrixZis updated so so that the unitary Schur factor may be computed (in cooperation with the calling subroutine). If.FALSE., thenZis not referenced. πNisINTEGERβ the order of the matrixHand (ifWANTZis.TRUE.) the order of the unitary matrixZ. πΈKTOPisINTEGERβ it is assumed that eitherKTOP = 1orH(KTOP,KTOP-1)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix. π¦KBOTisINTEGERβ it is assumed without a check that eitherKBOT = NorH(KBOT+1,KBOT)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix. β¨NWisINTEGERβ deflation window size.1 <= NW <= (KBOT-KTOP+1). πHisCOMPLEXarray, dimension(LDH,N)β on input the initialN-by-Nsection ofHstores the Hessenberg matrix undergoing aggressive early deflation. On outputHhas been transformed by a unitary similarity transformation, perturbed, and the returned to Hessenberg form that (it is to be hoped) has some zero subdiagonal entries. π₯LDHβ okay soLDHis an INTEGER, the leading dimension ofHjust as declared in the calling subroutine.N <= LDH, periodt. πILOZβILOZis an INTEGER. that's it, that's the tea. πIHIZβIHIZis an INTEGER. it specifies the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= N. no cap. β¨ZβZis a COMPLEX array, dimension(LDZ,N). ifWANTZis.TRUE., then on output, the unitary similarity transformation mentioned above has been accumulated intoZ(ILOZ:IHIZ,ILOZ:IHIZ)from the right. ifWANTZis.FALSE., thenZis unreferenced. literally just ignored, iconic. πLDZβLDZis an INTEGER. the leading dimension ofZjust as declared in the calling subroutine.1 <= LDZ.NSβNSis an INTEGER. the number of unconverged (ie approximate) eigenvalues returned inSRandSIthat may be used as shifts by the calling subroutine. shifts, shifts, shifts. πΈNDβNDis an INTEGER. the number of converged eigenvalues uncovered by this subroutine. we love a converged queen. πSHβSHis a COMPLEX array, dimension(KBOT). on output, approximate eigenvalues that may be used for shifts are stored inSH(KBOT-ND-NS+1)throughSR(KBOT-ND). converged eigenvalues are stored inSH(KBOT-ND+1)throughSH(KBOT). (yes, we saidSRthere, bestie β keeping it exactly as the original, no fixing π)VβVis a COMPLEX array, dimension(LDV,NW). anNW-by-NWwork array.LDVβLDVis an INTEGER. the leading dimension ofVjust as declared in the calling subroutine.NW <= LDV.NHβNHis an INTEGER. the number of columns ofT.NH >= NW.TβTis a COMPLEX array, dimension(LDT,NW).LDTβLDTis an INTEGER. the leading dimension ofTjust as declared in the calling subroutine.NW <= LDT.NVβNVis an INTEGER. the number of rows of work arrayWVavailable for workspace.NV >= NW.WVβWVis a COMPLEX array, dimension(LDWV,NW).LDWVβLDWVis an INTEGER. the leading dimension ofWjust as declared in the calling subroutine.NW <= LDV. (again, keeping the original'sLDVhere, no cap π«Ά)WORKβWORKis a COMPLEX array, dimension(LWORK). on exit,WORK(1)is set to an estimate of the optimal value ofLWORKfor the given values ofN,NW,KTOPandKBOT. it's giving workspace glow-up. β¨LWORKβLWORKis an INTEGER. the dimension of the work arrayWORK.LWORK = 2*NWsuffices, but greater efficiency may result from larger values ofLWORK.
if LWORK = -1, then a workspace query is assumed; CLAQR2 only estimates the optimal workspace size for the given values of N, NW, KTOP and KBOT. the estimate is returned in WORK(1). no error message related to LWORK is issued by XERBLA. neither H nor Z are accessed. so don't panic, it's just a query, bestie. π«Ά
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors π
- Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA
π subroutine claqr3 π
subroutine claqr3 (logical WANTT, logical WANTZ, integer N, integer KTOP,
integer KBOT, integer NW, complex, dimension( ldh, * ) H, integer LDH,
integer ILOZ, integer IHIZ, complex, dimension( ldz, * ) Z, integer LDZ,
integer NS, integer ND, complex, dimension( * ) SH, complex, dimension(
ldv, * ) V, integer LDV, integer NH, complex, dimension( ldt, * ) T,
integer LDT, integer NV, complex, dimension( ldwv, * ) WV, integer LDWV,
complex, dimension( * ) WORK, integer LWORK)
CLAQR3 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). it's giving aggressive early deflation energy. π
Purpose:
Aggressive early deflation:
CLAQR3 accepts as input an upper Hessenberg matrix H and performs an unitary similarity transformation designed to detect and deflate fully converged eigenvalues from a trailing principal submatrix. on output H has been over-written by a new Hessenberg matrix that is a perturbation of an unitary similarity transformation of H. it is to be hoped that the final version of H has many zero subdiagonal entries. (manifesting zero subdiagonals β¨)
Parameters
WANTTβWANTTis LOGICAL. if.TRUE., then the Hessenberg matrixHis fully updated so that the triangular Schur factor may be computed (in cooperation with the calling subroutine). if.FALSE., then only enough ofHis updated to preserve the eigenvalues.WANTZβWANTZis LOGICAL. if.TRUE., then the unitary matrixZis updated so that the unitary Schur factor may be computed (in cooperation with the calling subroutine). if.FALSE., thenZis not referenced.NβNis INTEGER. the order of the matrixHand (ifWANTZis.TRUE.) the order of the unitary matrixZ.KTOPβKTOPis INTEGER. it is assumed that eitherKTOP = 1orH(KTOP,KTOP-1)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix.KBOTβKBOTis INTEGER. it is assumed without a check that eitherKBOT = NorH(KBOT+1,KBOT)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix.NWβNWis INTEGER. deflation window size.1 <= NW <= (KBOT-KTOP+1).HβHis a COMPLEX array, dimension(LDH,N). on input the initialN-by-Nsection ofHstores the Hessenberg matrix undergoing aggressive early deflation. on outputHhas been transformed by a unitary similarity transformation, perturbed, and the returned to Hessenberg form that (it is to be hoped) has some zero subdiagonal entries.LDHβLDHis INTEGER. leading dimension of H just as declared in the calling subroutine.N <= LDH.ILOZβILOZis INTEGER.IHIZβIHIZis INTEGER. specify the rows of Z to which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= N.ZβZis a COMPLEX array, dimension(LDZ,N). IFWANTZis.TRUE., then on output, the unitary similarity transformation mentioned above has been accumulated intoZ(ILOZ:IHIZ,ILOZ:IHIZ)from the right. ifWANTZis.FALSE., thenZis unreferenced.LDZβLDZis INTEGER. the leading dimension of Z just as declared in the calling subroutine.1 <= LDZ.NSβNSis INTEGER. the number of unconverged (ie approximate) eigenvalues returned inSRandSIthat may be used as shifts by the calling subroutine.NDβNDis INTEGER. the number of converged eigenvalues uncovered by this subroutine.SHβSHis a COMPLEX array, dimension(KBOT). on output, approximate eigenvalues that may be used for shifts are stored inSH(KBOT-ND-NS+1)throughSR(KBOT-ND). converged eigenvalues are stored inSH(KBOT-ND+1)throughSH(KBOT).VβVis a COMPLEX array, dimension(LDV,NW). anNW-by-NWwork array.LDVβLDVis INTEGER. the leading dimension of V just as declared in the calling subroutine.NW <= LDV.NHβNHis INTEGER. the number of columns of T.NH >= NW.TβTis a COMPLEX array, dimension(LDT,NW).LDTβLDTis INTEGER. the leading dimension of T just as declared in the calling subroutine.NW <= LDT.NVβNVis INTEGER. the number of rows of work array WV available for workspace.NV >= NW.WVβWVis a COMPLEX array, dimension(LDWV,NW).LDWVβLDWVis INTEGER. the leading dimension of W just as declared in the calling subroutine.NW <= LDV.WORKβWORKis a COMPLEX array, dimension(LWORK). on exit,WORK(1)is set to an estimate of the optimal value ofLWORKfor the given values ofN,NW,KTOPandKBOT.LWORKβLWORKis INTEGER. the dimension of the work arrayWORK.LWORK = 2*NWsuffices, but greater efficiency may result from larger values ofLWORK.
if LWORK = -1, then a workspace query is assumed; CLAQR3 only estimates the optimal workspace size for the given values of N, NW, KTOP and KBOT. the estimate is returned in WORK(1). no error message related to LWORK is issued by XERBLA. neither H nor Z are accessed.
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors π
- Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA
π subroutine claqr4 π
subroutine claqr4 (logical WANTT, logical WANTZ, integer N, integer ILO,
integer IHI, complex, dimension( ldh, * ) H, integer LDH, complex,
dimension( * ) W, integer ILOZ, integer IHIZ, complex, dimension( ldz, *
) Z, integer LDZ, complex, dimension( * ) WORK, integer LWORK, integer
INFO)
CLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. it's giving main character energy. π
Purpose:
CLAQR4 does, like, one whole level of recursion for CLAQR0. It's a full, complete, no-notes implementation of the small bulge multi-shift QR algorithm. CLAQR0 can call it, and if the deflation window size is big enough, CLAQR3 can call it too. Here's the tea: this subroutine is identical to CLAQR0 except that it calls CLAQR2 instead of CLAQR3. That's it, that's the diff. π
CLAQR4 computes the eigenvalues of a Hessenberg matrix H and, if you want them, the matrices T and Z from the Schur decomposition H = Z T Z**H, where T is an upper triangular matrix (that's the Schur form, bestie) and Z is the unitary matrix of Schur vectors. β¨
Optionally Z may be postmultiplied into an input unitary matrix Q so that this routine can give you the Schur factorization of a matrix A that's already been reduced to the Hessenberg form H by the unitary matrix Q:
A = Q*H*Q**H = (QZ)*H*(QZ)**H
β¨ Parameters β¨
WANTTβWANTTisLOGICAL= .TRUE.: you want the full Schur formT, no half measures;= .FALSE.: you only want eigenvalues, keep it light. π¦
WANTZβWANTZisLOGICAL= .TRUE.: you want the matrix of Schur vectorsZ;= .FALSE.: nope, no Schur vectors required, we're good. π
NβNisINTEGER. The order of the matrixH.N >= 0.ILOβILOisINTEGERIHIβIHIisINTEGER. So the vibe here is: we're assumingHis already upper triangular in rows and columns1:ILO-1andIHI+1:N, and ifILO > 1, thenH(ILO,ILO-1)is zero. NormallyILOandIHIget set by an earlier call toCGEBAL, and then handed over toCGEHRDwhen the matrix thatCGEBALoutput gets reduced to Hessenberg form. If that's not your situation, just setILOandIHIto1andNrespectively β no drama. IfN > 0, then1 <= ILO <= IHI <= N. And ifN = 0, thenILO = 1andIHI = 0. πHβHisCOMPLEXarray, dimension(LDH,N).- On entry: the upper Hessenberg matrix
H. πΈ - On exit, if
INFO = 0andWANTTis.TRUE., thenHcontains the upper triangular matrixTfrom the Schur decomposition (the Schur form). IfINFO = 0andWANTis.FALSE., then the contents ofHare unspecified on exit β literally whatever, don't look at it. (The output value ofHwhenINFO > 0is described down underINFObelow.) - Heads up: this subroutine may explicitly set
H(i,j) = 0fori > jandj = 1, 2, ... ILO-1orj = IHI+1, IHI+2, ... N.
- On entry: the upper Hessenberg matrix
LDHβLDHisINTEGER. The leading dimension of the arrayH.LDH >= max(1,N).WβWisCOMPLEXarray, dimension(N). The computed eigenvalues ofH(ILO:IHI,ILO:IHI)get stored inW(ILO:IHI). And ifWANTTis.TRUE., then those eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withW(i) = H(i,i). Matching set, iconic. πILOZβILOZisINTEGERIHIZβIHIZisINTEGER. These two specify the rows ofZthat transformations must be applied to ifWANTZis.TRUE.. Rules:1 <= ILOZ <= ILO;IHI <= IHIZ <= N.ZβZisCOMPLEXarray, dimension(LDZ,IHI).- If
WANTZis.FALSE., thenZis not referenced β she's off duty, not even clocked in. π«Ά - If
WANTZis.TRUE., thenZ(ILO:IHI,ILOZ:IHIZ)is replaced byZ(ILO:IHI,ILOZ:IHIZ)*UwhereUis the orthogonal Schur factor ofH(ILO:IHI,ILO:IHI). (The output value ofZwhenINFO > 0is described underINFObelow.)
- If
LDZβLDZisINTEGER. The leading dimension of the arrayZ. IfWANTZis.TRUE.thenLDZ >= MAX(1,IHIZ). Otherwise,LDZ >= 1.WORKβWORKisCOMPLEXarray, dimensionLWORK. On exit, ifLWORK = -1,WORK(1)returns an estimate of the optimal value forLWORK. β¨LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= max(1,N)is sufficient, but honestlyLWORKtypically needs to be as large as6*Nfor optimal performance β so a workspace query to figure out the optimal workspace size is recommended, bestie, don't skip it. π- If
LWORK = -1, thenCLAQR4does a workspace query. In that case,CLAQR4checks the input parameters and estimates the optimal workspace size for the given values ofN,ILOandIHI. The estimate comes back inWORK(1). No error message related toLWORKis issued byXERBLA. And neitherHnorZare accessed. π
- If
INFOβINFOisINTEGER= 0: successful exit, we ate and left no crumbs. π> 0: ifINFO = i,CLAQR4failed to compute all of the eigenvalues. Elements1:ilo-1andi+1:nofWRandWIcontain those eigenvalues which have been successfully computed. (Failures are rare, so don't spiral. π)- If
INFO > 0andWANTis.FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columnsILOthroughINFOof the final, output value ofH. - If
INFO > 0andWANTTis.TRUE., then on exit:
(*) (initial value of H)*U = U*(final value of H)
where U is a unitary matrix. The final value of H is upper Hessenberg and triangular in rows and columns INFO+1 through IHI.
- If
INFO > 0andWANTZis.TRUE., then on exit:
(final value of Z(ILO:IHI,ILOZ:IHIZ)
= (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U
where U is the unitary matrix in (*) (regardless of the value of WANTT).
- If
INFO > 0andWANTZis.FALSE., thenZis not accessed. Not even a little. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά Contributors π«Ά
Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA
π References π
- K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm Part I: Maintaining Well Focused Shifts, and Level 3 Performance, SIAM Journal of Matrix Analysis, volume 23, pages 929--947, 2002.
- K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm Part II: Aggressive Early Deflation, SIAM Journal of Matrix Analysis, volume 23, pages 948--973, 2002.
π§ claqr5 β the small-bulge multi-shift QR sweep π«
subroutine claqr5 (logical WANTT, logical WANTZ, integer KACC22, integer N,
integer KTOP, integer KBOT, integer NSHFTS, complex, dimension( * ) S,
complex, dimension( ldh, * ) H, integer LDH, integer ILOZ, integer IHIZ,
complex, dimension( ldz, * ) Z, integer LDZ, complex, dimension( ldv, *
) V, integer LDV, complex, dimension( ldu, * ) U, integer LDU, integer
NV, complex, dimension( ldwv, * ) WV, integer LDWV, integer NH, complex,
dimension( ldwh, * ) WH, integer LDWH)
CLAQR5 performs a single small-bulge multi-shift QR sweep. That's the whole job description, and she does it flawlessly. π₯
Purpose:
CLAQR5 called by CLAQR0 performs a single small-bulge multi-shift QR sweep.
Parameters
WANTTβWANTTisLOGICAL.WANTT = .true.if the triangular Schur factor is being computed.WANTTis set to.false.otherwise.WANTZβWANTZisLOGICAL.WANTZ = .true.if the unitary Schur factor is being computed.WANTZis set to.false.otherwise.KACC22βKACC22isINTEGERwith value0,1, or2. Specifies the computation mode of far-from-diagonal orthogonal updates.= 0:CLAQR5does not accumulate reflections and does not use matrix-matrix multiply to update far-from-diagonal matrix entries.= 1:CLAQR5accumulates reflections and uses matrix-matrix multiply to update the far-from-diagonal matrix entries.= 2: Same asKACC22 = 1. This option used to enable exploiting the 2-by-2 structure during matrix multiplications, but that is no longer supported β it's giving deprecated, she retired. π
NβNisINTEGER.Nis the order of the Hessenberg matrixHupon which this subroutine operates.KTOPβKTOPisINTEGERKBOTβKBOTisINTEGER. These are the first and last rows and columns of an isolated diagonal block upon which the QR sweep is to be applied. It is assumed without a check that:
either KTOP = 1 or H(KTOP,KTOP-1) = 0
and
either KBOT = N or H(KBOT+1,KBOT) = 0.
(Yes bestie, no check. It's on you. π«£)
NSHFTSβNSHFTSisINTEGER.NSHFTSgives the number of simultaneous shifts.NSHFTSmust be positive and even β those are the rules, no cap. βSβSisCOMPLEXarray, dimension(NSHFTS).Scontains the shifts of origin that define the multi-shift QR sweep. On outputSmay be reordered. πHβHisCOMPLEXarray, dimension(LDH,N). On inputHcontains a Hessenberg matrix. On output a multi-shift QR sweep with shiftsSR(J)+i*SI(J)is applied to the isolated diagonal block in rows and columnsKTOPthroughKBOT.LDHβLDHisINTEGER.LDHis the leading dimension ofHjust as declared in the calling procedure.LDH >= MAX(1,N).ILOZβILOZisINTEGERIHIZβIHIZisINTEGER. Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= NZβZisCOMPLEXarray, dimension(LDZ,IHIZ).- If
WANTZ = .TRUE., then the QR Sweep unitary similarity transformation is accumulated intoZ(ILOZ:IHIZ,ILOZ:IHIZ)from the right. - If
WANTZ = .FALSE., thenZis unreferenced. πΈ
- If
LDZβ *LDZisINTEGER*β¦ and bestie, this one's story is literally continued in the next part, stay tuned π«ΆLDZisINTEGERβ bestie,LDZis the leading dimension ofZ, exactly like you declared it back in the calling procedure. And it's gotta beLDZ >= N. πVisCOMPLEXarray, dimension(LDV,NSHFTS/2)πΈLDVisINTEGERβ the leading dimension ofVas declared in the calling procedure.LDV >= 3. β¨UisCOMPLEXarray, dimension(LDU,2*NSHFTS)π¦LDUisINTEGERβ the leading dimension ofUas declared in the calling subroutine.LDU >= 2*NSHFTS. πNVisINTEGERβNVis the number of rows inWVavailable for workspace.NV >= 1. πWVisCOMPLEXarray, dimension(LDWV,2*NSHFTS)πLDWVisINTEGERβ the leading dimension ofWVas declared in the calling subroutine.LDWV >= NV. βNHisINTEGERβNHis the number of columns in arrayWHavailable for workspace.NH >= 1. πWHisCOMPLEXarray, dimension(LDWH,NH)πLDWHisINTEGERβ leading dimension ofWHjust as declared in the calling procedure.LDWH >= 2*NSHFTS. π«Ά
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: π«Ά
- Karen Braman and Ralph Byers, Department of Mathematics, University of Kansas, USA
- Lars Karlsson, Daniel Kressner, and Bruno Lang
- Thijs Steel, Department of Computer science, KU Leuven, Belgium
References: π
- K. Braman, R. Byers and R. Mathias, The Multi-Shift QR Algorithm Part I: Maintaining Well Focused Shifts, and Level 3 Performance, SIAM Journal of Matrix Analysis, volume 23, pages 929--947, 2002.
- Lars Karlsson, Daniel Kressner, and Bruno Lang, Optimally packed chains of bulges in multishift QR algorithms. ACM Trans. Math. Softw. 40, 2, Article 12 (February 2014).
π§Ό subroutine claqsb
subroutine claqsb (character UPLO, integer N, integer KD, complex,
dimension( ldab, * ) AB, integer LDAB, real, dimension( * ) S, real
SCOND, real AMAX, character EQUED)
CLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ. like... okay so it takes the scaling factors somebody else already did the math for and applies them. teamwork, we love to see it. π«Ά
Purpose:
CLAQSB equilibrates a symmetric band matrix A using the scaling factors in the vector S. β¨
Parameters
UPLOβ isCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored.= 'U': Upper triangular= 'L': Lower triangular
Nβ isINTEGER. The order of the matrixA.N >= 0. πKDβ isINTEGER. The number of super-diagonals of the matrixAifUPLO = 'U', or the number of sub-diagonals ifUPLO = 'L'.KD >= 0. πΈABβ isCOMPLEXarray, dimension(LDAB,N).- On entry, 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:- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- if
- On exit, if
INFO = 0, the triangular factorUorLfrom the Cholesky factorizationA = U**H *UorA = L*L**Hof the band matrixA, in the same storage format asA. π¦
- On entry, the upper or lower triangle of the symmetric band matrix
LDABβ isINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1. βSβ isREALarray, dimension(N). The scale factors forA. πSCONDβ isREAL. Ratio of the smallestS(i)to the largestS(i). πAMAXβ isREAL. Absolute value of largest matrix entry. π₯EQUEDβ isCHARACTER*1. Specifies whether or not equilibration was done.= 'N': No equilibration.= 'Y': Equilibration was done, i.e.,Ahas been replaced bydiag(S) * A * diag(S). π
Internal Parameters:
THRESH is a threshold value used to decide if scaling should be done based on the ratio of the scaling factors. If SCOND < THRESH, scaling is done. π
LARGE and SMALL are threshold values used to decide if scaling should be done based on the absolute size of the largest matrix element. If AMAX > LARGE or AMAX < SMALL, scaling is done. π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§Ό subroutine claqsp
subroutine claqsp (character UPLO, integer N, complex, dimension( * ) AP,
real, dimension( * ) S, real SCOND, real AMAX, character EQUED)
CLAQSP scales a symmetric/Hermitian matrix in packed storage, using scaling factors computed by sppequ. packed storage besties rise up, the whole matrix is squished into one linear array and honestly? iconic. πΈ
Purpose:
CLAQSP equilibrates a symmetric matrix A using the scaling factors in the vector S. β¨
Parameters
UPLOβ isCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored.= 'U': Upper triangular= 'L': Lower triangular
Nβ isINTEGER. The order of the matrixA.N >= 0. πAPβ isCOMPLEXarray, dimension(N*(N+1)/2).- On entry, the upper or lower triangle of the symmetric matrix
A, packed columnwise in a linear array. The j-th column ofAis stored in the arrayAPas follows:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
- On exit, the equilibrated matrix:
diag(S) * A * diag(S), in the same storage format asA. π¦
- On entry, the upper or lower triangle of the symmetric matrix
Sβ isREALarray, dimension(N). The scale factors forA. πSCONDβ isREAL. Ratio of the smallestS(i)to the largestS(i). πAMAXβ isREAL. Absolute value of largest matrix entry. π₯EQUEDβ isCHARACTER*1. Specifies whether or not equilibration was done.= 'N': No equilibration.= 'Y': Equilibration was done, i.e.,Ahas been replaced bydiag(S) * A * diag(S). π
Internal Parameters:
THRESH is a threshold value used to decide if scaling should be done based on the ratio of the scaling factors. If SCOND < THRESH, scaling is done. π
LARGE and SMALL are threshold values used to decide if scaling should be done based on the absolute size of the largest matrix element. If AMAX > LARGE or AMAX < SMALL, scaling is done. π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine clar1v
subroutine clar1v (integer N, integer B1, integer BN, real LAMBDA, real,
dimension( * ) D, real, dimension( * ) L, real, dimension( * ) LD, real,
dimension( * ) LLD, real PIVMIN, real GAPTOL, complex, dimension( * ) Z,
logical WANTNC, integer NEGCNT, real ZTZ, real MINGMA, integer R,
integer, dimension( * ) ISUPPZ, real NRMINV, real RESID, real RQCORR,
real, dimension( * ) WORK)
CLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the tridiagonal matrix LDLT - Ξ»I. not the whole inverse, just one column, just the one that matters. lowkey genius behaviour. π§ β¨
Purpose:
CLAR1V computes the (scaled) r-th column of the inverse of the sumbmatrix in rows B1 through BN of the tridiagonal matrix L D L**T - sigma I. When sigma is close to an eigenvalue, the computed vector is an accurate eigenvector. Usually, r corresponds to the index where the eigenvector is largest in magnitude. The following steps accomplish this computation:
- Stationary qd transform,
L D L**T - sigma I = L(+) D(+) L(+)**T, - Progressive qd transform,
L D L**T - sigma I = U(-) D(-) U(-)**T, - Computation of the diagonal elements of the inverse of
L D L**T - sigma Iby combining the above transforms, and choosingras the index where the diagonal of the inverse is (one of the) largest in magnitude. - Computation of the (scaled) r-th column of the inverse using the twisted factorization obtained by combining the top part of the the stationary and the bottom part of the progressive transform. π«
Parameters
Nβ isINTEGER. The order of the matrixL D L**T. πB1β isINTEGER. First index of the submatrix ofL D L**T. πΈBNβ isINTEGER. Last index of the submatrix ofL D L**T. π¦LAMBDAβ isREAL. The shift. In order to compute an accurate eigenvector,LAMBDAshould be a good approximation to an eigenvalue ofL D L**T. π―Lβ isREALarray, dimension(N-1). The (n-1) subdiagonal elements of the unit bidiagonal matrixL, in elements 1 toN-1. β¨Dβ isREALarray, dimension(N). The n diagonal elements of the diagonal matrixD. πLDβ isREALarray, dimension(N-1). The n-1 elementsL(i)*D(i). πLLDβ isREALarray, dimension(N-1). The n-1 elementsL(i)*L(i)*D(i). πPIVMINβ isREAL. The minimum pivot in the Sturm sequence. π₯GAPTOLβ isREAL. Tolerance that indicates when eigenvector entries are negligible w.r.t. their contribution to the residual. πZβ isCOMPLEXarray, dimension(N).- On input, all entries of
Zmust be set to0. fr fr, all of them, zero them out first. π - On output,
Zcontains the (scaled) r-th column of the inverse. The scaling is such thatZ(R)equals1. π
- On input, all entries of
WANTNCβ isLOGICAL. Specifies whetherNEGCNThas to be computed. π€NEGCNT
π¦ NEGCNT π¦
NEGCNT is INTEGER. If WANTNC is .TRUE. then NEGCNT = the number of pivots < pivmin in the matrix factorization L D L**T, and NEGCNT = -1 otherwise.
π¦ ZTZ π¦
ZTZ is REAL. The square of the 2-norm of Z.
π¦ MINGMA π¦
MINGMA is REAL. The reciprocal of the largest (in magnitude) diagonal element of the inverse of L D L**T - sigma I.
π¦ R π¦
R is INTEGER. The twist index for the twisted factorization used to compute Z.
- On input,
0 <= R <= N. IfRis input as0,Ris set to the index where(L D L**T - sigma I)^{-1}is largest in magnitude. If1 <= R <= N,Ris unchanged. - On output,
Rcontains the twist index used to computeZ. Ideally,Rdesignates the position of the maximum entry in the eigenvector.
π¦ ISUPPZ π¦
ISUPPZ is INTEGER array, dimension (2). The support of the vector in Z, i.e., the vector Z is nonzero only in elements ISUPPZ(1) through ISUPPZ( 2 ).
π¦ NRMINV π¦
NRMINV is REAL. NRMINV = 1/SQRT( ZTZ )
π¦ RESID π¦
RESID is REAL. The residual of the FP vector. RESID = ABS( MINGMA )/SQRT( ZTZ )
π¦ RQCORR π¦
RQCORR is REAL. The Rayleigh Quotient correction to LAMBDA. RQCORR = MINGMA*TMP
π¦ WORK π¦
WORK is REAL array, dimension (4*N)
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors: π
- Beresford Parlett, University of California, Berkeley, USA
- Jim Demmel, University of California, Berkeley, USA
- Inderjit Dhillon, University of Texas, Austin, USA
- Osni Marques, LBNL/NERSC, USA
- Christof Voemel, University of California, Berkeley, USA
π subroutine clar2v π
subroutine clar2v (integer N, complex, dimension( * ) X, complex, dimension(
* ) Y, complex, dimension( * ) Z, integer INCX, real, dimension( * ) C,
complex, dimension( * ) S, integer INCC)
CLAR2V applies a vector of plane rotations with real cosines and complex sines from both sides to a sequence of 2-by-2 symmetric/Hermitian matrices. bestie. it does the both sides thing. iconic.
β¨ Purpose β¨
CLAR2V applies a vector of complex plane rotations with real cosines from both sides to a sequence of 2-by-2 complex Hermitian matrices, defined by the elements of the vectors x, y and z. For i = 1,2,...,n
( x(i) z(i) ) :=
( conjg(z(i)) y(i) )
( c(i) conjg(s(i)) ) ( x(i) z(i) ) ( c(i) -conjg(s(i)) )
( -s(i) c(i) ) ( conjg(z(i)) y(i) ) ( s(i) c(i) )
β¨ Parameters β¨
NβNisINTEGER. The number of plane rotations to be applied.XβXisCOMPLEX array, dimension (1+(N-1)*INCX). The vectorx; the elements ofxare assumed to be real.YβYisCOMPLEX array, dimension (1+(N-1)*INCX). The vectory; the elements ofyare assumed to be real.ZβZisCOMPLEX array, dimension (1+(N-1)*INCX). The vectorz.INCXβINCXisINTEGER. The increment between elements ofX,YandZ.INCX > 0.CβCisREAL array, dimension (1+(N-1)*INCC). The cosines of the plane rotations.SβSisCOMPLEX array, dimension (1+(N-1)*INCC). The sines of the plane rotations.INCCβINCCisINTEGER. The increment between elements ofCandS.INCC > 0.
β¨ Author β¨
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π«Ά subroutine clarcm π«Ά
subroutine clarcm (integer M, integer N, real, dimension( lda, * ) A,
integer LDA, complex, dimension( ldb, * ) B, integer LDB, complex,
dimension( ldc, * ) C, integer LDC, real, dimension( * ) RWORK)
CLARCM copies all or part of a real two-dimensional array to a complex array. lowkey the simplest lil multiply in the whole building.
πΈ Purpose πΈ
CLARCM performs a very simple matrix-matrix multiplication:
C := A * B,
where A is M by M and real; B is M by N and complex; C is M by N and complex.
πΈ Parameters πΈ
MβMisINTEGER. The number of rows of the matrixAand of the matrixC.M >= 0.NβNisINTEGER. The number of columns and rows of the matrixBand the number of columns of the matrixC.N >= 0.AβAisREAL array, dimension (LDA, M). On entry,Acontains theMbyMmatrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >=max(1,M).BβBisCOMPLEX array, dimension (LDB, N). On entry,Bcontains theMbyNmatrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >=max(1,M).CβCisCOMPLEX array, dimension (LDC, N). On exit,Ccontains theMbyNmatrixC.LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >=max(1,M).RWORKβRWORKisREAL array, dimension (2*M*N).
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π
subroutine clarf π
subroutine clarf (character SIDE, integer M, integer N, complex, dimension(
* ) V, integer INCV, complex TAU, complex, dimension( ldc, * ) C,
integer LDC, complex, dimension( * ) WORK)
CLARF applies an elementary reflector to a general rectangular matrix. yes queen, go reflect.
β Purpose β
CLARF applies a complex elementary reflector H to a complex M-by-N matrix C, from either the left or the right. H is represented in the form
H = I - tau * v * v**H
where tau is a complex scalar and v is a complex vector.
If tau = 0, then H is taken to be the unit matrix.
To apply H**H (the conjugate transpose of H), supply conjg(tau) instead tau.
β Parameters β
SIDEβSIDEisCHARACTER*1= 'L': formH * C= 'R': formC * H
MβMisINTEGER. The number of rows of the matrixC.NβNisINTEGER. The number of columns of the matrixC.VβVisCOMPLEX array, dimension(1 + (M-1)*abs(INCV))ifSIDE = 'L'- or
(1 + (N-1)*abs(INCV))ifSIDE = 'R'
The vector v in the representation of H. V is not used if TAU = 0.
INCVβINCVisINTEGER. The increment between elements ofv.INCV <> 0.TAUβTAUisCOMPLEX. The valuetauin the representation ofH.CβCisCOMPLEX array, dimension (LDC,N). On entry, theM-by-NmatrixC. On exit,Cis overwritten by the matrixH * CifSIDE = 'L', orC * HifSIDE = 'R'.LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).WORKβWORKisCOMPLEX array, dimension(N)ifSIDE = 'L'- or
(M)ifSIDE = 'R'
β Author β
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine clarfb π
subroutine clarfb (character SIDE, character TRANS, character DIRECT,
character STOREV, integer M, integer N, integer K, complex, dimension(
ldv, * ) V, integer LDV, complex, dimension( ldt, * ) T, integer LDT,
complex, dimension( ldc, * ) C, integer LDC, complex, dimension( ldwork,
* ) WORK, integer LDWORK)
CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix. block reflector era. we love to see it π
π§ Purpose π§
CLARFB applies a complex block reflector H or its transpose H**H to a complex M-by-N matrix C, from either the left or the right.
π§ Parameters π§
SIDEβSIDEisCHARACTER*1= 'L': applyHorH**Hfrom the Left= 'R': applyHorH**Hfrom the Right
TRANSβTRANSisCHARACTER*1= 'N': applyH(No transpose)= 'C': applyH**H(Conjugate transpose)
DIRECTβDIRECTisCHARACTER*1. Indicates howHis formed from a product of elementary reflectors= 'F':H = H(1) H(2) . . . H(k)(Forward)= 'B':H = H(k) . . . H(2) H(1)(Backward)
STOREVβSTOREVisCHARACTER*1. Indicates how the vectors which define the elementary reflectors are stored:= 'C': Columnwise= 'R': Rowwise
MβMisINTEGER. The number of rows of the matrixC.NβNisINTEGER. The number of columns of the matrixC.KβKisINTEGER. The order of the matrixT(= the number of elementary reflectors whose product defines the block reflector). IfSIDE = 'L',M >= K >= 0; ifSIDE = 'R',N >= K >= 0.VβVisCOMPLEX array, dimension(LDV,K)ifSTOREV = 'C'(LDV,M)ifSTOREV = 'R'andSIDE = 'L'(LDV,N)ifSTOREV = 'R'andSIDE = 'R'
The matrix V. See Further Details.
LDVβLDVisINTEGER. The leading dimension of the arrayV. IfSTOREV = 'C'andSIDE = 'L',LDV >= max(1,M); ifSTOREV = 'C'andSIDE = 'R',LDV >= max(1,N); ifSTOREV = 'R',LDV >= K.TβTisCOMPLEX array, dimension (LDT,K). The triangularK-by-KmatrixTin the representation of the block reflector.LDTβLDTisINTEGER. The leading dimension of the arrayT.LDT >= K.CβCisCOMPLEX array, dimension (LDC,N). On entry, theM-by-NmatrixC. On exit,Cis overwritten byH*CorH**H*CorC*HorC*H**H.LDCβ and that's literally where the page cuts off, bestie π mid-parameter, no cap. next part picks it up.LDCis INTEGER β the leading dimension of the array C.LDC >= max(1,M).WORKis COMPLEX array, dimension(LDWORK,K).LDWORKis INTEGER β the leading dimension of the array WORK. IfSIDE = 'L', thenLDWORK >= max(1,N); ifSIDE = 'R', thenLDWORK >= max(1,M).
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ Further Details: π¦
The shape of the matrix V and the storage of the vectors which define the H(i) is best illustrated by the following example with n = 5 and k = 3. The elements equal to 1 are not stored; the corresponding array elements are modified but restored on exit. The rest of the array is not used.
DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
( v1 1 ) ( 1 v2 v2 v2 )
( v1 v2 1 ) ( 1 v3 v3 )
( v1 v2 v3 )
( v1 v2 v3 )
DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
V = ( v1 v2 v3 ) V = ( v1 v1 1 )
( v1 v2 v3 ) ( v2 v2 v2 1 )
( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
( 1 v3 )
( 1 )
π
subroutine clarfb_gett π
subroutine clarfb_gett (character IDENT, integer M, integer N, integer K,
complex, dimension( ldt, * ) T, integer LDT, complex, dimension( lda, *
) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, complex,
dimension( ldwork, * ) WORK, integer LDWORK)
CLARFB_GETT β bestie, say it with me π«Ά
β¨ Purpose: β¨
CLARFB_GETT applies a complex Householder block reflector H from the left to a complex (K+M)-by-N 'triangular-pentagonal' matrix composed of two block matrices: an upper trapezoidal K-by-N matrix A stored in the array A, and a rectangular M-by-(N-K) matrix B, stored in the array B. The block reflector H is stored in a compact WY-representation, where the elementary reflectors are in the arrays A, B and T. See Further Details section. π
πΈ Parameters πΈ
IDENTβIDENTisCHARACTER*1. IfIDENT= not'I', or not'i', then V1 is unit lower-triangular and stored in the leftK-by-Kblock of the input matrix A, IfIDENT = 'I'or'i', then V1 is an identity matrix and not stored. See Further Details section.MβMis INTEGER. The number of rows of the matrix B.M >= 0.NβNis INTEGER. The number of columns of the matrices A and B.N >= 0.KβKis INTEGER. The number or rows of the matrix A. K is also order of the matrix T, i.e. the number of elementary reflectors whose product defines the block reflector.0 <= K <= N.TβTis COMPLEX array, dimension(LDT,K). The upper-triangularK-by-Kmatrix T in the representation of the block reflector.LDTβLDTis INTEGER. The leading dimension of the array T.LDT >= K.AβAis COMPLEX array, dimension(LDA,N).
On entry:
- In the
K-by-Nupper-trapezoidal part A: input matrix A. - In the columns below the diagonal: columns of V1 (ones are not stored on the diagonal).
On exit: A is overwritten by rectangular K-by-N product H*A.
See Further Details section.
LDAβLDBis INTEGER. The leading dimension of the array A.LDA >= max(1,K).BβBis COMPLEX array, dimension(LDB,N).
On entry:
- In the
M-by-(N-K)right block: input matrix B. - In the
M-by-Nleft block: columns of V2.
On exit: B is overwritten by rectangular M-by-N product H*B.
See Further Details section.
LDBβLDBis INTEGER. The leading dimension of the array B.LDB >= max(1,M).WORKβWORKis COMPLEX array, dimension(LDWORK,max(K,N-K)).LDWORKβLDWORKis INTEGER. The leading dimension of the array WORK.LDWORK>=max(1,K).
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors: π
November 2020, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
π Further Details: π
(1) Description of the Algebraic Operation.
The matrix A is a K-by-N matrix composed of two column block matrices, A1, which is K-by-K, and A2, which is K-by-(N-K):
A = ( A1, A2 ).
The matrix B is an M-by-N matrix composed of two column block matrices, B1, which is M-by-K, and B2, which is M-by-(N-K):
B = ( B1, B2 ).
Perform the operation:
( A_out ) := H * ( A_in ) = ( I - V * T * V**H ) * ( A_in ) =
( B_out ) ( B_in ) ( B_in )
= ( I - ( V1 ) * T * ( V1**H, V2**H ) ) * ( A_in )
( V2 ) ( B_in )
On input:
a)
( A_in ) consists of two block columns:
( B_in )
( A_in ) = (( A1_in ) ( A2_in )) = (( A1_in ) ( A2_in ))
( B_in ) (( B1_in ) ( B2_in )) (( 0 ) ( B2_in )),
where the column blocks are:
( A1_in ) is a K-by-K upper-triangular matrix stored in the
upper triangular part of the array A(1:K,1:K).
( B1_in ) is an M-by-K rectangular ZERO matrix and not stored.
( A2_in ) is a K-by-(N-K) rectangular matrix stored
in the array A(1:K,K+1:N).
( B2_in ) is an M-by-(N-K) rectangular matrix stored
in the array B(1:M,K+1:N).
b)
V = ( V1 )
( V2 )
where:
- if
IDENT == 'I', V1 is aK-by-Kidentity matrix, not stored; - if
IDENT != 'I', V1 is aK-by-Kunit lower-triangular matrix, stored in the lower-triangular part of the arrayA(1:K,1:K)(ones are not stored),
and V2 is an M-by-K rectangular stored the array B(1:M,1:K), (because on input B1_in is a rectangular zero matrix that is not stored and the space is used to store V2).
c) T is a K-by-K upper-triangular matrix stored in the array T(1:K,1:K).
On output:
a)
( A_out ) consists of two block columns:
( B_out )
( A_out ) = (( A1_out ) ( A2_out ))
( B_out ) (( B1_out ) ( B2_out )),
where the column blocks are:
( A1_out ) is a K-by-K square matrix, or a K-by-K
upper-triangular matrix, if V1 is an
identity matrix. AiOut is stored in
the array A(1:K,1:K).
( B1_out ) is an M-by-K rectangular matrix stored
in the array B(1:M,K:N).
( A2_out ) is a K-by-(N-K) rectangular matrix stored
in the array A(1:K,K+1:N).
( B2_out ) is an M-by-(N-K) rectangular matrix stored
in the array B(1:M,K+1:N).
The operation above can be represented as the same operation on each block column:
( A1_out ) := H * ( A1_in ) = ( I - V * T * V**H ) * ( A1_in )
( B1_out ) ( 0 ) ( 0 )
( A2_out ) := H * ( A2_in ) = ( I - V * T * V**H ) * ( A2_in )
( B2_out ) ( B2_in ) ( B2_in )
If IDENT != 'I':
The computation for column block 1:
A1_out: = A1_in - V1*T*(V1**H)*A1_in
B1_out: = - V2*T*(V1**H)*A1_in
The computation for column block 2, which exists if N > K:
A2_out: = A2_in - V1*T*( (V1**H)*A2_in + (V2**H)*B2_in )
B2_out: = B2_in - V2*T*( (V1**H)*A2_in + (V2**H)*B2_in )
If IDENT == 'I':
The operation for column block 1:
A1_out: = A1_in - V1*T*A1_in
B1_out: = - V2*T*A1_in
The computation for column block 2, which exists if N > K:
A2_out: = A2_in - T*( A2_in + (V2**H)*B2_in )
B2_out: = B2_in - V2*T*( A2_in + (V2**H)*B2_in )
(2) Description of the Algorithmic Computation.
In the first step, we compute column block 2, i.e. A2 and B2. Here, we need to use the K-by-(N-K) rectangular workspace matrix W2 that is of the same size as the matrix A2. W2 is stored in the array WORK(1:K,1:(N-K)).
In the second step, we compute column block 1, i.e. A1 and B1. Here, we need to use the K-by-K square workspace matrix W1 that is of the same size as the as the matrix A1. W1 is stored in the array WORK(1:K,1:K).
NOTE: Hence, in this routine, we need the workspace array WORK only of size WORK(1:K,1:max(K,N-K)) so it can hold both W2 from the first step and W1 from the second step.
Case (A), when V1 is unit lower-triangular, i.e. IDENT != 'I', more computations than in the Case (B).
if( IDENT != 'I' ) then
if ( N > K ) then
(First Step - column block 2)
col2_(1) W2: = A2
col2_(2) W2: = (V1**H) * W2 = (unit_lower_tr_of_(A1)**H) * W2
col2_(3) W2: = W2 + (V2**H) * B2 = W2 + (B1**H) * B2
col2_(4) W2: = T * W2
col2_(5) B2: = B2 - V2 * W2 = B2 - B1 * W2
col2_(6) W2: = V1 * W2 = unit_lower_tr_of_(A1) * W2
col2_(7) A2: = A2 - W2
else
(Second Step - column block 1)
col1_(1) W1: = A1
col1_(2) W1: = (V1**H) * W1 = (unit_lower_tr_of_(A1)**H) * W1
col1_(3) W1: = T * W1
col1_(4) B1: = - V2 * W1 = - B1 * W1
col1_(5) square W1: = V1 * W1 = unit_lower_tr_of_(A1) * W1
col1_(6) square A1: = A1 - W1
end if
end if
π¦ Case (B) β when V1 is an identity matrix, i.e. IDENT == 'I', less computations than in the Case (A) π¦
okay so when V1 is literally just the identity matrix, you get to skip a whole bunch of steps, and the glow-up is real. here's the receipts:
if( IDENT == 'I' ) then
if ( N > K ) then
(First Step - column block 2)
col2_(1) W2: = A2
col2_(3) W2: = W2 + (V2**H) * B2 = W2 + (B1**H) * B2
col2_(4) W2: = T * W2
col2_(5) B2: = B2 - V2 * W2 = B2 - B1 * W2
col2_(7) A2: = A2 - W2
else
(Second Step - column block 1)
col1_(1) W1: = A1
col1_(3) W1: = T * W1
col1_(4) B1: = - V2 * W1 = - B1 * W1
col1_(6) upper-triangular_of_(A1): = A1 - W1
end if
end if
π the combined algorithm (cases (A) + (B), merged, iconic) π
Combine these cases (A) and (B) together, this is the resulting algorithm β and bestie, this is the one that actually runs:
if ( N > K ) then
(First Step - column block 2)
col2_(1) W2: = A2
if( IDENT != 'I' ) then
col2_(2) W2: = (V1**H) * W2
= (unit_lower_tr_of_(A1)**H) * W2
end if
col2_(3) W2: = W2 + (V2**H) * B2 = W2 + (B1**H) * B2]
col2_(4) W2: = T * W2
col2_(5) B2: = B2 - V2 * W2 = B2 - B1 * W2
if( IDENT != 'I' ) then
col2_(6) W2: = V1 * W2 = unit_lower_tr_of_(A1) * W2
end if
col2_(7) A2: = A2 - W2
else
(Second Step - column block 1)
col1_(1) W1: = A1
if( IDENT != 'I' ) then
col1_(2) W1: = (V1**H) * W1
= (unit_lower_tr_of_(A1)**H) * W1
end if
col1_(3) W1: = T * W1
col1_(4) B1: = - V2 * W1 = - B1 * W1
if( IDENT != 'I' ) then
col1_(5) square W1: = V1 * W1 = unit_lower_tr_of_(A1) * W1
col1_(6_a) below_diag_of_(A1): = - below_diag_of_(W1)
end if
col1_(6_b) up_tr_of_(A1): = up_tr_of_(A1) - up_tr_of_(W1)
end if
β¨ subroutine clarfg β¨
subroutine clarfg (integer N, complex ALPHA, complex, dimension( * ) X,
integer INCX, complex TAU)
CLARFG generates an elementary reflector (Householder matrix).
π Purpose π
okay so CLARFG generates a complex elementary reflector H of order n, such that
H**H * ( alpha ) = ( beta ), H**H * H = I.
( x ) ( 0 )
where alpha and beta are scalars, with beta real, and x is an (n-1)-element complex vector. H is represented in the form
H = I - tau * ( 1 ) * ( 1 v**H ) ,
( v )
where tau is a complex scalar and v is a complex (n-1)-element vector. Note that H is not hermitian β like, do not come for me assuming it is, it isn't π
If the elements of x are all zero and alpha is real, then tau = 0 and H is taken to be the unit matrix.
Otherwise 1 <= real(tau) <= 2 and abs(tau-1) <= 1. periodt.
π«Ά Parameters π«Ά
NβNis INTEGER. The order of the elementary reflector.ALPHAβALPHAis COMPLEX. On entry, the valuealpha. On exit, it is overwritten with the valuebeta. bye bestie, new identity just dropped π¦XβXis COMPLEX array, dimension(1+(N-2)*abs(INCX)). On entry, the vectorx. On exit, it is overwritten with the vectorv.INCXβINCXis INTEGER. The increment between elements ofX.INCX > 0.TAUβTAUis COMPLEX. The valuetau.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine clarfgp π
subroutine clarfgp (integer N, complex ALPHA, complex, dimension( * ) X,
integer INCX, complex TAU)
CLARFGP generates an elementary reflector (Householder matrix) with non-negative beta.
πΈ Purpose πΈ
CLARFGP generates a complex elementary reflector H of order n, such that
H**H * ( alpha ) = ( beta ), H**H * H = I.
( x ) ( 0 )
where alpha and beta are scalars, beta is real and non-negative, and x is an (n-1)-element complex vector. H is represented in the form
H = I - tau * ( 1 ) * ( 1 v**H ) ,
( v )
where tau is a complex scalar and v is a complex (n-1)-element vector. Note that H is not hermitian.
If the elements of x are all zero and alpha is real, then tau = 0 and H is taken to be the unit matrix.
π Parameters π
NβNis INTEGER. The order of the elementary reflector.ALPHAβALPHAis COMPLEX. On entry, the valuealpha. On exit, it is overwritten with the valuebeta.XβXis COMPLEX array, dimension(1+(N-2)*abs(INCX)). On entry, the vectorx. On exit, it is overwritten with the vectorv.INCXβINCXis INTEGER. The increment between elements ofX.INCX > 0.TAUβTAUis COMPLEX. The valuetau.
β Author β
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ subroutine clarft π₯
subroutine clarft (character DIRECT, character STOREV, integer N, integer K,
complex, dimension( ldv, * ) V, integer LDV, complex, dimension( * )
TAU, complex, dimension( ldt, * ) T, integer LDT)
CLARFT forms the triangular factor T of a block reflector H = I - vtvH
β¨ Purpose β¨
CLARFT forms the triangular factor T of a complex block reflector H of order n, which is defined as a product of k elementary reflectors.
- If
DIRECT = 'F',H = H(1) H(2) . . . H(k)andTis upper triangular; - If
DIRECT = 'B',H = H(k) . . . H(2) H(1)andTis lower triangular.
If STOREV = 'C', the vector which defines the elementary reflector H(i) is stored in the i-th column of the array V, and
H = I - V * T * V**H
If STOREV = 'R', the vector which defines the elementary reflector H(i) is stored in the i-th row of the array V, and
H = I - V**H * T * V
π§ Parameters π§
DIRECTβDIRECTis CHARACTER*1. Specifies the order in which the elementary reflectors are multiplied to form the block reflector:= 'F':H = H(1) H(2) . . . H(k)(Forward)= 'B':H = H(k) . . . H(2) H(1)(Backward)
STOREVβSTOREVis CHARACTER*1. Specifies how the vectors which define the elementary reflectors are stored (see also Further Details):= 'C': columnwise= 'R': rowwise
NβNis INTEGER. The order of the block reflectorH.N >= 0.KβKis INTEGER. The order of the triangular factorT(= the number of elementary reflectors).K >= 1.VβVis COMPLEX array, dimension(LDV,K)ifSTOREV = 'C'(LDV,N)ifSTOREV = 'R'
The matrix V. See further details.
LDVβLDVis INTEGER. The leading dimension of the arrayV. IfSTOREV = 'C',LDV >= max(1,N); ifSTOREV = 'R',LDV >= K.TAUβTAUis COMPLEX array, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i).TβTis COMPLEX array, dimension(LDT,K). The k by k triangular factorTof the block reflector. IfDIRECT = 'F',Tis upper triangular; ifDIRECT = 'B',Tis lower triangular. The rest of the array is not used.LDTβLDTis INTEGER. The leading dimension of the arrayT.LDT >= K.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
The shape of the matrix V and the storage of the vectors which define the H(i) is best illustrated by the following example with n = 5 and k = 3. The elements equal to 1 are not stored.
DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
( v1 1 ) ( 1 v2 v2 v2 )
( v1 v2 1 ) ( 1 v3 v3 )
( v1 v2 v3 )
( v1 v2 v3 )
DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
V = ( v1 v2 v3 ) V = ( v1 v1 1 )
( v1 v2 v3 ) ( v2 v2 v2 1 )
( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
( 1 v3 )
( 1 )
π¦ subroutine clarfx π¦
subroutine clarfx (character SIDE, integer M, integer N, complex, dimension(
* ) V, complex TAU, complex, dimension( ldc, * ) C, integer LDC,
complex, dimension( * ) WORK)
CLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the reflector has order β€ 10.
π« Purpose π«
CLARFX applies a complex elementary reflector H to a complex m by n matrix C, from either the left or the right. H is represented in the form
H = I - tau * v * v**H
where tau is a complex scalar and v is a complex vector.
If tau = 0, then H is taken to be the unit matrix
This version uses inline code if H has order < 11.
πΈ Parameters πΈ
SIDEβ bestie hold that thought, this one finishes in the next part πSIDEisCHARACTER*1= 'L': formH * C= 'R': formC * H
M
M is INTEGER
The number of rows of the matrix C.
N
N is INTEGER
The number of columns of the matrix C.
V
V is COMPLEX array, dimension (M) if SIDE = 'L' or (N) if SIDE = 'R'
The vector v in the representation of H.
TAU
TAU is COMPLEX
The value tau in the representation of H.
C
C is COMPLEX array, dimension (LDC,N)
On entry, the m by n matrix C.
On exit, C is overwritten by the matrix H * C if SIDE = 'L', or C * H if SIDE = 'R'.
LDC
LDC is INTEGER
The leading dimension of the array C. LDC >= max(1,M).
WORK
WORK is COMPLEX array, dimension (N) if SIDE = 'L' or (M) if SIDE = 'R'
WORK is not referenced if H has order < 11. (it literally just sits there, unbothered, when H is smol π
)
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine clarfy (character UPLO, integer N, complex, dimension( * ) V, integer INCV, complex TAU, complex, dimension( ldc, * ) C, integer LDC, complex, dimension( * ) WORK)
CLARFY β¨
πΈ Purpose:
CLARFY applies an elementary reflector, or Householder matrix, H, to an n x n Hermitian matrix C, from both the left and the right.
H is represented in the form
H = I - tau * v * v'
where tau is a scalar and v is a vector.
If tau is zero, then H is taken to be the unit matrix. (free pass, no work today bestie)
π Parameters
UPLO
UPLO is CHARACTER*1
Specifies whether the upper or lower triangular part of the Hermitian matrix C is stored.
= 'U': Upper triangle= 'L': Lower triangle
N
N is INTEGER
The number of rows and columns of the matrix C. N >= 0.
V
V is COMPLEX array, dimension (1 + (N-1)*abs(INCV))
The vector v as described above.
INCV
INCV is INTEGER
The increment between successive elements of v. INCV must not be zero. (do NOT be out here passing zero, that's not the vibe π)
TAU
TAU is COMPLEX
The value tau as described above.
C
C is COMPLEX array, dimension (LDC, N)
On entry, the matrix C.
On exit, C is overwritten by H * C * H'.
LDC
LDC is INTEGER
The leading dimension of the array C. LDC >= max( 1, N ).
WORK
WORK is COMPLEX array, dimension (N)
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π«Ά subroutine clargv (integer N, complex, dimension( * ) X, integer INCX, complex, dimension( * ) Y, integer INCY, real, dimension( * ) C, integer INCC)
CLARGV generates a vector of plane rotations with real cosines and complex sines. (cosines stay real, sines get to be complex, it's giving main character energy)
π Purpose:
CLARGV generates a vector of complex plane rotations with real cosines, determined by elements of the complex vectors x and y. For i = 1,2,...,n
( c(i) s(i) ) ( x(i) ) = ( r(i) )
( -conjg(s(i)) c(i) ) ( y(i) ) = ( 0 )
where c(i)**2 + ABS(s(i))**2 = 1
The following conventions are used (these are the same as in CLARTG, but differ from the BLAS1 routine CROTG):
- If
y(i)=0, thenc(i)=1ands(i)=0. - If
x(i)=0, thenc(i)=0ands(i)is chosen so thatr(i)is real.
β¨ Parameters
N
N is INTEGER
The number of plane rotations to be generated.
X
X is COMPLEX array, dimension (1+(N-1)*INCX)
On entry, the vector x.
On exit, x(i) is overwritten by r(i), for i = 1,...,n.
INCX
INCX is INTEGER
The increment between elements of X. INCX > 0.
Y
Y is COMPLEX array, dimension (1+(N-1)*INCY)
On entry, the vector y.
On exit, the sines of the plane rotations.
INCY
INCY is INTEGER
The increment between elements of Y. INCY > 0.
C
C is REAL array, dimension (1+(N-1)*INCC)
The cosines of the plane rotations.
INCC
INCC is INTEGER
The increment between elements of C. INCC > 0.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ Further Details:
6-6-96 - Modified with a new algorithm by W. Kahan and J. Demmel
This version has a few statements commented out for thread safety (machine parameters are computed on each entry). 10 feb 03, SJH. (thread safety said "I got this", and honestly? it did)
β subroutine clarnv (integer IDIST, integer, dimension( 4 ) ISEED, integer N, complex, dimension( * ) X)
CLARNV returns a vector of random numbers from a uniform or normal distribution. β¨ rng era β¨
π Purpose:
CLARNV returns a vector of n random complex numbers from a uniform or normal distribution.
π¦ Parameters
IDIST
IDIST is INTEGER
Specifies the distribution of the random numbers:
= 1: real and imaginary parts each uniform(0,1)= 2: real and imaginary parts each uniform(-1,1)= 3: real and imaginary parts each normal(0,1)= 4: uniformly distributed on the discabs(z) < 1= 5: uniformly distributed on the circleabs(z) = 1
ISEED
ISEED is INTEGER array, dimension (4)
On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. (odd!! not even, bestie, the whole thing breaks otherwise π)
On exit, the seed is updated.
N
N is INTEGER
The number of random numbers to be generated.
X
X is COMPLEX array, dimension (N)
The generated random numbers.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details:
This routine calls the auxiliary routine SLARUV to generate random real numbers from a uniform (0,1) distribution, in batches of up to 128 using vectorisable code. The Box-Muller method is used to transform numbers from a uniform to a normal distribution. (Box-Muller is the moment, no notes)
π subroutine clarrv (integer N, real VL, real VU, real, dimension( * ) D, real, dimension( * ) L, real PIVMIN, integer, dimension( * ) ISPLIT, integer M, integer DOL, integer DOU, real MINRGP, real RTOL1, real RTOL2, real, dimension( * ) W, real, dimension( * ) WERR, real, dimension( * ) WGAP, integer, dimension( * ) IBLOCK, integer, dimension( * ) INDEXW, real, dimension( * ) GERS, complex, dimension( ldz, * ) Z, integer LDZ, integer, dimension( * ) ISUPPZ, real, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
CLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues of L D LT. (big one. huge even. iconic behavior)
π Purpose:
CLARRV computes the eigenvectors of the tridiagonal matrix
T = L D L**T given L, D and APPROXIMATIONS to the eigenvalues of L D L**T.
The input eigenvalues should have been computed by SLARRE. (should have been β as in, that's not optional, that's the assignment)
πΈ Parameters
N
N is INTEGER
The order of the matrix. N >= 0.
VL
VL is REAL
Lower bound of the interval that contains the desired eigenvalues. VL < VU. Needed to compute gaps on the left or right end of the extremal eigenvalues in the desired RANGE.
VU
VU is REAL
Upper bound of the interval that contains the desired eigenvalues. VL < VU. Needed to compute gaps on the left or right end of the extremal eigenvalues in the desired RANGE.
D
D is REAL array, dimension (N)
On entry, the N diagonal elements of the diagonal matrix D.
On exit, D may be overwritten.
L
L is REAL array, dimension (N)
On entry, the (N-1) subdiagonal elements of the unit bidiagonal matrix L are in elements 1 to N-1 of L (if the matrix is not split.) At the end of each block is stored the corresponding shift as given by SLARRE.
On exit, L is overwritten.
PIVMIN
PIVMIN is REAL
The minimum pivot allowed in the Sturm sequence.
ISPLIT
ISPLIT is INTEGER array, dimension (N)
The splitting points, at which T breaks up into blocks. The first block consists of rows/columns 1 to ISPLIT( 1 ), the second of rows/columns ISPLIT( 1 )+1 through ISPLIT( 2 ), etc.
M
M is INTEGER
The total number of input eigenvalues. 0 <= M <= N.
DOL
DOL is INTEGER
DOU
DOU is INTEGER
If the user wants to compute only selected eigenvectors from all the eigenvalues supplied, he can specify an index range DOL:DOU. Or else the setting DOL=1, DOU=M should be applied. Note that DOL and DOU refer to the order in which the eigenvalues are stored in W.
If the user wants to compute only selected eigenpairs, then the columns DOL-1 to DOU+1 of the eigenvector space Z contain the computed eigenvectors. All other columns of Z are set to zero.
MINRGP
MINRGP is REAL
RTOL1
RTOL1 is REAL
RTOL2
RTOL2 is REAL
Parameters for bisection. An interval [LEFT,RIGHT] has converged if
RIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) )
WWβ bestie, this is a REAL array, dimension(N). The firstMelements are holding the APPROXIMATE eigenvalues for which eigenvectors are to be computed. You gotta group those eigenvalues by split-off block and order them from smallest to largest within the block (yes, the output arrayWfromSLARREis what's expected here, no cap). Furthermore, they are with respect to the shift of the corresponding root representation for their block. On exit,Wholds the eigenvalues of the UNshifted matrix. Periodt.WERRβWERRis REAL array, dimension(N). The firstMelements contain the semiwidth of the uncertainty interval of the corresponding eigenvalue inW. πWGAPβWGAPis REAL array, dimension(N). The separation from the right neighbor eigenvalue inW.IBLOCKβIBLOCKis INTEGER array, dimension(N). The indices of the blocks (submatrices) associated with the corresponding eigenvalues inW;IBLOCK(i)=1if eigenvalueW(i)belongs to the first block from the top,=2ifW(i)belongs to the second block, etc.INDEXWβINDEXWis INTEGER array, dimension(N). The indices of the eigenvalues within each block (submatrix); for example,INDEXW(i)= 10andIBLOCK(i)=2imply that the i-th eigenvalueW(i)is the 10-th eigenvalue in the second block.GERSβGERSis REAL array, dimension(2*N). TheNGerschgorin intervals (the i-th Gerschgorin interval is(GERS(2*i-1), GERS(2*i))). The Gerschgorin intervals should be computed from the original UNshifted matrix.ZβZis COMPLEX array, dimension(LDZ, max(1,M) ). IfINFO = 0, the firstMcolumns ofZcontain the orthonormal eigenvectors of the matrixTcorresponding to the input eigenvalues, with the i-th column ofZholding the eigenvector associated withW(i). Note: the user must ensure that at leastmax(1,M)columns are supplied in the arrayZ.LDZβLDZis INTEGER. The leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).ISUPPZβISUPPZis INTEGER array, dimension( 2*max(1,M) ). The support of the eigenvectors inZ, i.e., the indices indicating the nonzero elements inZ. The I-th eigenvector is nonzero only in elementsISUPPZ( 2*I-1 )throughISUPPZ( 2*I ).WORKβWORKis REAL array, dimension(12*N).IWORKβIWORKis INTEGER array, dimension(7*N).INFOβINFOis INTEGER. Here's the breakdown, bestie:= 0:successful exit> 0:A problem occurred inCLARRV.< 0:One of the called subroutines signaled an internal problem. Needs inspection of the corresponding parameterIINFOfor further information.=-1:Problem inSLARRBwhen refining a child's eigenvalues.=-2:Problem inSLARRFwhen computing the RRR of a child. When a child is inside a tight cluster, it can be difficult to find an RRR. A partial remedy from the user's point of view is to make the parameterMINRGPsmaller and recompile. However, as the orthogonality of the computed vectors is proportional to1/MINRGP, the user should be aware that he might be trading in precision when he decreasesMINRGP.=-3:Problem inSLARRBwhen refining a single eigenvalue after the Rayleigh correction was rejected.= 5:The Rayleigh Quotient Iteration failed to converge to full accuracy inMAXITRsteps.
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- Beresford Parlett, University of California, Berkeley, USA
- Jim Demmel, University of California, Berkeley, USA
- Inderjit Dhillon, University of Texas, Austin, USA
- Osni Marques, LBNL/NERSC, USA
- Christof Voemel, University of California, Berkeley, USA
β¨ subroutine clartv β¨
subroutine clartv (integer N, complex, dimension( * ) X, integer INCX,
complex, dimension( * ) Y, integer INCY, real, dimension( * ) C,
complex, dimension( * ) S, integer INCC)
CLARTV applies a vector of plane rotations with real cosines and complex sines to the elements of a pair of vectors. It's giving glow-up for your vectors. β¨
Purpose:
CLARTV applies a vector of complex plane rotations with real cosines to elements of the complex vectors x and y. For i = 1,2,...,n
( x(i) ) := ( c(i) s(i) ) ( x(i) )
( y(i) ) ( -conjg(s(i)) c(i) ) ( y(i) )
Parameters:
NβNis INTEGER. The number of plane rotations to be applied.XβXis COMPLEX array, dimension(1+(N-1)*INCX). The vector x.INCXβINCXis INTEGER. The increment between elements of X.INCX > 0.YβYis COMPLEX array, dimension(1+(N-1)*INCY). The vector y.INCYβINCYis INTEGER. The increment between elements of Y.INCY > 0.CβCis REAL array, dimension(1+(N-1)*INCC). The cosines of the plane rotations.SβSis COMPLEX array, dimension(1+(N-1)*INCC). The sines of the plane rotations.INCCβINCCis INTEGER. The increment between elements of C and S.INCC > 0.
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
β¨ subroutine clascl β¨
subroutine clascl (character TYPE, integer KL, integer KU, real CFROM, real
CTO, integer M, integer N, complex, dimension( lda, * ) A, integer LDA,
integer INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom. No cap.
Purpose:
CLASCL multiplies the M by N complex matrix A by the real scalar CTO/CFROM. This is done without over/underflow as long as the final result CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that A may be full, upper triangular, lower triangular, upper Hessenberg, or banded.
Parameters:
TYPEβTYPEis CHARACTER*1.TYPEindices the storage type of the input matrix.= 'G':A is a full matrix.= 'L':A is a lower triangular matrix.= 'U':A is an upper triangular matrix.= 'H':A is an upper Hessenberg matrix.= 'B':A is a symmetric band matrix with lower bandwidthKLand upper bandwidthKUand with the only the lower half stored.= 'Q':A is a symmetric band matrix with lower bandwidthKLand upper bandwidthKUand with the only the upper half stored.= 'Z':A is a band matrix with lower bandwidthKLand upper bandwidthKU. SeeCGBTRFfor storage details.
KLβKLis INTEGER. The lower bandwidth of A. Referenced only ifTYPE = 'B','Q'or'Z'.KUβKUis INTEGER. The upper bandwidth of A. Referenced only ifTYPE = 'B','Q'or'Z'.CFROMβCFROMis REAL.CTOβCTOis REAL. The matrixAis multiplied byCTO/CFROM.A(I,J)is computed without over/underflow if the final resultCTO*A(I,J)/CFROMcan be represented without over/underflow.CFROMmust be nonzero.MβMis INTEGER. The number of rows of the matrix A.M >= 0.NβNis INTEGER. The number of columns of the matrix A.N >= 0.AβAis COMPLEX array, dimension(LDA,N). The matrix to be multiplied byCTO/CFROM. SeeTYPEfor the storage type.LDAβLDAis INTEGER. The leading dimension of the array A. Here are the rules:
If TYPE = 'G', 'L', 'U', 'H', LDA >= max(1,M);
TYPE = 'B', LDA >= KL+1;
TYPE = 'Q', LDA >= KU+1;
TYPE = 'Z', LDA >= 2*KL+KU+1.
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 claset β¨
subroutine claset (character UPLO, integer M, integer N, complex ALPHA,
complex BETA, complex, dimension( lda, * ) A, integer LDA)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. It's like setting the vibe of your matrix. π
Purpose:
CLASET initializes a 2-D array A to BETA on the diagonal and ALPHA on the offdiagonals.
Parameters:
UPLOβUPLOis CHARACTER*1. Specifies the part of the matrix A to be set.= 'U':Upper triangular part is set. The lower triangle is unchanged.= 'L':Lower triangular part is set. The upper triangle is unchanged.- Otherwise: All of the matrix A is set.
MβMis INTEGER. On entry, M specifies the number of rows of A.NβNis INTEGER. On entry, N specifies the number of columns of A.ALPHAβALPHAis COMPLEX. All the offdiagonal array elements are set toALPHA.BETAβBETAis COMPLEX. All the diagonal array elements are set toBETA.AβAis COMPLEX array, dimension(LDA,N). On entry, the m by n matrix A. On exit,A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j;A(i,i) = BETA , 1 <= i <= min(m,n).LDAβLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π clasr β the plane-rotation glow-up π
subroutine clasr (character SIDE, character PIVOT, character DIRECT, integer
M, integer N, real, dimension( * ) C, real, dimension( * ) S, complex,
dimension( lda, * ) A, integer LDA)
CLASR applies a sequence of plane rotations to a general rectangular matrix. bestie. π
β¨ Purpose β¨
okay so CLASR takes a whole sequence of real plane rotations and applies them to a complex matrix A β from either the left or the right, whatever you're feeling. π¦
When SIDE = 'L', the transformation takes the form
A := P*A
and when SIDE = 'R', the transformation takes the form
A := A*P**T
where P is an orthogonal matrix consisting of a sequence of z plane rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', and P**T is the transpose of P. no cap. π
When DIRECT = 'F' (Forward sequence), then
P = P(z-1) * ... * P(2) * P(1)
and when DIRECT = 'B' (Backward sequence), then
P = P(1) * P(2) * ... * P(z-1)
where P(k) is a plane rotation matrix defined by the 2-by-2 rotation
R(k) = ( c(k) s(k) )
= ( -s(k) c(k) ).
When PIVOT = 'V' (Variable pivot), the rotation is performed for the plane (k,k+1), i.e., P(k) has the form
P(k) = ( 1 )
( ... )
( 1 )
( c(k) s(k) )
( -s(k) c(k) )
( 1 )
( ... )
( 1 )
where R(k) appears as a rank-2 modification to the identity matrix in rows and columns k and k+1. the way it just slides in there π
When PIVOT = 'T' (Top pivot), the rotation is performed for the plane (1,k+1), so P(k) has the form
P(k) = ( c(k) s(k) )
( 1 )
( ... )
( 1 )
( -s(k) c(k) )
( 1 )
( ... )
( 1 )
where R(k) appears in rows and columns 1 and k+1. β¨
Similarly, when PIVOT = 'B' (Bottom pivot), the rotation is performed for the plane (k,z), giving P(k) the form
P(k) = ( 1 )
( ... )
( 1 )
( c(k) s(k) )
( 1 )
( ... )
( 1 )
( -s(k) c(k) )
where R(k) appears in rows and columns k and z. and here's the iconic part: the rotations are performed without ever forming P(k) explicitly. not me being efficient π
πΈ Parameters πΈ
SIDEβSIDEisCHARACTER*1. specifies whether the plane rotation matrixPis applied toAon the left or the right.= 'L': Left, computeA := P*A= 'R': Right, computeA:= A*P**T
PIVOTβPIVOTisCHARACTER*1. specifies the plane for whichP(k)is a plane rotation matrix.= 'V': Variable pivot, the plane(k,k+1)= 'T': Top pivot, the plane(1,k+1)= 'B': Bottom pivot, the plane(k,z)
DIRECTβDIRECTisCHARACTER*1. specifies whetherPis a forward or backward sequence of plane rotations.MβMisINTEGER. the number of rows of the matrixA. ifm <= 1, an immediate return is effected. (we love an early exit π)NβNisINTEGER. the number of columns of the matrixA. ifn <= 1, an immediate return is effected.CβCisREALarray, dimension(M-1)ifSIDE = 'L'(N-1)ifSIDE = 'R'
the cosines c(k) of the plane rotations. π
SβSisREALarray, dimension(M-1)ifSIDE = 'L'(N-1)ifSIDE = 'R'
the sines s(k) of the plane rotations. the 2-by-2 plane rotation part of the matrix P(k), R(k), has the form
R(k) = ( c(k) s(k) )
( -s(k) c(k) ).
AβAisCOMPLEXarray, dimension(LDA,N). theM-by-NmatrixA. on exit,Ais overwritten byP*AifSIDE = 'R'or byA*P**TifSIDE = 'L'. π¦LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,M).
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π«Ά claswp β row swap central π«Ά
subroutine claswp (integer N, complex, dimension( lda, * ) A, integer LDA,
integer K1, integer K2, integer, dimension( * ) IPIV, integer INCX)
CLASWP performs a series of row interchanges on a general rectangular matrix. π₯
β¨ Purpose β¨
CLASWP performs a series of row interchanges on the matrix A. one row interchange is initiated for each of rows K1 through K2 of A. literally just swapping rows, bestie, one at a time. π
πΈ Parameters πΈ
NβNisINTEGER. the number of columns of the matrixA.AβAisCOMPLEXarray, dimension(LDA,N). on entry, the matrix of column dimensionNto which the row interchanges will be applied. on exit, the permuted matrix. β¨LDAβLDAisINTEGER. the leading dimension of the arrayA.K1βK1isINTEGER. the first element ofIPIVfor which a row interchange will be done.K2βK2isINTEGER.(K2-K1+1)is the number of elements ofIPIVfor which a row interchange will be done.IPIVβIPIVisINTEGERarray, dimension(K1+(K2-K1)*abs(INCX)). the vector of pivot indices. only the elements in positionsK1throughK1+(K2-K1)*abs(INCX)ofIPIVare accessed.IPIV(K1+(K-K1)*abs(INCX)) = Limplies rowsKandLare to be interchanged. πINCXβINCXisINTEGER. the increment between successive values ofIPIV. ifINCXis negative, the pivots are applied in reverse order. (yes, walking backwards, main character energy π)
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
Modified by
R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
π clatbs β triangular banded solver, but make it safe π
subroutine clatbs (character UPLO, character TRANS, character DIAG,
character NORMIN, integer N, integer KD, complex, dimension( ldab, * )
AB, integer LDAB, complex, dimension( * ) X, real SCALE, real,
dimension( * ) CNORM, integer INFO)
CLATBS solves a triangular banded system of equations. no cap. π
β¨ Purpose β¨
CLATBS solves one of the triangular systems
A * x = s*b, A**T * x = s*b, or A**H * x = s*b,
with scaling to prevent overflow, where A is an upper or lower triangular band matrix. here A**T denotes the transpose of A, x and b are n-element vectors, and s is a scaling factor, usually less than or equal to 1, chosen so that the components of x will be less than the overflow threshold. πΈ
if the unscaled problem will not cause overflow, the Level 2 BLAS routine CTBSV is called. if the matrix A is singular (A(j,j) = 0 for some j), then s is set to 0 and a non-trivial solution to A*x = 0 is returned. π (yes bestie, that's a real branch, read it again)
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1. specifies whether the matrixAis upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
TRANSβTRANSisCHARACTER*1. specifies the operation applied toA.= 'N': SolveA * x = s*b(No transpose)= 'T': SolveA**T * x = s*b(Transpose)= 'C': SolveA**H * x = s*b(Conjugate transpose)
DIAGβDIAGisCHARACTER*1. specifies whether or not the matrixAis unit triangular.= 'N': Non-unit triangular= 'U': Unit triangular
NORMINβNORMINisCHARACTER*1. specifies whetherCNORMhas been set or not.= 'Y':CNORMcontains the column norms on entry= 'N':CNORMis not set on entry. on exit, the norms will be computed and stored inCNORM.
NβNisINTEGER. the order of the matrixA.N >= 0.KDβKDisINTEGER. the number of subdiagonals or superdiagonals in the triangular matrixA.KD >= 0.ABβABisCOMPLEXarray, dimension(LDAB,N). the upper or lower triangular band matrixA, stored in the firstKD+1rows of the array. thej-th column ofAis stored in thej-th column of the arrayABas follows:- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- if
LDABβLDABisINTEGER. the leading dimension of the arrayAB.LDAB >= KD+1.XβXisCOMPLEXarray, dimension(N). on entry, the right hand sidebof the triangular system. on exit,Xis overwritten by the solution vectorx. β¨SCALEβSCALEisREAL. the scaling factorsfor the triangular systemA * x = s*b,A**T * x = s*b, orA**H * x = s*b.
if SCALE = 0, the matrix A is singular or badly scaled, and the vector x is an exact or approximate solution to A*x = 0. π¨
CNORM
CNORM is a REAL array, dimension (N) π«Ά
- if
NORMIN = 'Y', thenCNORMis an input argument, andCNORM(j)holds the norm of the off-diagonal part of the j-th column ofA. IfTRANS = 'N',CNORM(j)has to be greater than or equal to the infinity-norm, and ifTRANS = 'T'or'C',CNORM(j)has to be greater than or equal to the 1-norm. like, no negotiating on this one bestie π - if
NORMIN = 'N', thenCNORMis an output argument, andCNORM(j)returns the 1-norm of the offdiagonal part of the j-th column ofA.
INFO π
INFO is INTEGER
= 0: successful exit β¨< 0: ifINFO = -k, the k-th argument had an illegal value π
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π¦
A rough bound on x is computed; if that is less than overflow, CTBSV is called, otherwise, specific code is used which checks for possible overflow or divide-by-zero at every single operation. she is thorough, okay?? π
A columnwise scheme is used for solving A*x = b. The basic algorithm if A is lower triangular is
x[1:n] := b[1:n]
for j = 1, ..., n
x(j) := x(j) / A(j,j)
x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
end
Define bounds on the components of x after j iterations of the loop:
M(j) = bound on x[1:j]
G(j) = bound on x[j+1:n]
Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}.
Then for iteration j+1 we have
M(j+1) <= G(j) / | A(j+1,j+1) |
G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
<= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
where CNORM(j+1) is greater than or equal to the infinity-norm of column j+1 of A, not counting the diagonal. Hence
G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
1<=i<=j
and
|x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
1<=i< j
Since |x(j)| <= M(j), we use the Level 2 BLAS routine CTBSV if the reciprocal of the largest M(j), j=1,..,n, is larger than max(underflow, 1/overflow). math girlies stay winning π§
The bound on x(j) is also used to determine when a step in the columnwise method can be performed without fear of overflow. If the computed bound is greater than a large constant, x is scaled to prevent overflow, but if the bound overflows, x is set to 0, x(j) to 1, and scale to 0, and a non-trivial solution to A*x = 0 is found. not the singular-matrix jump scare π
Similarly, a row-wise scheme is used to solve A**T *x = b or A**H *x = b. The basic algorithm for A upper triangular is
for j = 1, ..., n
x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j)
end
We simultaneously compute two bounds
G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j
M(j) = bound on x(i), 1<=i<=j
The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we add the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. Then the bound on x(j) is
M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
<= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
1<=i<=j
and we can safely call CTBSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow). π«‘
subroutine clatdf π
subroutine clatdf (integer IJOB, integer N, complex, dimension( ldz, * ) Z,
integer LDZ, complex, dimension( * ) RHS, real RDSUM, real RDSCAL,
integer, dimension( * ) IPIV, integer, dimension( * ) JPIV)
CLATDF uses the LU factorization of the n-by-n matrix computed by sgetc2 and computes a contribution to the reciprocal Dif-estimate. dif-estimate era π
Purpose: β¨
CLATDF computes the contribution to the reciprocal Dif-estimate by solving for x in Z * x = b, where b is chosen such that the norm of x is as large as possible. It is assumed that LU decomposition of Z has been computed by CGETC2. On entry RHS = f holds the contribution from earlier solved sub-systems, and on return RHS = x. π
The factorization of Z returned by CGETC2 has the form Z = P * L * U * Q, where P and Q are permutation matrices. L is lower triangular with unit diagonal elements and U is upper triangular.
Parameters π
IJOB
IJOB is INTEGER
IJOB = 2: First compute an approximative null-vectoreofZusingCGECON,eis normalized and solve forZx = +-e - fwith the sign giving the greater value of 2-norm(x). About 5 times as expensive as Default. πΈIJOB .ne. 2: Local look ahead strategy where all entries of the r.h.s.bis chosen as either+1or-1. Default.
N
N is INTEGER
The number of columns of the matrix Z.
Z
Z is COMPLEX array, dimension (LDZ, N)
On entry, the LU part of the factorization of the n-by-n matrix Z computed by CGETC2: Z = P * L * U * Q
LDZ
LDZ is INTEGER
The leading dimension of the array Z. LDA >= max(1, N).
RHS
RHS is COMPLEX array, dimension (N).
On entry, RHS contains contributions from other subsystems. On exit, RHS contains the solution of the subsystem with entries according to the value of IJOB (see above). π
RDSUM
RDSUM is REAL
On entry, the sum of squares of computed contributions to the Dif-estimate under computation by CTGSYL, where the scaling factor RDSCAL (see below) has been factored out. On exit, the corresponding sum of squares updated with the contributions from the current sub-system. If TRANS = 'T' RDSUM is not touched.
NOTE:RDSUMonly makes sense whenCTGSY2is called byCTGSYL.
RDSCAL
RDSCAL is REAL
On entry, scaling factor used to prevent overflow in RDSUM. On exit, RDSCAL is updated w.r.t. the current contributions in RDSUM. If TRANS = 'T', RDSCAL is not touched.
NOTE:RDSCALonly makes sense whenCTGSY2is called byCTGSYL.
IPIV
IPIV is INTEGER array, dimension (N).
The pivot indices; for 1 <= i <= N, row i of the matrix has been interchanged with row IPIV(i).
JPIV
JPIV is INTEGER array, dimension (N).
The pivot indices; for 1 <= j <= N, column j of the matrix has been interchanged with column JPIV(j).
Author π¦
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π
This routine is a further developed implementation of algorithm BSOLVE in [1] using complete pivoting in the LU factorization.
Contributors: πΈ
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
References: β
[1] Bo Kagstrom and Lars 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.
[2] Peter Poromaa, On Efficient and Robust Estimators for the Separation between two Regular Matrix Pairs with Applications in Condition Estimation. Report UMINF-95.05, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1995.
subroutine clatps π
subroutine clatps (character UPLO, character TRANS, character DIAG,
character NORMIN, integer N, complex, dimension( * ) AP, complex,
dimension( * ) X, real SCALE, real, dimension( * ) CNORM, integer INFO)
CLATPS solves a triangular system of equations with the matrix held in packed storage. packed storage girlies rise π
Purpose: β¨
CLATPS solves one of the triangular systems
A * x = s*b, A**T * x = s*b, or A**H * x = s*b,
with scaling to prevent overflow, where A is an upper or lower triangular matrix stored in packed form. Here A**T denotes the transpose of A, A**H denotes the conjugate transpose of A, x and b are n-element vectors, and s is a scaling factor, usually less than or equal to 1, chosen so that the components of x will be less than the overflow threshold. If the unscaled problem will not cause overflow, the Level 2 BLAS routine CTPSV is called. If the matrix A is singular (A(j,j) = 0 for some j), then s is set to 0 and a non-trivial solution to A*x = 0 is returned. she said "no overflow on my watch" π
Parameters π
UPLO
UPLO is CHARACTER*1
Specifies whether the matrix A is upper or lower triangular.
= 'U': Upper triangular= 'L': Lower triangular
TRANS
TRANS is CHARACTER*1
Specifies the operation applied to A.
= 'N': SolveA * x = s*b(No transpose)= 'T': SolveA**T * x = s*b(Transpose)= 'C': SolveA**H * x = s*b(Conjugate transpose)
DIAG
DIAG is CHARACTER*1
Specifies whether or not the matrix A is unit triangular.
= 'N': Non-unit triangular= 'U': Unit triangular
NORMIN
NORMIN is CHARACTER*1
Specifies whether CNORM has been set or not.
= 'Y':CNORMcontains the column norms on entry= 'N':CNORMis not set on entry. On exit, the norms will be computed and stored inCNORM.
N
N is INTEGER
The order of the matrix A. N >= 0.
AP
AP is COMPLEX array, dimension (N*(N+1)/2)
The upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:
- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
X
X is COMPLEX array, dimension (N)
On entry, the right hand side b of the triangular system. On exit, X is overwritten by the solution vector x. π
SCALE
SCALEβREAL, and it is literally the scaling factorsfor the triangular system
A * x = s*b, A**T * x = s*b, or A**H * x = s*b.
If SCALE = 0, the matrix A is singular or badly scaled, and the vector x is an exact or approximate solution to A*x = 0. π so if that zero shows up, bestie, it's not a bug, it's a vibe: you're holding a non-trivial answer.
CNORMβREALarray, dimension(N)
If NORMIN = 'Y', then CNORM is an input argument and CNORM(j) contains the norm of the off-diagonal part of the j-th column of A. Two flavors, okay?
- If
TRANS = 'N',CNORM(j)must be greater than or equal to the infinity-norm β¨ - If
TRANS = 'T'or'C',CNORM(j)must be greater than or equal to the 1-norm β¨
If NORMIN = 'N', then CNORM is an output argument, and CNORM(j) returns the 1-norm of the offdiagonal part of the j-th column of A. π
INFOβINTEGER= 0: successful exit π slay< 0: ifINFO = -k, the k-th argument had an illegal value π somebody passed something cursed
Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π
Okay so here's the tea: a rough bound on x gets computed. If that bound is less than overflow, CTPSV is called. Otherwise? Specific code is used that checks for possible overflow or divide-by-zero at every single operation. No cap. π«Ά
A columnwise scheme is used for solving A*x = b. The basic algorithm, if A is lower triangular, is
x[1:n] := b[1:n]
for j = 1, ..., n
x(j) := x(j) / A(j,j)
x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
end
Define bounds on the components of x after j iterations of the loop:
M(j) = bound on x[1:j]
G(j) = bound on x[j+1:n]
Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}. β
Then for iteration j+1 we have
M(j+1) <= G(j) / | A(j+1,j+1) |
G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
<= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
where CNORM(j+1) is greater than or equal to the infinity-norm of column j+1 of A, not counting the diagonal. Hence
G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
1<=i<=j
and
|x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
1<=i< j
Since |x(j)| <= M(j), we use the Level 2 BLAS routine CTPSV if the reciprocal of the largest M(j), j=1,..,n, is larger than max(underflow, 1/overflow). π₯
The bound on x(j) is also used to determine when a step in the columnwise method can be performed without fear of overflow. If the computed bound is greater than a large constant, x is scaled to prevent overflow β but if the bound overflows, then x is set to 0, x(j) to 1, and scale to 0, and a non-trivial solution to A*x = 0 is found. π plot twist.
Similarly, a row-wise scheme is used to solve A**T *x = b or A**H *x = b. The basic algorithm for A upper triangular is
for j = 1, ..., n
x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j)
end
We simultaneously compute two bounds
G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j
M(j) = bound on x(i), 1<=i<=j
The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we add the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. Then the bound on x(j) is
M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
<= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
1<=i<=j
and we can safely call CTPSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow). β¨
subroutine clatrd
subroutine clatrd (character UPLO, integer N, integer NB, complex,
dimension( lda, * ) A, integer LDA, real, dimension( * ) E, complex,
dimension( * ) TAU, complex, dimension( ldw, * ) W, integer LDW)
CLATRD reduces the first nb rows and columns of a symmetric/Hermitian matrix A to real tridiagonal form by an unitary similarity transformation. π¦
Purpose π
CLATRD reduces NB rows and columns of a complex Hermitian matrix A to Hermitian tridiagonal form by a unitary similarity transformation Q**H * A * Q, and returns the matrices V and W which are needed to apply the transformation to the unreduced part of A. π
If UPLO = 'U', CLATRD reduces the last NB rows and columns of a matrix, of which the upper triangle is supplied. If UPLO = 'L', CLATRD reduces the first NB rows and columns of a matrix, of which the lower triangle is supplied. π
This is an auxiliary routine called by CHETRD. iykyk π
Parameters β¨
UPLOβCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. The order of the matrixA.NBβINTEGER. The number of rows and columns to be reduced.AβCOMPLEXarray, dimension(LDA,N). On entry, the Hermitian matrixA. IfUPLO = 'U', the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. π
On exit:
- if
UPLO = 'U', the lastNBcolumns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements ofA; the elements above the diagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors; - if
UPLO = 'L', the firstNBcolumns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements ofA; the elements below the diagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors.
See Further Details. π
LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EβREALarray, dimension(N-1). IfUPLO = 'U',E(n-nb:n-1)contains the superdiagonal elements of the lastNBcolumns of the reduced matrix; ifUPLO = 'L',E(1:nb)contains the subdiagonal elements of the firstNBcolumns of the reduced matrix. πΈTAUβCOMPLEXarray, dimension(N-1). The scalar factors of the elementary reflectors, stored inTAU(n-nb:n-1)ifUPLO = 'U', and inTAU(1:nb)ifUPLO = 'L'. See Further Details. πWβCOMPLEXarray, dimension(LDW,NB). The n-by-nbmatrixWrequired to update the unreduced part ofA.LDWβINTEGER. The leading dimension of the arrayW.LDW >= max(1,N).
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) H(n-1) . . . H(n-nb+1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i:n) = 0 and v(i-1) = 1; v(1:i-1) is stored on exit in A(1:i-1,i), and tau in TAU(i-1). β
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(nb).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+1:n) is stored on exit in A(i+1:n,i), and tau in TAU(i). β¨
The elements of the vectors v together form the n-by-nb matrix V which is needed, with W, to apply the transformation to the unreduced part of the matrix, using a Hermitian rank-2k update of the form: A := A - V*W**H - W*V**H. π₯
The contents of A on exit are illustrated by the following examples with n = 5 and nb = 2:
if UPLO = 'U': if UPLO = 'L':
( a a a v4 v5 ) ( d )
( a a v4 v5 ) ( 1 d )
( a 1 v5 ) ( v1 1 a )
( d 1 ) ( v1 v2 a a )
( d ) ( v1 v2 a a a )
where d denotes a diagonal element of the reduced matrix, a denotes an element of the original matrix that is unchanged, and vi denotes an element of the vector defining H(i). π
subroutine clatrs
subroutine clatrs (character UPLO, character TRANS, character DIAG,
character NORMIN, integer N, complex, dimension( lda, * ) A, integer
LDA, complex, dimension( * ) X, real SCALE, real, dimension( * ) CNORM,
integer INFO)
CLATRS solves a triangular system of equations with the scale factor set to prevent overflow. π¦
Purpose π
CLATRS solves one of the triangular systems
A * x = s*b, A**T * x = s*b, or A**H * x = s*b,
with scaling to prevent overflow. Here A is an upper or lower triangular matrix, A**T denotes the transpose of A, A**H denotes the conjugate transpose of A, x and b are n-element vectors, and s is a scaling factor, usually less than or equal to 1, chosen so that the components of x will be less than the overflow threshold. If the unscaled problem will not cause overflow, the Level 2 BLAS routine CTRSV is called. If the matrix A is singular (A(j,j) = 0 for some j), then s is set to 0 and a non-trivial solution to A*x = 0 is returned. πβ¨
Parameters π
UPLOβCHARACTER*1. Specifies whether the matrixAis upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
TRANSβ π hold that thought bestie, this one's spilling into the next partβ¦TRANSβCHARACTER*1. Specifies the operation applied to A. bestie, pick your fighter β¨'N': SolveA * x = s*b(No transpose)'T': SolveA**T * x = s*b(Transpose)'C': SolveA**H * x = s*b(Conjugate transpose)
DIAGβCHARACTER*1. Specifies whether or not the matrix A is unit triangular. the tea is: is the diagonal just vibes or actual numbers?'N': Non-unit triangular'U': Unit triangular
NORMINβCHARACTER*1. Specifies whetherCNORMhas been set or not. did you bring the norms or are we computing them?'Y':CNORMcontains the column norms on entry'N':CNORMis not set on entry. On exit, the norms will be computed and stored inCNORM.
NβINTEGER. The order of the matrix A.N >= 0. no negative energy allowed πAβCOMPLEX array, dimension (LDA,N). The triangular matrix A. IfUPLO = 'U', the leading n by n upper triangular part of the array A contains the upper triangular matrix, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading n by n lower triangular part of the array A contains the lower triangular matrix, and the strictly upper triangular part of A is not referenced. IfDIAG = 'U', the diagonal elements of A are also not referenced and are assumed to be 1. so iconic of her to skip the diagonal πLDAβINTEGER. The leading dimension of the array A.LDA >= max (1,N). respect the leading dimension or else πXβCOMPLEX array, dimension (N). On entry, the right hand side b of the triangular system. On exit, X is overwritten by the solution vector x. glow up: from b to x π¦SCALEβREAL. The scaling factor s for the triangular system
A * x = s*b, A**T * x = s*b, or A**H * x = s*b.
If SCALE = 0, the matrix A is singular or badly scaled, and the vector x is an exact or approximate solution to A*x = 0. if this is zero, we have a problem bestie π
CNORMβREAL array, dimension (N). IfNORMIN = 'Y',CNORMis an input argument andCNORM(j)contains the norm of the off-diagonal part of the j-th column of A. IfTRANS = 'N',CNORM(j)must be greater than or equal to the infinity-norm, and ifTRANS = 'T'or'C',CNORM(j)must be greater than or equal to the 1-norm. IfNORMIN = 'N',CNORMis an output argument andCNORM(j)returns the 1-norm of the offdiagonal part of the j-th column of A. norms on norms on norms πINFOβINTEGER.= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π₯
A rough bound on x is computed; if that is less than overflow, CTRSV is called, otherwise, specific code is used which checks for possible overflow or divide-by-zero at every operation.
A columnwise scheme is used for solving A*x = b. The basic algorithm if A is lower triangular is
x[1:n] := b[1:n]
for j = 1, ..., n
x(j) := x(j) / A(j,j)
x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
end
Define bounds on the components of x after j iterations of the loop:
M(j) = bound on x[1:j]
G(j) = bound on x[j+1:n]
Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}.
Then for iteration j+1 we have
M(j+1) <= G(j) / | A(j+1,j+1) |
G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
<= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
where CNORM(j+1) is greater than or equal to the infinity-norm of column j+1 of A, not counting the diagonal. Hence
G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
1<=i<=j
and
|x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
1<=i< j
Since |x(j)| <= M(j), we use the Level 2 BLAS routine CTRSV if the reciprocal of the largest M(j), j=1,..,n, is larger than max(underflow, 1/overflow).
The bound on x(j) is also used to determine when a step in the columnwise method can be performed without fear of overflow. If the computed bound is greater than a large constant, x is scaled to prevent overflow, but if the bound overflows, x is set to 0, x(j) to 1, and scale to 0, and a non-trivial solution to A*x = 0 is found.
Similarly, a row-wise scheme is used to solve A**T *x = b or A**H *x = b. The basic algorithm for A upper triangular is
for j = 1, ..., n
x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j)
end
We simultaneously compute two bounds
G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j
M(j) = bound on x(i), 1<=i<=j
The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we add the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. Then the bound on x(j) is
M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
<= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
1<=i<=j
and we can safely call CTRSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow).
subroutine clauu2 (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, integer INFO)
CLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblocked algorithm). slay, unblocked era π
Purpose
CLAUU2 computes the product U * U**H or L**H * L, where the triangular factor U or L is stored in the upper or lower triangular part of the array A.
If UPLO = 'U' or 'u' then the upper triangle of the result is stored, overwriting the factor U in A. If UPLO = 'L' or 'l' then the lower triangle of the result is stored, overwriting the factor L in A.
This is the unblocked form of the algorithm, calling Level 2 BLAS. level 2 BLAS? we love a reliable bestie β¨
Parameters
UPLOβCHARACTER*1. Specifies whether the triangular factor stored in the array A is upper or lower triangular:'U': Upper triangular'L': Lower triangular
NβINTEGER. The order of the triangular factor U or L.N >= 0. no negative order, periodtAβCOMPLEX array, dimension (LDA,N). On entry, the triangular factor U or L. On exit, ifUPLO = 'U', the upper triangle of A is overwritten with the upper triangle of the productU * U**H; ifUPLO = 'L', the lower triangle of A is overwritten with the lower triangle of the productL**H * L. she's changing in public, and that's fine π¦LDAβINTEGER. The leading dimension of the array A.LDA >= max(1,N). mind the gap (the leading dimension) πINFOβINTEGER.= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine clauum (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, integer INFO)
CLAUUM computes the product UUH or LHL, where U and L are upper or lower triangular matrices (blocked algorithm). blocked algorithm? highkey iconic π
Purpose
CLAUUM computes the product U * U**H or L**H * L, where the triangular factor U or L is stored in the upper or lower triangular part of the array A.
If UPLO = 'U' or 'u' then the upper triangle of the result is stored, overwriting the factor U in A. If UPLO = 'L' or 'l' then the lower triangle of the result is stored, overwriting the factor L in A.
This is the blocked form of the algorithm, calling Level 3 BLAS. level 3 BLAS, the main character energy we deserve π₯
Parameters
UPLOβCHARACTER*1. Specifies whether the triangular factor stored in the array A is upper or lower triangular:'U': Upper triangular'L': Lower triangular
NβINTEGER. The order of the triangular factor U or L.N >= 0. same energy as before, still no negativesAβCOMPLEX array, dimension (LDA,N). On entry, the triangular factor U or L. On exit, ifUPLO = 'U', the upper triangle of A is overwritten with the upper triangle of the productU * U**H; ifUPLO = 'L', the lower triangle of A is overwritten with the lower triangle of the productL**H * L. overwriting? she's transforming, not copying π¦LDAβINTEGER. The leading dimension of the array A.LDA >= max(1,N). leading dimension stays winning πINFOβINTEGER.= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine crot (integer N, complex, dimension( * ) CX, integer INCX, complex, dimension( * ) CY, integer INCY, real C, complex S)
CROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors. rotation? bestie, we're spinning π«
Purpose
CROT applies a plane rotation, where the cos (C) is real and the sin (S) is complex, and the vectors CX and CY are complex. real cos, complex sin, a duo for the ages β¨
Parameters
NβINTEGER. The number of elements in the vectors CX and CY. count 'emCXβCOMPLEX array, dimension (N). On input, the vector X. On output, CX is overwritten withC*X + S*Y. glow up: X becomes C*X + S*Y π¦INCXβINTEGER. The increment between successive values of CX.INCX <> 0. zero increment? not on my watch πCYβCOMPLEX array, dimension (N). On input, the vector Y. On output, CY is overwritten with-CONJG(S)*X + C*Y. conjugate? we love a little twist πINCYβINTEGER. The increment between successive values of CY.INCX <> 0. yes, it says INCX here, we're keeping it exactly πCβREAL. the real oneSβ
S is COMPLEX
C and S define a rotation
[ C S ]
[ -conjg(S) C ]
where C*C + S*CONJG(S) = 1.0.
so yeah β S is COMPLEX, and C plus S together define a rotation, and they gotta satisfy C*C + S*CONJG(S) = 1.0. that's the vibe, no notes π
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine cspmv (character UPLO, integer N, complex ALPHA, complex,
dimension( * ) AP, complex, dimension( * ) X, integer INCX, complex
BETA, complex, dimension( * ) Y, integer INCY)
CSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix. okay so this one's a little workhorse π΄
π― Purpose:
CSPMV performs the matrix-vector operation
y := alpha*A*x + beta*y,
where alpha and beta are scalars, x and y are n element vectors and A is an n by n symmetric matrix, supplied in packed form. iconic behavior honestly πΈ
π Parameters
UPLOβUPLOisCHARACTER*1. On entry,UPLOspecifies whether the upper or lower triangular part of the matrixAis supplied in the packed arrayAPas follows:UPLO = 'U'or'u'β the upper triangular part ofAis supplied inAP.UPLO = 'L'or'l'β the lower triangular part ofAis supplied inAP.
Unchanged on exit. π«Ά
NβNisINTEGER. On entry,Nspecifies the order of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβALPHAisCOMPLEX. On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.APβAPisCOMPLEXarray, dimension at least( ( N*( N + 1 ) )/2 ). Before entry, withUPLO = 'U'or'u', the arrayAPmust contain the upper triangular part of the symmetric matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 1, 2 )anda( 2, 2 )respectively, and so on. Before entry, withUPLO = 'L'or'l', the arrayAPmust contain the lower triangular part of the symmetric matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 2, 1 )anda( 3, 1 )respectively, and so on. Unchanged on exit. πXβXisCOMPLEXarray, dimension at least( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain theN-element vectorx. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβBETAisCOMPLEX. On entry,BETAspecifies the scalarbeta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YβYisCOMPLEXarray, dimension at least( 1 + ( N - 1 )*abs( INCY ) ). Before entry, the incremented arrayYmust contain thenelement vectory. On exit,Yis overwritten by the updated vectory. πINCYβINCYisINTEGER. On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit.
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine cspr (character UPLO, integer N, complex ALPHA, complex,
dimension( * ) X, integer INCX, complex, dimension( * ) AP)
CSPR performs the symmetrical rank-1 update of a complex symmetric packed matrix. she's giving β¨glow-upβ¨ energy, fr fr
π― Purpose:
CSPR performs the symmetric rank 1 operation
A := alpha*x*x**H + A,
where alpha is a complex scalar, x is an n element vector and A is an n by n symmetric matrix, supplied in packed form. π
π Parameters
UPLOβUPLOisCHARACTER*1. On entry,UPLOspecifies whether the upper or lower triangular part of the matrixAis supplied in the packed arrayAPas follows:UPLO = 'U'or'u'β the upper triangular part ofAis supplied inAP.UPLO = 'L'or'l'β the lower triangular part ofAis supplied inAP.
Unchanged on exit.
NβNisINTEGER. On entry,Nspecifies the order of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβALPHAisCOMPLEX. On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.XβXisCOMPLEXarray, dimension at least( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain theN-element vectorx. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.APβAPisCOMPLEXarray, dimension at least( ( N*( N + 1 ) )/2 ). Before entry, withUPLO = 'U'or'u', the arrayAPmust contain the upper triangular part of the symmetric matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 1, 2 )anda( 2, 2 )respectively, and so on. On exit, the arrayAPis overwritten by the upper triangular part of the updated matrix. Before entry, withUPLO = 'L'or'l', the arrayAPmust contain the lower triangular part of the symmetric matrix packed sequentially, column by column, so thatAP( 1 )containsa( 1, 1 ),AP( 2 )andAP( 3 )containa( 2, 1 )anda( 3, 1 )respectively, and so on. On exit, the arrayAPis overwritten by the lower triangular part of the updated matrix.
β οΈ bestie listen: note that the imaginary parts of the diagonal elements need not be set, they are assumed to be zero, and on exit they are set to zero. π don't come for me, that's just how it is
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine csrscl (integer N, real SA, complex, dimension( * ) SX, integer
INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar. tiny function, huge heart π
π― Purpose:
CSRSCL multiplies an n-element complex vector x by the real scalar 1/a. This is done without overflow or underflow as long as the final result x/a does not overflow or underflow. so like, she's careful. she's mindful. we love her π
π Parameters
NβNisINTEGER. The number of components of the vectorx.SAβSAisREAL. The scalarawhich is used to divide each component ofx.
π¨SAmust be>= 0, or the subroutine will divide by zero. that's not a vibe check you wanna fail π
SXβSXisCOMPLEXarray, dimension(1+(N-1)*abs(INCX)). Then-element vectorx.INCXβINCXisINTEGER. The increment between successive values of the vectorSX.> 0:SX(1) = X(1)andSX(1+(i-1)*INCX) = x(i),1< i<= n
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine ctprfb (character SIDE, character TRANS, character DIRECT,
character STOREV, integer M, integer N, integer K, integer L, complex,
dimension( ldv, * ) V, integer LDV, complex, dimension( ldt, * ) T,
integer LDT, complex, dimension( lda, * ) A, integer LDA, complex,
dimension( ldb, * ) B, integer LDB, complex, dimension( ldwork, * )
WORK, integer LDWORK)
CTPRFB applies a complex 'triangular-pentagonal' block reflector to a complex matrix, which is composed of two blocks. she's the main character of block reflectors, no cap π
π― Purpose:
CTPRFB applies a complex 'triangular-pentagonal' block reflector H or its conjugate transpose H**H to a complex matrix C, which is composed of two blocks A and B, either from the left or right. π¦
π Parameters
SIDEβSIDEisCHARACTER*1.= 'L': applyHorH**Hfrom the Left= 'R': applyHorH**Hfrom the Right
TRANSβTRANSisCHARACTER*1.= 'N': applyH(No transpose)= 'C': applyH**H(Conjugate transpose)
DIRECTβDIRECTisCHARACTER*1. Indicates howHis formed from a product of elementary reflectors.= 'F':H = H(1) H(2) . . . H(k)(Forward)= 'B':H = H(k) . . . H(2) H(1)(Backward)
STOREVβSTOREVisCHARACTER*1. Indicates how the vectors which define the elementary reflectors are stored:= 'C': Columns= 'R': Rows
MβMisINTEGER. The number of rows of the matrixB.M >= 0.NβNisINTEGER. The number of columns of the matrixB.N >= 0.KβKisINTEGER. The order of the matrixT, i.e. the number of elementary reflectors whose product defines the block reflector.K >= 0.LβLisINTEGER. The order of the trapezoidal part ofV.K >= L >= 0. See Further Details. πVβVisCOMPLEXarray, dimension(LDV,K)ifSTOREV = 'C'(LDV,M)ifSTOREV = 'R'andSIDE = 'L'(LDV,N)ifSTOREV = 'R'andSIDE = 'R'
The pentagonal matrix V, which contains the elementary reflectors H(1), H(2), ..., H(K). See Further Details. πΈ
LDVTβ aCOMPLEXarray, dimension(LDT,K). It's the triangular K-by-K matrixTchillin' inside the block-reflector representation. That's the whole vibe of it.LDTβINTEGER, bestie. The leading dimension ofT. You needLDT >= K, no exceptions, periodt.Aβ aCOMPLEXarray, dimension(LDA,N)ifSIDE = 'L'or(LDA,K)ifSIDE = 'R'. On entry it's the K-by-N or M-by-K matrixA. On exit,Agets overwritten by the corresponding block ofH*CorH**H*CorC*HorC*H**H. See Further Details, babes.LDAβINTEGER. Leading dimension ofA. IfSIDE = 'L', thenLDA >= max(1,K); ifSIDE = 'R', thenLDA >= max(1,M). Simple as.Bβ aCOMPLEXarray, dimension(LDB,N). On entry, the M-by-N matrixB. On exit,Bis overwritten by the corresponding block ofH*CorH**H*CorC*HorC*H**H. Same deal, see Further Details πLDBβINTEGER. Leading dimension ofB.LDB >= max(1,M).WORKβ aCOMPLEXarray, dimension(LDWORK,N)ifSIDE = 'L', and(LDWORK,K)ifSIDE = 'R'. She's the workspace, she's doing her best.LDWORKβINTEGER. Leading dimension ofWORK. IfSIDE = 'L',LDWORK >= K; ifSIDE = 'R',LDWORK >= M.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Iconic lineup ngl π
π Further Details:
Okay so this is the part where they explain what C even is, and it's actually kind of gorgeous once you see it:
The matrix C is a composite matrix formed from blocks A and B.
The block B is of size M-by-N; if SIDE = 'R', A is of size M-by-K,
and if SIDE = 'L', A is of size K-by-N.
If SIDE = 'R' and DIRECT = 'F', C = [A B].
If SIDE = 'L' and DIRECT = 'F', C = [A]
[B].
If SIDE = 'R' and DIRECT = 'B', C = [B A].
If SIDE = 'L' and DIRECT = 'B', C = [B]
[A].
The pentagonal matrix V is composed of a rectangular block V1 and a
trapezoidal block V2. The size of the trapezoidal block is determined by
the parameter L, where 0<=L<=K. If L=K, the V2 block of V is triangular;
if L=0, there is no trapezoidal block, thus V = V1 is rectangular.
If DIRECT = 'F' and STOREV = 'C': V = [V1]
[V2]
- V2 is upper trapezoidal (first L rows of K-by-K upper triangular)
If DIRECT = 'F' and STOREV = 'R': V = [V1 V2]
- V2 is lower trapezoidal (first L columns of K-by-K lower triangular)
If DIRECT = 'B' and STOREV = 'C': V = [V2]
[V1]
- V2 is lower trapezoidal (last L rows of K-by-K lower triangular)
If DIRECT = 'B' and STOREV = 'R': V = [V2 V1]
- V2 is upper trapezoidal (last L columns of K-by-K upper triangular)
If STOREV = 'C' and SIDE = 'L', V is M-by-K with V2 L-by-K.
If STOREV = 'C' and SIDE = 'R', V is N-by-K with V2 L-by-K.
If STOREV = 'R' and SIDE = 'L', V is K-by-M with V2 K-by-L.
If STOREV = 'R' and SIDE = 'R', V is K-by-N with V2 K-by-L.
Like?? The blocks just assemble. It's giving LEGO but make it linear algebra π§
β¨ integer function icmax1 (integer N, complex, dimension(*) CX, integer INCX)
ICMAX1 finds the index of the first vector element of maximum absolute value. She's a finder, she's a looker, she's not playing games.
π― Purpose:
ICMAX1 finds the index of the first vector element of maximum absolute value.
Based on ICAMAX from Level 1 BLAS.
The change is to use the 'genuine' absolute value.
Note the glow-up: it's based on ICAMAX from Level 1 BLAS, but the twist is it uses the 'genuine' absolute value. Different flavour, better result π
π Parameters
NβINTEGER. How many elements are in the vectorCX.CXβ aCOMPLEXarray, dimension(N). This is the vectorCX. TheICMAX1function returns the index of its first element of maximum absolute value.INCXβINTEGER. The spacing between successive values ofCX.INCX >= 1. Bestie said no zero strides today.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
Nick Higham for use with CLACON.
β¨ integer function ilaclc (integer M, integer N, complex, dimension( lda, * ) A, integer LDA)
ILACLC scans a matrix for its last non-zero column. She's the one who checks the back of the fridge and tells you what's still there.
π― Purpose:
ILACLC scans A for its last non-zero column.
π Parameters
MβINTEGER. The number of rows of the matrixA.NβINTEGER. The number of columns of the matrixA.Aβ aCOMPLEXarray, dimension(LDA,N). The m by n matrixA. That's it, that's the girl.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ integer function ilaclr (integer M, integer N, complex, dimension( lda, * ) A, integer LDA)
ILACLR scans a matrix for its last non-zero row. Same energy, other axis. The way that she just... goes down the rows and finds the last one with something in it π¦
π― Purpose:
ILACLR scans A for its last non-zero row.
π Parameters
MβINTEGER. The number of rows of the matrixA.NβINTEGER. The number of columns of the matrixA.Aβ aCOMPLEXarray, dimension(LDA,N). The m by n matrixA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ integer function izmax1 (integer N, complex*16, dimension(*) ZX, integer INCX)
IZMAX1 finds the index of the first vector element of maximum absolute value. Yes it's basically ICMAX1 but the double-precision twin β sisters, not twins, but honestly twins.
π― Purpose:
IZMAX1 finds the index of the first vector element of maximum absolute value.
Based on IZAMAX from Level 1 BLAS.
The change is to use the 'genuine' absolute value.
Again with the glow-up: based on IZAMAX from Level 1 BLAS, and the change is that it uses the 'genuine' absolute value. Consistency is her brand β¨
π Parameters
NβINTEGER. The number of elements in the vectorZX.ZXβ aCOMPLEX*16array, dimension(N). The vectorZX. TheIZMAX1function returns the index of its first element of maximum absolute value.INCXβINTEGER. The spacing between successive values ofZX.INCX >= 1.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
Nick Higham for use with ZLACON.
β¨ real function scsum1 (integer N, complex, dimension( * ) CX, integer INCX)
SCSUM1 forms the 1-norm of the complex vector using the true absolute value. She's out here summing, she's out here norming, she's thriving.
π― Purpose:
SCSUM1 takes the sum of the absolute values of a complex
vector and returns a single precision result.
Based on SCASUM from the Level 1 BLAS.
The change is to use the 'genuine' absolute value.
Based on SCASUM from the Level 1 BLAS, and yeah, the change is the 'genuine' absolute value. We love a consistent queen π
π Parameters
NβINTEGER. The number of elements in the vectorCX.CXβ aCOMPLEXarray, dimension(N). The vector whose elements will be summed.INCXβINTEGER. The spacing between successive values ofCX.INCX > 0. Strictly greater than zero this time, not>= 1β read it carefully bestie.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
Nick Higham for use with CLACON.
π Author
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, babes π This one's LAPACK, version 3.11.0, dated Sun Nov 27 2022, and the man page is complexOTHERauxiliary(3) β you made it to the end of all 25 parts, which is genuinely main character energy π Go drink some water, mwah π«Άπ
π¦ 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