complex16OTHERauxiliary(3)
β¨ complex16OTHERauxiliary(3) β¨
LAPACK Β· complex16 Β· part 1 of 26, bestie, we're going on a JOURNEY π¦
π NAME π
complex16OTHERauxiliary β it's giving complex16 π
okay so. hi. welcome to the group chat that is the LAPACK manual π
This page is called complex16OTHERauxiliary, and the one thing it's telling us up top is that it belongs to the complex16 family. That's it. That's the whole NAME section. Short, sweet, main character energy, no notes π«Ά
But here's the thing β this page is 26 parts long, so do not scroll away, because we are literally just getting started. The NAME is the lil intro slide before the actual lore drops. Think of it as the "hi besties" before the 47-minute video essay. π
Stay with me. More is coming. πΈ
β¨ SYNOPSIS β¨
π§βοΈ Functions π§βοΈ
okay bestie, here's the whole squad of routines. signatures are exact, no cap. descriptions are rewritten with love, but every fact stays. π
subroutine clag2z (M, N, SA, LDSA, A, LDA, INFO)β CLAG2Z converts a complex single precision matrix to a complex double precision matrix. glow-up from single to double, periodt β¨double precision function dzsum1 (N, CX, INCX)β DZSUM1 forms the 1-norm of the complex vector using the true absolute value. no fake math here πinteger function ilazlc (M, N, A, LDA)β ILAZLC scans a matrix for its last non-zero column. detective energy πinteger function ilazlr (M, N, A, LDA)β ILAZLR scans a matrix for its last non-zero row. row hunt, but make it Fortran πΆsubroutine zdrscl (N, SA, SX, INCX)β ZDRSCL multiplies a vector by the reciprocal of a real scalar. reciprocal realness πsubroutine zlabrd (M, N, NB, A, LDA, D, E, TAUQ, TAUP, X, LDX, Y, LDY)β ZLABRD reduces the first nb rows and columns of a general matrix to a bidiagonal form. bidiagonal? more like bi-iconic β¨subroutine zlacgv (N, X, INCX)β ZLACGV conjugates a complex vector. flip the imaginary vibe π«subroutine zlacn2 (N, V, X, EST, KASE, ISAVE)β ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. reverse communication? main character energy πsubroutine zlacon (N, V, X, EST, KASE)β ZLACON estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. same vibe, different signature πsubroutine zlacp2 (UPLO, M, N, A, LDA, B, LDB)β ZLACP2 copies all or part of a real two-dimensional array to a complex array. real-to-complex pipeline πsubroutine zlacpy (UPLO, M, N, A, LDA, B, LDB)β ZLACPY copies all or part of one two-dimensional array to another. copy-paste but make it Fortran β¨subroutine zlacrm (M, N, A, LDA, B, LDB, C, LDC, RWORK)β ZLACRM multiplies a complex matrix by a square real matrix. math but make it complex πsubroutine zlacrt (N, CX, INCX, CY, INCY, C, S)β ZLACRT performs a linear transformation of a pair of complex vectors. transformation station πcomplex *16 function zladiv (X, Y)β ZLADIV performs complex division in real arithmetic, avoiding unnecessary overflow. safe division, bestie π‘οΈsubroutine zlaein (RIGHTV, NOINIT, N, H, LDH, W, V, B, LDB, RWORK, EPS3, SMLNUM, INFO)β ZLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iteration. eigenvector era π₯subroutine zlaev2 (A, B, C, RT1, RT2, CS1, SN1)β ZLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. tiny matrix, big energy β¨subroutine zlag2c (M, N, A, LDA, SA, LDSA, INFO)β ZLAG2C converts a complex double precision matrix to a complex single precision matrix. precision shift, bestie πsubroutine zlags2 (UPPER, A1, A2, A3, B1, B2, B3, CSU, SNU, CSV, SNV, CSQ, SNQ)β ZLAGS2. original description is literally just "ZLAGS2", and honestly? iconic minimalism. no cap. πsubroutine zlagtm (TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA, B, LDB)β ZLAGTM 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. tridiagonal? more like tri-fabulous πsubroutine zlahqr (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, INFO)β ZLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. QR algorithm? more like QR queen πsubroutine zlahr2 (N, K, NB, A, LDA, TAU, T, LDT, Y, LDY)β ZLAHR2 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. zero them out, bestie πsubroutine zlaic1 (JOB, J, X, SEST, W, GAMMA, SESTPR, S, C)β ZLAIC1 applies one step of incremental condition estimation. one step at a time, queen β¨double precision function zlangt (NORM, N, DL, D, DU)β ZLANGT 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 realness πdouble precision function zlanhb (NORM, UPLO, N, K, AB, LDAB, WORK)β ZLANHB 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. band matrix, but make it Hermitian πdouble precision function zlanhp (NORM, UPLO, N, AP, WORK)β ZLANHP 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 and snatched β¨double precision function zlanhs (NORM, N, A, LDA, WORK)β ZLANHS 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 hive πdouble precision function zlanht (NORM, N, D, E)β ZLANHT 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 πdouble precision function zlansb (NORM, UPLO, N, K, AB, LDAB, WORK)β ZLANSB 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 slay β¨double precision function zlansp (NORM, UPLO, N, AP, WORK)β ZLANSP 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 and perfect πdouble precision function zlantb (NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)β ZLANTB 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 but make it banded πdouble precision function zlantp (NORM, UPLO, DIAG, N, AP, WORK)β ZLANTP 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. packed triangular realness β¨double precision function zlantr (NORM, UPLO, DIAG, M, N, A, LDA, WORK)β ZLANTR 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? more like trap-queen πsubroutine zlapll (N, X, INCX, Y, INCY, SSMIN)β ZLAPLL measures the linear dependence of two vectors. codependency check πsubroutine zlapmr (FORWRD, M, N, X, LDX, K)β ZLAPMR rearranges rows of a matrix as specified by a permutation vector. row shuffle realness β¨subroutine zlapmt (FORWRD, M, N, X, LDX, K)β ZLAPMT performs a forward or backward permutation of the columns of a matrix. column chaos, controlled πsubroutine zlaqhb (UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED)β ZLAQHB scales a Hermitian band matrix, using scaling factors computed bycpbequ. scale it, bestie πsubroutine zlaqhp (UPLO, N, AP, S, SCOND, AMAX, EQUED)β ZLAQHP scales a Hermitian matrix stored in packed form. packed and scaled β¨subroutine zlaqp2 (M, N, OFFSET, A, LDA, JPVT, TAU, VN1, VN2, WORK)β ZLAQP2 computes a QR factorization with column pivoting of the matrix block. QR with a pivot? periodt πsubroutine zlaqps (M, N, OFFSET, NB, KB, A, LDA, JPVT, TAU, VN1, VN2, AUXV, F, LDF)β ZLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BLAS level 3. level 3? highkey iconic πsubroutine zlaqr0 (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO)β ZLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. eigenvalues and optional Schur tea βsubroutine zlaqr1 (N, H, LDH, S1, S2, V)β ZLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts. tiny matrix, big shift energy β¨subroutine zlaqr2 (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)β ZLAQR2 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? we love a go-getter πsubroutine zlaqr3 (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)β ZLAQR3 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). twin behavior πsubroutine zlaqr4 (WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO)β ZLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. same energy, different routine β¨subroutine zlaqr5 (WANTT, WANTZ, KACC22, N, KTOP, KBOT, NSHFTS, S, H, LDH, ILOZ, IHIZ, Z, LDZ, V, LDV, U, LDU, NV, WV, LDWV, NH, WH, LDWH)β ZLAQR5 performs a single small-bulge multi-shift QR sweep. sweep it up πsubroutine zlaqsb (UPLO, N, KD, AB, LDAB, S, SCOND, AMAX, EQUED)β ZLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed byspbequ. scale and slay β¨subroutine zlaqsp (UPLO, N, AP, S, SCOND, AMAX, EQUED)β ZLAQSP scales a symmetric/Hermitian matrix in packed storage, using scaling factors computed bysppequ. packed and scaled, no cap πsubroutine zlar1v (N, B1, BN, LAMBDA, D, L, LD, LLD, PIVMIN, GAPTOL, Z, WANTNC, NEGCNT, ZTZ, MINGMA, R, ISUPPZ, NRMINV, RESID, RQCORR, WORK)β ZLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the tridiagonal matrixLDLT - Ξ»I. inverse submatrix? mathematically unhinged, we love it πsubroutine zlar2v (N, X, Y, Z, INCX, C, S, INCC)β ZLAR2V 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. rotations from both sides? balanced, as all things should be βοΈsubroutine zlarcm (M, N, A, LDA, B, LDB, C, LDC, RWORK)β ZLARCM copies all or part of a real two-dimensional array to a complex array. real-to-complex pipeline πsubroutine zlarf (SIDE, M, N, V, INCV, TAU, C, LDC, WORK)β ZLARF applies an elementary reflector to a general rectangular matrix. reflector realness β¨subroutine zlarfb (SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, T, LDT, C, LDC, WORK, LDWORK)β ZLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix. block reflector, but make it transpose πsubroutine zlarfb_gett (IDENT, M, N, K, T, LDT, A, LDA, B, LDB, WORK, LDWORK)β ZLARFB_GETT. original description is literally just "ZLARFB_GETT", and honestly that's a mood. πsubroutine zlarfg (N, ALPHA, X, INCX, TAU)β ZLARFG generates an elementary reflector (Householder matrix). Householder? more like house-iconic πsubroutine zlarfgp (N, ALPHA, X, INCX, TAU)β ZLARFGP generates an elementary reflector (Householder matrix) with non-negative beta. beta but make it non-negative β¨subroutine zlarft (DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT)β ZLARFT forms the triangular factor T of a block reflectorH = I - vtvH. triangular factor? more like tri-factor πsubroutine zlarfx (SIDE, M, N, V, TAU, C, LDC, WORK)β ZLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the reflector has order β€ 10. loop unrolling? performance queen β¨subroutine zlarfy (UPLO, N, V, INCV, TAU, C, LDC, WORK)β ZLARFY. original description is literally "ZLARFY", and we respect the mystery. π΅οΈβοΈsubroutine zlargv (N, X, INCX, Y, INCY, C, INCC)β ZLARGV generates a vector of plane rotations with real cosines and complex sines. rotation generation station πsubroutine zlarnv (IDIST, ISEED, N, X)β ZLARNV returns a vector of random numbers from a uniform or normal distribution. random but make it math πsubroutine zlarrv (N, VL, VU, D, L, PIVMIN, ISPLIT, M, DOL, DOU, MINRGP,β (description cut off in this part, more coming bestie π)
...and we're so back, bestie π the synopsis was literally mid-sentence, so let's just pick it right back up like nothing happened:
RTOL1, RTOL2, W, WERR, WGAP, IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
WORK, IWORK, INFO)
ZLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues of L D LT. that's her whole job, and she ate π₯
okay and here's the rest of the lineup, one icon after another:
subroutine zlartv (N, X, INCX, Y, INCY, C, S, INCC)βZLARTVapplies a vector of plane rotations with real cosines and complex sines to the elements of a pair of vectors.subroutine zlascl (TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)βZLASCLmultiplies a general rectangular matrix by a real scalar defined ascto/cfrom.subroutine zlaset (UPLO, M, N, ALPHA, BETA, A, LDA)βZLASETinitializes the off-diagonal elements and the diagonal elements of a matrix to given values.subroutine zlasr (SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA)βZLASRapplies a sequence of plane rotations to a general rectangular matrix.subroutine zlaswp (N, A, LDA, K1, K2, IPIV, INCX)βZLASWPperforms a series of row interchanges on a general rectangular matrix.subroutine zlat2c (UPLO, N, A, LDA, SA, LDSA, INFO)βZLAT2Cconverts a double complex triangular matrix to a complex triangular matrix.subroutine zlatbs (UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)βZLATBSsolves a triangular banded system of equations.subroutine zlatdf (IJOB, N, Z, LDZ, RHS, RDSUM, RDSCAL, IPIV, JPIV)βZLATDFuses the LU factorization of the n-by-n matrix computed bysgetc2and computes a contribution to the reciprocal Dif-estimate.subroutine zlatps (UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)βZLATPSsolves a triangular system of equations with the matrix held in packed storage.subroutine zlatrd (UPLO, N, NB, A, LDA, E, TAU, W, LDW)βZLATRDreduces the first nb rows and columns of a symmetric/Hermitian matrix A to real tridiagonal form by an unitary similarity transformation.subroutine zlatrs (UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE, CNORM, INFO)βZLATRSsolves a triangular system of equations with the scale factor set to prevent overflow.subroutine zlauu2 (UPLO, N, A, LDA, INFO)βZLAUU2computes the productUUHorLHL, whereUandLare upper or lower triangular matrices (unblocked algorithm).subroutine zlauum (UPLO, N, A, LDA, INFO)βZLAUUMcomputes the productUUHorLHL, whereUandLare upper or lower triangular matrices (blocked algorithm).subroutine zrot (N, CX, INCX, CY, INCY, C, S)βZROTapplies a plane rotation with real cosine and complex sine to a pair of complex vectors.subroutine zspmv (UPLO, N, ALPHA, AP, X, INCX, BETA, Y, INCY)βZSPMVcomputes a matrix-vector product for complex vectors using a complex symmetric packed matrixsubroutine zspr (UPLO, N, ALPHA, X, INCX, AP)βZSPRperforms the symmetrical rank-1 update of a complex symmetric packed matrix.subroutine ztprfb (SIDE, TRANS, DIRECT, STOREV, M, N, K, L, V, LDV, T, LDT, A, LDA, B, LDB, WORK, LDWORK)βZTPRFBapplies a complex 'triangular-pentagonal' block reflector to a complex matrix, which is composed of two blocks.
π Detailed Description π
This is the group of complex16 other auxiliary routines π«Ά literally the catch-all bestie group for complex16, and we love her for it.
π Function Documentation π
π«§ subroutine clag2z (integer M, integer N, complex, dimension( ldsa, * ) SA, integer LDSA, complex*16, dimension( lda, * ) A, integer LDA, integer INFO)
CLAG2Z converts a complex single precision matrix to a complex double precision matrix. it's giving glow-up but for your precision π
β¨ Purpose
CLAG2Z takes a COMPLEX matrix, SA, and turns it into a COMPLEX*16 matrix, A.
ngl here's a lil detail: it is possible to overflow while converting from double to single, but it is not possible to overflow when converting from single to double. so that direction? safe π«Ά
also this is an auxiliary routine, so there is no argument checking. she's not double-checking your work, she trusts you.
π Parameters
MβMis INTEGER. The number of lines of the matrixA.M >= 0.NβNis INTEGER. The number of columns of the matrixA.N >= 0.SAβSAis COMPLEX array, dimension(LDSA,N). On entry, the M-by-N coefficient matrixSA.LDSAβLDSAis INTEGER. The leading dimension of the arraySA.LDSA >= max(1,M).AβAis COMPLEX*16 array, dimension(LDA,N). On exit, the M-by-N coefficient matrixA.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).INFOβINFOis INTEGER.= 0: successful exit
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ double precision function dzsum1 (integer N, complex*16, dimension( * ) CX, integer INCX)
DZSUM1 forms the 1-norm of the complex vector using the true absolute value. main character energy fr fr β¨
β¨ Purpose
DZSUM1 adds up the absolute values of a complex vector and hands you back a double precision result.
it's based on DZASUM from the Level 1 BLAS β the one change is that it uses the 'genuine' absolute value instead. upgrade behavior π
π Parameters
NβNis INTEGER. The number of elements in the vectorCX.CXβCXis COMPLEX*16 array, dimension(N). The vector whose elements will be summed.INCXβINCXis INTEGER. The spacing between successive values ofCX.INCX > 0.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors:
Nick Higham for use with ZLACON.
π§ integer function ilazlc (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA)
ILAZLC scans a matrix for its last non-zero column. she's the finder bestie π
β¨ Purpose
ILAZLC scans A for its last non-zero column.
π Parameters
MβMis INTEGER. The number of rows of the matrixA.NβNis INTEGER. The number of columns of the matrixA.AβAis COMPLEX*16 array, dimension(LDA,N). The m by n matrixA.LDAβLDAis 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 ilazlr (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA)
ILAZLR scans a matrix for its last non-zero row. same vibe, different axis π
β¨ Purpose
ILAZLR scans A for its last non-zero row.
π Parameters
MβMis INTEGER. The number of rows of the matrixA.NβNis INTEGER. The number of columns of the matrixA.AβAis COMPLEX*16 array, dimension(LDA,N). The m by n matrixA.LDAβLDAis 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.
π subroutine zdrscl (integer N, double precision SA, complex*16, dimension( * ) SX, integer INCX)
ZDRSCL multiplies a vector by the reciprocal of a real scalar. division, but make it safe π
β¨ Purpose
ZDRSCL multiplies an n-element complex vector x by the real scalar 1/a. and the way she does it? without overflow or underflow β as long as the final result x/a doesn't overflow or underflow. periodt.
π Parameters
NβNis INTEGER. The number of components of the vectorx.SAβSAis DOUBLE PRECISION. The scalarawhich is used to divide each component ofx.SAmust be>= 0, or the subroutine will divide by zero. π¨ bestie watch outSXβSXis COMPLEX*16 array, dimension(1+(N-1)*abs(INCX)). The n-element vectorx.INCXβINCXis INTEGER. 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 zlabrd (integer M, integer N, integer NB, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) D, double precision, dimension( * ) E, complex*16, dimension( * ) TAUQ, complex*16, dimension( * ) TAUP, complex*16, dimension( ldx, * ) X, integer LDX, complex*16, dimension( ldy, * ) Y, integer LDY)
ZLABRD reduces the first nb rows and columns of a general matrix to a bidiagonal form. iconic reduction behavior π₯
β¨ Purpose
ZLABRD 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, it goes to lower bidiagonal form. choose your fighter π¦
also heads up: this is an auxiliary routine called by ZGEBRD.
π Parameters
MβMis INTEGER. The number of rows in the matrixA.NβNis INTEGER. The number of columns in the matrixA.NBβNBis INTEGER. The number of leading rows and columns ofAto be reduced.AβAis COMPLEX*16 array, dimension(LDA,N). On entry, the m by n general matrix to be reduced. On exit, the firstNBrows and columns of the matrix are overwritten; the rest of the array is unchanged. Ifm >= n, elements on and below the diagonal in the firstNBcolumns, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors; and elements above the diagonal in the firstNBrows, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors. Ifm < n, elements below the diagonal in the firstNBcolumns, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and elements on and above the diagonal in the firstNBrows, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors. See Further Details. πLDAβLDAβ INTEGER, bestie. It's the leading dimension of the arrayA. Rule of thumb:LDA >= max(1,M). Don't fight it, just respect it. πDβ DOUBLE PRECISION array, dimension(NB). These are the diagonal elements of the firstNBrows and columns of the reduced matrix. So like,D(i) = A(i,i). Iconic little diagonal moment. β¨Eβ DOUBLE PRECISION array, dimension(NB). The off-diagonal elements of the firstNBrows and columns of the reduced matrix. The spicy ones. π₯TAUQβ COMPLEX*16 array, dimension(NB). The scalar factors of the elementary reflectors that represent the unitary matrixQ. Peep Further Details below for the tea. π«TAUPβ COMPLEX*16 array, dimension(NB). The scalar factors of the elementary reflectors that represent the unitary matrixP. Again, Further Details has you covered. πXβ COMPLEX*16 array, dimension(LDX,NB). Them-by-nbmatrixXyou need to update the unreduced part ofA. Very much a supporting character with main character energy. πLDXβ INTEGER. Leading dimension of the arrayX. And yes:LDX >= max(1,M). β¨Yβ COMPLEX*16 array, dimension(LDY,NB). Then-by-nbmatrixYrequired to update the unreduced part ofA. The other half of the duo, fr fr. πLDYβ INTEGER. Leading dimension of the arrayY. Say it with me:LDY >= max(1,N). πΈ
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
Okay so the matrices Q and P are represented as products of elementary reflectors, and here's the whole vibe:
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. Scalars and vectors, living their best lives. π¦
If m >= n, then 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, then 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. That's the whole plot twist right there. π
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). So like, a is the untouched bestie, vi and ui are the glow-ups. π
πΈ subroutine zlacgv (integer N, complex*16, dimension( * ) X, integer INCX) πΈ
ZLACGV conjugates a complex vector. That's it. That's the whole job. Short, sweet, slays. π
Purpose:
ZLACGV conjugates a complex vector of length N. β¨
Parameters
Nβ INTEGER. The length of the vectorX. AndN >= 0, no negativity allowed here. πXβ COMPLEX*16 array, dimension(1+(N-1)*abs(INCX)). On entry, the vector of lengthNto be conjugated. On exit,Xis overwritten withconjg(X). Overwritten! Gone! Transformed! π¦INCXβ INTEGER. The spacing between successive elements ofX. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zlacn2 (integer N, complex*16, dimension( * ) V, complex*16, dimension( * ) X, double precision EST, integer KASE, integer, dimension( 3 ) ISAVE) π
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. Reverse communication is giving "we'll call you back" energy and honestly? It works. π
Purpose:
ZLACN2 estimates the 1-norm of a square, complex matrix A. Reverse communication is used for evaluating matrix-vector products. π
Parameters
Nβ INTEGER. The order of the matrix. AndN >= 1. β¨Vβ COMPLEX*16 array, dimension(N). On the final return,V = A*W, whereEST = norm(V)/norm(W)(Wis not returned). W stays mysterious. We don't get to see W. W is a private person. πXβ COMPLEX*16 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 ZLACN2 must be re-called with all the other parameters unchanged. UNCHANGED. I'm serious. Do not touch the other params. π₯
ESTβ DOUBLE PRECISION. On entry withKASE = 1or2andISAVE(1) = 3,ESTshould be unchanged from the previous call toZLACN2. On exit,ESTis an estimate (a lower bound) fornorm(A). Lower bound btw β it's an estimate, not the whole truth. πKASEβ INTEGER. On the initial call toZLACN2,KASEshould be0. On an intermediate return,KASEwill be1or2, indicating whetherXshould be overwritten byA * XorA**H * X. On the final return fromZLACN2,KASEwill again be0. Full circle moment. πISAVEβ INTEGER array, dimension(3).ISAVEis used to save variables between calls toZLACN2. It's the little memory box. The group chat archive, if you will. π«Ά
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
Originally named CONEST, dated March 16, 1988. She's vintage, she's classic, she's been here since the 80s. π
Last modified: April, 1999. β¨
This is a thread safe version of ZLACON, which uses the array ISAVE in place of a SAVE statement, as follows:
ZLACON ZLACN2
JUMP ISAVE(1)
J ISAVE(2)
ITER ISAVE(3)
Thread safe = she can be in multiple conversations at once and never gets confused. Multitasking queen. π
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 zlacon (integer N, complex*16, dimension( n ) V, complex*16, dimension( n ) X, double precision EST, integer KASE) π
ZLACON estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products. Same energy as ZLACN2 but this one's the original recipe, iykyk. π¦
Purpose:
ZLACON estimates the 1-norm of a square, complex matrix A. Reverse communication is used for evaluating matrix-vector products. π
Parameters
Nβ INTEGER. The order of the matrix. AndN >= 1. β¨Vβ COMPLEX*16 array, dimension(N). On the final return,V = A*W, whereEST = norm(V)/norm(W)(Wis not returned). Still no W. W is a ghost. We respect it. π»Xβ COMPLEX*16 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 ZLACON must be re-called with all the other parameters unchanged. Again with the unchanged params. This is not a suggestion, bestie. π₯
ESTβ DOUBLE PRECISION. On entry withKASE = 1or2andJUMP = 3,ESTshould be unchanged from the previous call toZLACON. On exit,ESTis an estimate (a lower bound) fornorm(A). πKASEβ INTEGER. On the initial call toZLACON,KASEshould be0. On an intermediate return,KASEwill be1or2, indicating whetherXshould be overwritten byA * XorA**H * X. On the final return fromZLACON,KASEwill again be0. Zero to one to two back to zero. A whole character arc. π
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 zlacp2 (character UPLO, integer M, integer N, double precision, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB) π
ZLACP2 copies all or part of a real two-dimensional array to a complex array. Glow-up pipeline: real in, complex out. π¦
Purpose:
ZLACP2 copies all or part of a real two-dimensional matrix A to a complex matrix B. β¨
Parameters
UPLOβ 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
Pick your triangle, or pick everything. No wrong answers, just different vibes. π
Mβ INTEGER. The number of rows of the matrixA. AndM >= 0. β¨Nβ INTEGER. The number of columns of the matrixA. AndN >= 0. πΈAβ DOUBLE PRECISION array, dimension(LDA,N). ThembynmatrixA. IfUPLO = 'U', only the upper trapezium is accessed; ifUPLO = 'L', only the lower trapezium is accessed. Trapezium!! Not triangle!! The manpage said trapezium and we're honoring it!! π₯LDAβ INTEGER. The leading dimension of the arrayA. And you already know:LDA >= max(1,M). πBβ COMPLEX*16 array, dimension(LDB,N). On exit,B = Ain the locations specified byUPLO. On EXIT. So B is empty until she's done. Give her a second. π«ΆLDBβ INTEGER. The leading dimension of the arrayB. AndLDB >= max(1,M). β
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zlacpy (character UPLO, integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB) π
ZLACPY copies all or part of one two-dimensional array to another. Yes, the name literally is "copy". She's honest about her job. We stan a transparent queen. π
Purpose:
Okay so like β the UPLO of it all first, because that's what decides which chunk of A gets yeeted into B:
UPLOβCHARACTER*1. Tells us which part of matrixAgets copied intoB. It's giving choose-your-own-adventure:= 'U': only the upper triangular part πΈ= 'L': only the lower triangular part π- Otherwise: all of the matrix
A, no crumbs left behind β¨
MβINTEGER. The number of rows of matrixA.M >= 0, periodt.NβINTEGER. The number of columns of matrixA.N >= 0, fr fr.AβCOMPLEX*16array, dimension(LDA,N). It's thembynmatrixA. Heads up bestie: ifUPLO = 'U', only the upper trapezium is accessed; ifUPLO = 'L', only the lower trapezium is accessed. So like, don't stress about the other half, she's not looking at it π«ΆLDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,M). Respect the leading dimension or perish πBβCOMPLEX*16array, dimension(LDB,N). On exit,B = Ain the locations specified byUPLO. Slay, she copied πLDBβ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. (the absolute icons who wrote all this down π)
π subroutine zlacrm π
subroutine zlacrm (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, double precision, dimension( ldb, * ) B, integer LDB,
complex*16, dimension( ldc, * ) C, integer LDC, double precision,
dimension( * ) RWORK)
ZLACRM multiplies a complex matrix by a square real matrix. β¨
Purpose:
It's a "very simple" matrix-matrix multiplication, and by very simple I mean it says so itself. She does:
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. So like, mixed-vibes multiplication, one of them's real, one's complex, and yet they make it work π¦
Parameters
MβINTEGER. The number of rows of matrixAand of matrixC.M >= 0.NβINTEGER. The number of columns and rows of matrixBand the number of columns of matrixC.N >= 0. She's pulling double duty, main character energy πAβCOMPLEX*16array, dimension(LDA, N). On entry,Acontains theMbyNmatrixA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβDOUBLE PRECISIONarray, dimension(LDB, N). On entry,Bcontains theNbyNmatrixB.LDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβCOMPLEX*16array, dimension(LDC, N). On exit,Ccontains theMbyNmatrixC.LDCβINTEGER. The leading dimension of the arrayC.LDC >= max(1,N).RWORKβDOUBLE PRECISIONarray, dimension(2*M*N). Yes bestie,2*M*N, she needs the space.
Author β Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
π subroutine zlacrt π
subroutine zlacrt (integer N, complex*16, dimension( * ) CX, integer INCX,
complex*16, dimension( * ) CY, integer INCY, complex*16 C, complex*16 S)
ZLACRT performs a linear transformation of a pair of complex vectors. π
Purpose:
She 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. It's giving rotation but make it complex, and honestly? Obsessed.
Parameters
NβINTEGER. The number of elements in the vectorsCXandCY.CXβCOMPLEX*16array, dimension(N). On input, the vectorx. On output,CXis overwritten withc*x + s*y. She said new value, who dis πINCXβINTEGER. The increment between successive values ofCX.INCX <> 0. Like literally cannot be zero, do not try it.CYβCOMPLEX*16array, dimension(N). On input, the vectory. On output,CYis overwritten with-s*x + c*y.INCYβINTEGER. The increment between successive values ofCY.INCY <> 0. Same rule, no zeros allowed βCβCOMPLEX*16.SβCOMPLEX*16.CandSdefine the matrix
[ C S ].
[ -S C ]
Author β Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
π§ complex*16 function zladiv π§
complex*16 function zladiv (complex*16 X, complex*16 Y)
ZLADIV performs complex division in real arithmetic, avoiding unnecessary overflow. β¨
Purpose:
ZLADIV := X / Y, where X and Y are complex. The computation of X / Y
will not overflow on an intermediary step unless the results
overflows.
So like, she's dividing, but carefully, and the only way it overflows is if the actual result overflows. She's not out here creating chaos mid-calculation, she's too classy for that π
Parameters
XβCOMPLEX*16.YβCOMPLEX*16. The complex scalarsXandY. That's it, that's the tea.
Author β Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
π₯ subroutine zlaein π₯
subroutine zlaein (logical RIGHTV, logical NOINIT, integer N, complex*16,
dimension( ldh, * ) H, integer LDH, complex*16 W, complex*16, dimension(
* ) V, complex*16, dimension( ldb, * ) B, integer LDB, double precision,
dimension( * ) RWORK, double precision EPS3, double precision SMLNUM,
integer INFO)
ZLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iteration. π
Purpose:
ZLAEIN uses inverse iteration to find a right or left eigenvector corresponding to the eigenvalue W of a complex upper Hessenberg matrix H. Inverse iteration, bestie. She's iterating backwards into the answer and honestly it works every time.
Parameters
RIGHTVβLOGICAL. Pick your fighter:= .TRUE.: compute right eigenvector;= .FALSE.: compute left eigenvector.
NOINITβLOGICAL. Another pick-your-fighter:= .TRUE.: no initial vector supplied inV= .FALSE.: initial vector supplied inV.
NβINTEGER. The order of the matrixH.N >= 0.HβCOMPLEX*16array, dimension(LDH,N). The upper Hessenberg matrixH.LDHβINTEGER. The leading dimension of the arrayH.LDH >= max(1,N).WβCOMPLEX*16. The eigenvalue ofHwhose corresponding right or left eigenvector is to be computed.VβCOMPLEX*16array, 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|. Not the usual magnitude formula, bestie β it's the|x| + |y|one. Write that down πBβCOMPLEX*16array, dimension(LDB,N).LDBβINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).RWORKβDOUBLE PRECISIONarray, dimension(N).EPS3βDOUBLE PRECISION. A small machine-dependent value which is used to perturb close eigenvalues, and to replace zero pivots. She's nudging the awkward ones and swapping out the zero pivots, like a lil glow-up πSMLNUMβDOUBLE PRECISION. A machine-dependent value close to the underflow threshold.INFOβINTEGER. The receipts:= 0: successful exit π= 1: inverse iteration did not converge;Vis set to the last iterate. Not a slay, but she tells you honestly π
Author β Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver, NAG Ltd.
πΈ subroutine zlaev2 πΈ
subroutine zlaev2 (complex*16 A, complex*16 B, complex*16 C, double
precision RT1, double precision RT2, double precision CS1, complex*16
SN1)
ZLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. π¦
Purpose:
ZLAEV2 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 ].
Look at that factorization, she ate and left no crumbs π
Parameters
AβCOMPLEX*16. The(1,1)element of the 2-by-2 matrix.BβCOMPLEX*16. The(1,2)element and the conjugate of the(2,1)element of the 2-by-2 matrix.CβCOMPLEX*16. The(2,2)element of the 2-by-2 matrix.RT1βDOUBLE PRECISION. The eigenvalue of larger absolute value.RT2βDOUBLE PRECISION. The eigenvalue of smaller absolute value.CS1βDOUBLE PRECISION.SN1βCOMPLEX*16. 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:
Bestie, listen carefully, this is the accuracy lore and it matters π
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 so like,RT2can get a lil wobbly, that's just how it is π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 zlag2c π
subroutine zlag2c (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex, dimension( ldsa, * ) SA, integer LDSA, integer
INFO)
ZLAG2C converts a complex double precision matrix to a complex single precision matrix. β¨
Purpose:
ZLAG2C converts a COMPLEX*16 matrix, SA, to a COMPLEX matrix, A. Downcasting the vibe, keeping the plot π
RMAX is the overflow for the SINGLE PRECISION arithmetic. ZLAG2C checks that all the entries of A are between -RMAX and RMAX. If not, the conversion is aborted and a flag is raised. She does a vibe check first and she will walk out if it fails π©
This is an auxiliary routine so there is no argument checking. Yeah, no hand-holding here, she trusts you.
Parameters
Mβ and okay bestie, this is literally exactly where our part runs out, so hold that thought,M's whole moment is coming up next πMβ INTEGER πΈ how many lines the matrixAhas.M >= 0, bestie, always.Nβ INTEGER β¨ how many columns the matrixAhas.N >= 0.Aβ COMPLEX*16 array, dimension (LDA,N) π on entry, this is the M-by-N coefficient matrixA.LDAβ INTEGER β the leading dimension of the arrayA.LDA >= max(1,M), no exceptions queen.SAβ COMPLEX array, dimension (LDSA,N) π«Ά on exit, ifINFO=0, this is the M-by-N coefficient matrixSA; ifINFO>0, the content ofSAis unspecified (translation: don't trust it, don't look at it, don't text it back).LDSAβ INTEGER β the leading dimension of the arraySA.LDSA >= max(1,M).INFOβ INTEGER π the vibe report:= 0:successful exit. slay.= 1:an entry of the matrixAis greater than the SINGLE PRECISION overflow threshold β and in this case, the content ofSAon exit is unspecified. π
π«Ά Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ subroutine zlags2
subroutine zlags2 (logical UPPER, double precision A1, complex*16 A2, double
precision A3, double precision B1, complex*16 B2, double precision B3,
double precision CSU, complex*16 SNU, double precision CSV, complex*16
SNV, double precision CSQ, complex*16 SNQ)
ZLAGS2 π
π Purpose
okay so ZLAGS2 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. (yes, that specific, that iconic.)
π Parameters
UPPERβ LOGICAL= .TRUE.:the input matricesAandBare upper triangular.= .FALSE.:the input matricesAandBare lower triangular.
A1β DOUBLE PRECISIONA2β COMPLEX*16A3β DOUBLE PRECISION β on entry,A1,A2andA3are elements of the input 2-by-2 upper (lower) triangular matrixA. πB1β DOUBLE PRECISIONB2β COMPLEX*16B3β DOUBLE PRECISION β on entry,B1,B2andB3are elements of the input 2-by-2 upper (lower) triangular matrixB. πΈCSUβ DOUBLE PRECISIONSNUβ COMPLEX*16 β the desired unitary matrixU. πCSVβ DOUBLE PRECISIONSNVβ COMPLEX*16 β the desired unitary matrixV. πCSQβ DOUBLE PRECISIONSNQβ COMPLEX*16 β the desired unitary matrixQ. β¨
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zlagtm
subroutine zlagtm (character TRANS, integer N, integer NRHS, double
precision ALPHA, complex*16, dimension( * ) DL, complex*16, dimension( *
) D, complex*16, dimension( * ) DU, complex*16, dimension( ldx, * ) X,
integer LDX, double precision BETA, complex*16, dimension( ldb, * ) B,
integer LDB)
ZLAGTM 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. π§
π Purpose
not me about to explain this so it actually clicks β ZLAGTM 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. periodt. π
π Parameters
TRANSβ CHARACTER*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
Nβ INTEGER β the order of the matrixA.N >= 0.NRHSβ INTEGER β the number of right hand sides, i.e., the number of columns of the matricesXandB. πβοΈALPHAβ DOUBLE PRECISION β the scalar alpha.ALPHAmust be0.,1., or-1.; otherwise, it is assumed to be0.DLβ COMPLEX*16 array, dimension (N-1) β the (n-1) sub-diagonal elements ofT. π¦Dβ COMPLEX*16 array, dimension (N) β the diagonal elements ofT.DUβ COMPLEX*16 array, dimension (N-1) β the (n-1) super-diagonal elements ofT.Xβ COMPLEX*16 array, dimension (LDX,NRHS) β theNbyNRHSmatrixX. πΈLDXβ INTEGER β the leading dimension of the arrayX.LDX >= max(N,1).BETAβ DOUBLE PRECISION β the scalar beta.BETAmust be0.,1., or-1.; otherwise, it is assumed to be1.Bβ COMPLEX*16 array, dimension (LDB,NRHS) β on entry, theNbyNRHSmatrixB. On exit,Bis overwritten by the matrix expressionB := alpha * A * X + beta * B. πLDBβ INTEGER β 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 zlahqr
subroutine zlahqr (logical WANTT, logical WANTZ, integer N, integer ILO,
integer IHI, complex*16, dimension( ldh, * ) H, integer LDH, complex*16,
dimension( * ) W, integer ILOZ, integer IHIZ, complex*16, dimension(
ldz, * ) Z, integer LDZ, integer INFO)
ZLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm. π
π Purpose
ZLAHQR 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. π
π Parameters
WANTTβ LOGICAL= .TRUE. :the full Schur formTis required;= .FALSE.:only eigenvalues are required.
WANTZβ LOGICAL= .TRUE. :the matrix of Schur vectorsZis required;= .FALSE.:Schur vectors are not required.
Nβ INTEGER β the order of the matrixH.N >= 0.ILOβ INTEGERIHIβ INTEGER β it is assumed thatHis already upper triangular in rows and columnsIHI+1:N, and thatH(ILO,ILO-1) = 0(unlessILO = 1).ZLAHQRworks primarily with the Hessenberg submatrix in rows and columnsILOtoIHI, but applies transformations to all ofHifWANTTis.TRUE..1 <= ILO <= max(1,IHI); IHI <= N.πHβ COMPLEX*16 array, dimension (LDH,N) β on entry, the upper Hessenberg matrixH. On exit, ifINFOis zero and ifWANTTis.TRUE., thenHis upper triangular in rows and columnsILO:IHI. IfINFOis zero and ifWANTTis.FALSE., then the contents ofHare unspecified on exit. The output state ofHin caseINFis positive is below under the description ofINFO. πLDHβ INTEGER β the leading dimension of the arrayH.LDH >= max(1,N).Wβ COMPLEX*16 array, dimension (N) β the computed eigenvaluesILOtoIHIare stored in the corresponding elements ofW. IfWANTTis.TRUE., the eigenvalues are stored in the same order as on the diagonal of the Schur form returned inH, withW(i) = H(i,i). πΈILOZβ INTEGERIHIZβ INTEGER β specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO; IHI <= IHIZ <= N.Zβ COMPLEX*16 array, dimension (LDZ,N) β ifWANTZis.TRUE., on entryZmust contain the current matrixZof transformations accumulated byCHSEQR, and on exitZhas been updated; transformations are applied only to the submatrixZ(ILOZ:IHIZ,ILO:IHI). IfWANTZis.FALSE.,Zis not referenced. πLDZβ INTEGER β the leading dimension of the arrayZ.LDZ >= max(1,N).INFOβ INTEGER β the receipts:= 0:successful exit π> 0:ifINFO = i,ZLAHQRfailed to compute all the eigenvaluesILOtoIHIin a total of 30 iterations per eigenvalue; elementsi+1:ihiofWcontain those eigenvalues which have been successfully computed. π
If INFO > 0 and WANTT is .FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columns ILO through INFO of the final, output value of H.
okay so if INFO > 0 and WANTT is .TRUE., then on exit:
(*) (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. π
And if INFO > 0 and WANTZ is .TRUE., then on exit:
(final value of Z) = (initial value of Z)*U
where U is the orthogonal matrix in (*) β and this holds regardless of the value of WANTT. no cap. π¦
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors:
02-96 Based on modifications by
David Day, Sandia National Laboratory, USA
12-04 Further modifications by
Ralph Byers, University of Kansas, USA
This is a modified version of ZLAHQR 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).
so basically this one got a glow-up from the original ZLAHQR π β more robust against overflow and underflow, and it adopted that conservative Ahues & Tisseur stopping criterion (LAWN 122, 1997). iconic behavior honestly.
β¨ subroutine zlahr2 (integer N, integer K, integer NB, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( nb ) TAU, complex*16, dimension( ldt, nb ) T, integer LDT, complex*16, dimension( ldy, nb ) Y, integer LDY)
ZLAHR2 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. π«Ά
Purpose:
ZLAHR2 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 ZGEHRD. β¨
Parameters
NβNis INTEGER. The order of the matrixA.KβKis INTEGER. The offset for the reduction. Elements below thek-th subdiagonal in the firstNBcolumns are reduced to zero.K < N.NBβNBis INTEGER. The number of columns to be reduced.AβAis COMPLEX*16 array, dimension(LDA,N-K+1). On entry, then-by-(n-k+1)general matrixA. 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 matrixQas a product of elementary reflectors. The other columns ofAare unchanged. See Further Details. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TAUβTAUis COMPLEX*16 array, dimension(NB). The scalar factors of the elementary reflectors. See Further Details.TβTis COMPLEX*16 array, dimension(LDT,NB). The upper triangular matrixT.LDTβLDTis INTEGER. The leading dimension of the arrayT.LDT >= NB.YβYis COMPLEX*16 array, dimension(LDY,NB). Then-by-nbmatrixY.LDYβLDYis INTEGER. The leading dimension of the arrayY.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). πΈ
This subroutine is a slight modification of LAPACK-3.0's ZLAHRD 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 ZLAHRD routine. (This subroutine is not backward compatible with LAPACK-3.0's ZLAHRD.) β οΈ bestie, do not assume it swaps in cleanly.
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 zlaic1 (integer JOB, integer J, complex*16, dimension( j ) X, double precision SEST, complex*16, dimension( j ) W, complex*16 GAMMA, double precision SESTPR, complex*16 S, complex*16 C)
ZLAIC1 applies one step of incremental condition estimation. β¨
Purpose:
ZLAIC1 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 ZLAIC1 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βJOBis INTEGER.= 1: an estimate for the largest singular value is computed.= 2: an estimate for the smallest singular value is computed.JβJis INTEGER. Length ofXandW.XβXis COMPLEX*16 array, dimension(J). Thej-vectorx.SESTβSESTis DOUBLE PRECISION. Estimated singular value ofjbyjmatrixL.WβWis COMPLEX*16 array, dimension(J). Thej-vectorw.GAMMAβGAMMAis COMPLEX*16. The diagonal elementgamma.SESTPRβSESTPRis DOUBLE PRECISION. Estimated singular value of(j+1)by(j+1)matrixLhat.SβSis COMPLEX*16. Sine needed in formingxhat.CβCis COMPLEX*16. Cosine needed in formingxhat.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ double precision function zlangt (character NORM, integer N, complex*16, dimension( * ) DL, complex*16, dimension( * ) D, complex*16, dimension( * ) DU)
ZLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix. π
Purpose:
ZLANGT 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
ZLANGT
ZLANGT = ( 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βNORMis CHARACTER*1. Specifies the value to be returned inZLANGTas described above.NβNis INTEGER. The order of the matrixA.N >= 0. WhenN = 0,ZLANGTis set to zero.DLβDLis COMPLEX*16 array, dimension(N-1). The(n-1)sub-diagonal elements ofA.DβDis COMPLEX*16 array, dimension(N). The diagonal elements ofA.DUβDUis COMPLEX*16 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.
π double precision function zlanhb (character NORM, character UPLO, integer N, integer K, complex*16, dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * ) WORK)
ZLANHB 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. π«Ά
Purpose:
ZLANHB 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
ZLANHB
ZLANHB = ( 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'
okay so quick translation bestie π norm1 is the one norm of a matrix, aka the maximum column sum. normI is the infinity norm, aka the maximum row sum. And normF is the Frobenius norm, the square root of sum of squares. and the gag is β max(abs(A(i,j))) is not a consistent matrix norm. it's giving "technically works, mathematically messy". π
β¨ Parameters β¨
NORMβNORMisCHARACTER*1. it tells you which value gets handed back in ZLANHB, exactly like described up above. no surprises here. πUPLOβUPLOisCHARACTER*1. it specifies whether the upper or lower triangular part of the band matrix A is the thing you're supplying.= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. it's the order of the matrix A.N >= 0. and whenN = 0, ZLANHB gets set to zero. slay, edge case handled. β¨KβKisINTEGER. the number of super-diagonals or sub-diagonals of the band matrix A.K >= 0. πΈABβABisCOMPLEX*16 array, dimension (LDAB,N). it holds the upper or lower triangle of the hermitian band matrix A, stored in the first K+1 rows of AB. the j-th column of A lives in the j-th column of the array AB, like this:- 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
heads up though β the imaginary parts of the diagonal elements don't need to be set, they're just assumed to be zero. so don't stress about them bestie, they're lowkey not your problem. π
LDABβLDABisINTEGER. the leading dimension of the array AB.LDAB >= K+1. periodt.WORKβWORKisDOUBLE PRECISION array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'. otherwise, WORK is not referenced. it's giving "you can ignore me, I'm just here for moral support". π
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ double precision function zlanhp π¦
double precision function zlanhp (character NORM, character UPLO, integer N,
complex*16, dimension( * ) AP, double precision, dimension( * ) WORK)
ZLANHP 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!! it's like the matrix got vacuum-sealed for travel. π§³β¨
Purpose:
ZLANHP 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:
ZLANHP = ( 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βNORMisCHARACTER*1. specifies the value to be returned in ZLANHP as described above. iykyk. πUPLOβUPLOisCHARACTER*1. specifies whether the upper or lower triangular part of the hermitian matrix A is supplied.= 'U': Upper triangular part of A is supplied= 'L': Lower triangular part of A is supplied
NβNisINTEGER. the order of the matrix A.N >= 0. whenN = 0, ZLANHP is set to zero. πAPβAPisCOMPLEX*16 array, dimension (N*(N+1)/2). the upper or lower triangle of the hermitian 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
and again: the imaginary parts of the diagonal elements need not be set and are assumed to be zero. π
WORKβWORKisDOUBLE PRECISION array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise, WORK is not referenced. π
Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
β double precision function zlanhs β
double precision function zlanhs (character NORM, integer N, complex*16,
dimension( lda, * ) A, integer LDA, double precision, dimension( * )
WORK)
ZLANHS 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!! she's almost triangular but she keeps ONE little extra diagonal. main character energy honestly. π
Purpose:
ZLANHS 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:
ZLANHS = ( 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βNORMisCHARACTER*1. specifies the value to be returned in ZLANHS as described above. π«NβNisINTEGER. the order of the matrix A.N >= 0. whenN = 0, ZLANHS is set to zero. β¨AβAisCOMPLEX*16 array, dimension (LDA,N). the n by n upper Hessenberg matrix A. the part of A below the first sub-diagonal is not referenced β so like, don't even bother filling it in, nobody's reading it. πLDAβLDAisINTEGER. the leading dimension of the array A.LDA >= max(N,1). πΈWORKβWORKisDOUBLE PRECISION array, dimension (MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'; otherwise, WORK is not referenced. note bestie: this one only needs WORK for'I', not for'1'or'O'like the others. she's different like that. π
Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π double precision function zlanht π
double precision function zlanht (character NORM, integer N, double
precision, dimension( * ) D, complex*16, dimension( * ) E)
ZLANHT 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!! only three diagonals, she's minimal, she's chic, she ate. π½οΈβ¨
Purpose:
ZLANHT 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:
ZLANHT = ( 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βNORMisCHARACTER*1. specifies the value to be returned in ZLANHT as described above. π«ΆNβNisINTEGER. the order of the matrix A.N >= 0. whenN = 0, ZLANHT is set to zero. πDβDisDOUBLE PRECISION array, dimension (N). the diagonal elements of A. the moment. the center of attention. βEβEisCOMPLEX*16 array, dimension (N-1). the (n-1) sub-diagonal or super-diagonal elements of A. yeah she's one shorter than D, that's not a typo, that's just how tridiagonal works bestie. πΈ
Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π double precision function zlansb π
double precision function zlansb (character NORM, character UPLO, integer N,
integer K, complex*16, dimension( ldab, * ) AB, integer LDAB, double
precision, dimension( * ) WORK)
ZLANSB 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. band matrix squad, assemble. πΈ
Purpose:
ZLANSB 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:
ZLANSB = ( 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βNORMisCHARACTER*1. specifies the value to be returned in ZLANSB as described above. β¨UPLOβUPLOisCHARACTER*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βNisINTEGER. the order of the matrix A.N >= 0. whenN = 0, ZLANSB is set to zero. πKKβ INTEGER, bestie. It's how many super-diagonals or sub-diagonals the band matrixAhas going on. Requirement:K >= 0. No negatives, periodt. πABβ COMPLEX*16 array, dimension(LDAB,N). This is the upper or lower triangle of the symmetric band matrixA, and it lives in the firstK+1rows ofAB. Thej-th column ofAis stored in thej-th column of the arrayABlike this:
if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
LDABβ INTEGER, the leading dimension of the arrayAB. Gotta beLDAB >= K+1, no cap. β¨WORKβ DOUBLE PRECISION array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'. Otherwise?WORKis literally not referenced. She said what she said. π«Ά
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ double precision function zlansp
double precision function zlansp (character NORM, character UPLO, integer N,
complex*16, dimension( * ) AP, double precision, dimension( * ) WORK)
ZLANSP 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. It's giving "I only do one job and I do it flawlessly." π
β¨ Purpose
ZLANSP 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
ZLANSP = ( 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). Heads up though β max(abs(A(i,j))) is not a consistent matrix norm. Not me exposing the math like that π
π Parameters
NORMβ CHARACTER*1. Specifies the value to be returned inZLANSPas described above. Pick your fighter. πUPLOβ CHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis supplied.= 'U': Upper triangular part ofAis supplied= 'L': Lower triangular part ofAis supplied
Nβ INTEGER. The order of the matrixA.N >= 0. WhenN = 0,ZLANSPis set to zero. Empty matrix? Zero. Slay. πAPβ COMPLEX*16 array, dimension(N*(N+1)/2). The upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array. Thej-th column ofAis stored in the arrayAPas 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.
WORKβ DOUBLE PRECISION array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'or'1'or'O'; otherwise,WORKis not referenced. Same energy as before, she's consistent. π¦
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ double precision function zlantb
double precision function zlantb (character NORM, character UPLO, character
DIAG, integer N, integer K, complex*16, dimension( ldab, * ) AB, integer
LDAB, double precision, dimension( * ) WORK)
ZLANTB 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. Band matrix but make it triangular. Iconic. β¨
β¨ Purpose
ZLANTB 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
ZLANTB = ( 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). And again, fr fr: max(abs(A(i,j))) is not a consistent matrix norm. π«Ά
π Parameters
NORMβ CHARACTER*1. Specifies the value to be returned inZLANTBas described above.UPLOβ CHARACTER*1. Specifies whether the matrixAis upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
DIAGβ CHARACTER*1. Specifies whether or not the matrixAis unit triangular.= 'N': Non-unit triangular= 'U': Unit triangular
Nβ INTEGER. The order of the matrixA.N >= 0. WhenN = 0,ZLANTBis set to zero. πKβ INTEGER. The number of super-diagonals of the matrixAifUPLO = 'U', or the number of sub-diagonals of the matrixAifUPLO = 'L'.K >= 0.ABβ COMPLEX*16 array, dimension(LDAB,N). The upper or lower triangular band matrixA, stored in the firstk+1rows ofAB. Thej-th column ofAis stored in thej-th column of the arrayABas follows:
if UPLO = 'U', AB(k+1+i-j,j) = A(i,j) for max(1,j-k)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+k).
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. She's not reading them, she's just assuming. π
LDABβ INTEGER. The leading dimension of the arrayAB.LDAB >= K+1.WORKβ DOUBLE PRECISION array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'; otherwise,WORKis not referenced. Note it's only'I'this time, bestie, watch the difference. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ double precision function zlantp
double precision function zlantp (character NORM, character UPLO, character
DIAG, integer N, complex*16, dimension( * ) AP, double precision,
dimension( * ) WORK)
ZLANTP 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 = little storage, big power. π
β¨ Purpose
ZLANTP 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
ZLANTP = ( 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). And yes, one more time for the people in the back: max(abs(A(i,j))) is not a consistent matrix norm. π
π Parameters
NORMβ CHARACTER*1. Specifies the value to be returned inZLANTPas described above.UPLOβ CHARACTER*1. Specifies whether the matrixAis upper or lower triangular.= 'U': Upper triangular= 'L': Lower triangular
DIAGβ CHARACTER*1. Specifies whether or not the matrixAis unit triangular.= 'N': Non-unit triangular= 'U': Unit triangular
Nβ INTEGER. The order of the matrixA.N >= 0. WhenN = 0,ZLANTPis set to zero. Zero. Done. β¨APβ COMPLEX*16 array, dimension(N*(N+1)/2). The upper or lower triangular matrixA, packed columnwise in a linear array. Thej-th column ofAis stored in the arrayAPas 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. Again β not read, just vibes (and ones). π
WORKβ DOUBLE PRECISION array, dimension(MAX(1,LWORK)), whereLWORK >= NwhenNORM = 'I'; otherwise,WORKis not referenced.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ double precision function zlantr
double precision function zlantr (character NORM, character UPLO, character
DIAG, integer M, integer N, complex*16, dimension( lda, * ) A, integer
LDA, double precision, dimension( * ) WORK)
ZLANTR 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?? She contains multitudes. π
β¨ Purpose
ZLANTR 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.
π Returns
ZLANTR = ( 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). And (say it with me now π€) max(abs(A(i,j))) is not a consistent matrix norm. π
Parameters β¨
NORMβNORMisCHARACTER*1. Specifies the value to be returned inZLANTRas described above.UPLOβUPLOisCHARACTER*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 ifM = N.
DIAGβDIAGisCHARACTER*1. Specifies whether or not the matrix A has unit diagonal.= 'N': Non-unit diagonal= 'U': Unit diagonal
MβMisINTEGER. The number of rows of the matrix A.M >= 0, and ifUPLO = 'U',M <= N. WhenM = 0,ZLANTRis set to zero.NβNisINTEGER. The number of columns of the matrix A.N >= 0, and ifUPLO = 'L',N <= M. WhenN = 0,ZLANTRis set to zero.AβAisCOMPLEX*16array, dimension(LDA,N). The trapezoidal matrix A (A is triangular ifM = N). IfUPLO = '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. IfUPLO = '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 whenDIAG = 'U', the diagonal elements of A are not referenced and are assumed to be one.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(M,1).WORKβWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)), whereLWORK >= MwhenNORM = 'I'; otherwise,WORKis not referenced.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
zlapll β measuring the linear dependence of two vectors π
subroutine zlapll (integer N, complex*16, dimension( * ) X, integer INCX,
complex*16, dimension( * ) Y, integer INCY, double precision SSMIN)
ZLAPLL measures the linear dependence of two vectors.
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.
Parameters π
NβNisINTEGER. The length of the vectors X and Y.XβXisCOMPLEX*16array, dimension(1+(N-1)*INCX). On entry, X contains the N-vector X. On exit, X is overwritten.INCXβINCXisINTEGER. The increment between successive elements of X.INCX > 0.YβYisCOMPLEX*16array, dimension(1+(N-1)*INCY). On entry, Y contains the N-vector Y. On exit, Y is overwritten.INCYβINCYisINTEGER. The increment between successive elements of Y.INCY > 0.SSMINβSSMINisDOUBLE PRECISION. The smallest singular value of the N-by-2 matrixA = ( X Y ).
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
zlapmr β rearranging rows like a boss π
subroutine zlapmr (logical FORWRD, integer M, integer N, complex*16,
dimension( ldx, * ) X, integer LDX, integer, dimension( * ) K)
ZLAPMR rearranges rows of a matrix as specified by a permutation vector.
Purpose β¨
ZLAPMR 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βFORWRDisLOGICAL.= .TRUE., forward permutation= .FALSE., backward permutation
MβMisINTEGER. The number of rows of the matrix X.M >= 0.NβNisINTEGER. The number of columns of the matrix X.N >= 0.XβXisCOMPLEX*16array, dimension(LDX,N). On entry, the M by N matrix X. On exit, X contains the permuted matrix X.LDXβLDXisINTEGER. The leading dimension of the array X,LDX >= MAX(1,M).KβKisINTEGERarray, dimension(M). On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
zlapmt β permuting columns, periodt π
subroutine zlapmt (logical FORWRD, integer M, integer N, complex*16,
dimension( ldx, * ) X, integer LDX, integer, dimension( * ) K)
ZLAPMT performs a forward or backward permutation of the columns of a matrix.
Purpose β¨
ZLAPMT 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βFORWRDisLOGICAL.= .TRUE., forward permutation= .FALSE., backward permutation
MβMisINTEGER. The number of rows of the matrix X.M >= 0.NβNisINTEGER. The number of columns of the matrix X.N >= 0.XβXisCOMPLEX*16array, dimension(LDX,N). On entry, the M by N matrix X. On exit, X contains the permuted matrix X.LDXβLDXisINTEGER. The leading dimension of the array X,LDX >= MAX(1,M).KβKisINTEGERarray, dimension(N). On entry, K contains the permutation vector. K is used as internal workspace, but reset to its original value on output.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
zlaqhb β scaling a Hermitian band matrix, no cap π
subroutine zlaqhb (character UPLO, integer N, integer KD, complex*16,
dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * )
S, double precision SCOND, double precision AMAX, character EQUED)
ZLAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ.
Purpose β¨
ZLAQHB equilibrates a Hermitian band matrix A using the scaling factors in the vector S.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored.= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrix A.N >= 0.KDβKDisINTEGER. The number of super-diagonals of the matrix A ifUPLO = 'U', or the number of sub-diagonals ifUPLO = 'L'.KD >= 0.ABβABisCOMPLEX*16array, 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 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)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd). On exit, ifINFO = 0, the triangular factor U or L from the Cholesky factorizationA = U**H *UorA = L*L**Hof the band matrix A, in the same storage format as A.
- if
LDABβLDABisINTEGER. The leading dimension of the array AB.LDAB >= KD+1.SβSisDOUBLE PRECISIONarray, dimension(N). The scale factors for A.SCONDβSCONDisDOUBLE PRECISION. Ratio of the smallestS(i)to the largestS(i).AMAXβAMAXisDOUBLE PRECISION. Absolute value of largest matrix entry.EQUEDβEQUEDisCHARACTER*1. Specifies whether or not equilibration was done.= 'N': No equilibration.= 'Y': Equilibration was done, i.e., A has 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.
zlaqhp β scaling a Hermitian matrix in packed form π
subroutine zlaqhp (character UPLO, integer N, complex*16, dimension( * ) AP,
double precision, dimension( * ) S, double precision SCOND, double
precision AMAX, character EQUED)
ZLAQHP scales a Hermitian matrix stored in packed form.
Purpose β¨
ZLAQHP equilibrates a Hermitian matrix A using the scaling factors in the vector S.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored.= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrix A.N >= 0.APβAPβCOMPLEX*16array, dimension(N*(N+1)/2). On entry, bestie, this is the upper or lower triangle of the Hermitian matrixA, packed columnwise into one long linear array. The j-th column ofAsits insideAPlike this:
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.
And on exit? It's the equilibrated matrix: diag(S) * A * diag(S), chilling in the exact same storage format as A. Obsessed. π
SβDOUBLE PRECISIONarray, dimension(N). The scale factors forA. That's it, that's the whole job. β¨SCONDβDOUBLE PRECISION. The ratio of the smallestS(i)to the largestS(i). Tiny number = spicy scaling situation, iykyk. π«ΆAMAXβDOUBLE PRECISION. The absolute value of the largest matrix entry. Big mood, literally. πEQUEDβCHARACTER*1. Specifies whether or not equilibration was done:
= 'N': No equilibration.
= 'Y': Equilibration was done, i.e., A has been replaced by
diag(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 zlaqp2 (integer M, integer N, integer OFFSET, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) JPVT, complex*16, dimension( * ) TAU, double precision, dimension( * ) VN1, double precision, dimension( * ) VN2, complex*16, dimension( * ) WORK)
ZLAQP2 computes a QR factorization with column pivoting of the matrix block. π
Purpose:
ZLAQP2 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. Not me leaving half the block un-factorized bestie, that's literally the spec. π
Parameters π
MβINTEGER. The number of rows of the matrixA.M >= 0. βNβINTEGER. The number of columns of the matrixA.N >= 0. βOFFSETβINTEGER. The number of rows of the matrixAthat must be pivoted but no factorized.OFFSET >= 0. (Yes, "no factorized" β that's verbatim, I'm not touching it π«Ά)AβCOMPLEX*16array, 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. β¨LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,M). πΈJPVTβINTEGERarray, 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. πTAUβCOMPLEX*16array, dimension(min(M,N)). The scalar factors of the elementary reflectors. π¦VN1βDOUBLE PRECISIONarray, dimension(N). The vector with the partial column norms. πVN2βDOUBLE PRECISIONarray, dimension(N). The vector with the exact column norms. πWORKβCOMPLEX*16array, 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 zlaqps (integer M, integer N, integer OFFSET, integer NB, integer KB, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) JPVT, complex*16, dimension( * ) TAU, double precision, dimension( * ) VN1, double precision, dimension( * ) VN2, complex*16, dimension( * ) AUXV, complex*16, dimension( ldf, * ) F, integer LDF)
ZLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BLAS level 3. β¨ (the summary says "real" but this is the complex routine β I'm just reporting what it says, don't come for me π)
Purpose:
ZLAQPS 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. catastrophic cancellations is such a dramatic phrase and honestly? valid. π
Block A(1:OFFSET,1:N) is accordingly pivoted, but not factorized.
Parameters π
MβINTEGER. The number of rows of the matrixA.M >= 0. βNβINTEGER. The number of columns of the matrixA.N >= 0. βOFFSETβINTEGER. The number of rows ofAthat have been factorized in previous steps. π«ΆNBβINTEGER. The number of columns to factorize. πKBβINTEGER. The number of columns actually factorized. (Which may be less thanNB! The cancellation thing. You've been warned.) πAβCOMPLEX*16array, 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βINTEGER. The leading dimension of the arrayA.LDA >= max(1,M). πΈJPVTβINTEGERarray, dimension(N).JPVT(I) = K <==> Column Kof the full matrixAhas been permuted into positionIinAP. π¦TAUβCOMPLEX*16array, dimension(KB). The scalar factors of the elementary reflectors. πVN1βDOUBLE PRECISIONarray, dimension(N). The vector with the partial column norms. πVN2βDOUBLE PRECISIONarray, dimension(N). The vector with the exact column norms. βAUXVβCOMPLEX*16array, dimension(NB). Auxiliary vector. πFβCOMPLEX*16array, dimension(LDF,NB). MatrixF**H = L * Y**H * A. π₯LDFβ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 zlaqr0 (logical WANTT, logical WANTZ, integer N, integer ILO, integer IHI, complex*16, dimension( ldh, * ) H, integer LDH, complex*16, dimension( * ) W, integer ILOZ, integer IHIZ, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. πβ¨ this one is kind of the main character ngl
Purpose:
ZLAQR0 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 π
WANTTβLOGICAL:
= .TRUE. : the full Schur form T is required;
= .FALSE.: only eigenvalues are required.
WANTZβLOGICAL:
= .TRUE. : the matrix of Schur vectors Z is required;
= .FALSE.: Schur vectors are not required.
NβINTEGER. The order of the matrixH.N >= 0. βILOβINTEGER. π«ΆIHIβINTEGER. 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 toZGEBAL, and then passed toZGEHRDwhen the matrix output byZGEBALis reduced to Hessenberg form. Otherwise,ILOandIHIshould be set to1andN, respectively. IfN > 0, then1 <= ILO <= IHI <= N. IfN = 0, thenILO = 1andIHI = 0. πHβCOMPLEX*16array, 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 set H(i,j) = 0 for i > j and j = 1, 2, ... ILO-1 or j = IHI+1, IHI+2, ... N. β¨
LDHβLDHβINTEGER. The leading dimension of the arrayH.LDH >= max(1,N). bestie it's just how wide the array is declared, don't overthink it πWβCOMPLEX*16array, dimension(N). The computed eigenvalues ofH(ILO:IHI,ILO:IHI)get parked inW(ILO:IHI). And ifWANTTis.TRUE., then those eigenvalues come out in the same order as they sit on the diagonal of the Schur form returned inH, withW(i) = H(i,i). cute, consistent, iconic β¨ILOZβINTEGER. (no description given here, it's just vibing as an integer π)IHIZβINTEGER. This one specifies the rows ofZthat transformations have to be applied to whenWANTZis.TRUE.β like, the exact rows, no freelancing. Constraint check:1 <= ILOZ <= ILO; IHI <= IHIZ <= N.ZβCOMPLEX*16array, dimension(LDZ,IHI). IfWANTZis.FALSE., thenZis not referenced at all, she's off duty π. IfWANTZis.TRUE., thenZ(ILO:IHI,ILOZ:IHIZ)is replaced byZ(ILO:IHI,ILOZ:IHIZ)*UwhereUis the orthogonal Schur factor ofH(ILO:IHI,ILO:IHI). And heads up: the output value ofZwhenINFO > 0is described down in theINFOsection, so scroll, don't guess π«ΆLDZβINTEGER. The leading dimension of the arrayZ. IfWANTZis.TRUE.thenLDZ >= MAX(1,IHIZ). Otherwise,LDZ >= 1. Simple as that.WORKβCOMPLEX*16array, dimensionLWORK. On exit, ifLWORK = -1, thenWORK(1)returns an estimate of the optimal value forLWORK. yes queen, she reports back πLWORKβINTEGER. The dimension of the arrayWORK.LWORK >= max(1,N)is sufficient, but honestlyLWORKtypically as large as6*Nmay be required for optimal performance. A workspace query to determine the optimal workspace size is recommended, fr fr.
If LWORK = -1, then ZLAQR0 does a workspace query. In this case, ZLAQR0 checks the input parameters and estimates the optimal workspace size for the given values of N, ILO and IHI. The estimate is returned in WORK(1). No error message related to LWORK is issued by XERBLA. Neither H nor Z are accessed. so she peeks without touching, respectful π
INFOβINTEGER.= 0: successful exit π periodt.> 0: ifINFO = i,ZLAQR0failed to compute all of the eigenvalues. Elements1:ilo-1andi+1:nofWRandWIcontain those eigenvalues which have been successfully computed. (Failures are rare.) like, genuinely rare, don't spiral.
If INFO > 0 and WANT is .FALSE., then on exit, the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columns ILO through INFO of the final, output value of H.
If INFO > 0 and WANTT is .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. she said not today π
ββοΈ
π 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 zlaqr1 (integer N, complex*16, dimension( ldh, * ) H, integer LDH, complex*16 S1, complex*16 S2, complex*16, dimension( * ) V)
ZLAQR1 sets a scalar multiple of the first column of the product of 2-by-2 or 3-by-3 matrix H and specified shifts. that's the whole job, she's a specialist π
Purpose:
Given a 2-by-2 or 3-by-3 matrix H, ZLAQR1 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. safety first, always π§
This is useful for starting double implicit shift bulges in the QR algorithm. yes bestie, bulges, it's a whole thing, it's giving main character energy π
Parameters
NβINTEGER. Order of the matrixH.Nmust be either2or3. only those two, she's picky and that's her right πHβCOMPLEX*16array, dimension(LDH,N). The 2-by-2 or 3-by-3 matrixHin(*).LDHβINTEGER. The leading dimension ofHas declared in the calling procedure.LDH >= N.S1βCOMPLEX*16. (just sitting there being a shift, we love her)S2βCOMPLEX*16.S1andS2are the shifts definingKin(*)above. the duo, the icons, the moment β¨VβCOMPLEX*16array, dimension(N). A scalar multiple of the first column of the matrixKin(*). there she is π
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 zlaqr2 (logical WANTT, logical WANTZ, integer N, integer KTOP, integer KBOT, integer NW, complex*16, dimension( ldh, * ) H, integer LDH, integer ILOZ, integer IHIZ, complex*16, dimension( ldz, * ) Z, integer LDZ, integer NS, integer ND, complex*16, dimension( * ) SH, complex*16, dimension( ldv, * ) V, integer LDV, integer NH, complex*16, dimension( ldt, * ) T, integer LDT, integer NV, complex*16, dimension( ldwv, * ) WV, integer LDWV, complex*16, dimension( * ) WORK, integer LWORK)
ZLAQR2 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 is SUCH a name, the audacity, the confidence π₯
Purpose:
ZLAQR2 is identical to ZLAQR3 except that it avoids recursion by calling ZLAHQR instead of ZLAQR4. noted, no recursion here, she keeps it flat π
Aggressive early deflation:
ZLAQR2 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. fingers crossed bestie π€ zero subdiagonals are the dream πΈ
Parameters
WANTTβ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. minimal effort, maximum result, that's balance βWANTZβLOGICAL. 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.NβINTEGER. The order of the matrixHand (ifWANTZis.TRUE.) the order of the unitary matrixZ.KTOPβINTEGER. It is assumed that eitherKTOP = 1orH(KTOP,KTOP-1)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix. an isolated block, she's independent, she doesn't need anyone πKBOTβ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. > yes, "without a check" β she trusts you, don't make it weird πNWβINTEGER. Deflation window size.1 <= NW <= (KBOT-KTOP+1).HβCOMPLEX*16array, dimension(LDH,N). On input the initial N-by-N section 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. glow up complete β¨LDHβINTEGER. Leading dimension ofHjust as declared in the calling subroutine.N <= LDH.ILOZβINTEGER. (she's here, she's an integer, she has no notes π)IHIZβINTEGER. Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= N.ZβCOMPLEX*16array, 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. untouched, unbothered, thriving π¦LDZβINTEGER. The leading dimension ofZjust as declared in the calling subroutine.1 <= LDZ.NSβINTEGER. The number of unconverged (ie approximate) eigenvalues returned inSRandSIthat may be used as shifts by the calling subroutine.NDβINTEGER. The number of converged eigenvalues uncovered by this subroutine. we love an uncover πSHβCOMPLEX*16array, 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βCOMPLEX*16array, dimension(LDV,NW). An NW-by-NW work array.LDVβLDVβ INTEGER bestie, it's just the leading dimension ofV, exactly as you declared it in the calling subroutine. So likeβ¦NW <= LDV. πNHβ INTEGER. The number of columns ofT. AndNH >= NW, no exceptions. πTβCOMPLEX*16array, dimension(LDT,NW). That's it, that's the girl. β¨LDTβ INTEGER. The leading dimension ofTjust as declared in the calling subroutine.NW <= LDT. π¦NVβ INTEGER. How many rows of the work arrayWVyou've got available for workspace.NV >= NW. πΈWVβCOMPLEX*16array, dimension(LDWV,NW). Living her life. πLDWVβ INTEGER. The leading dimension ofWjust as declared in the calling subroutine.NW <= LDV. (yes it saysLDV, we're keeping it exactly, don't @ me π)WORKβCOMPLEX*16array, dimension(LWORK). On exit,WORK(1)is set to an estimate of the optimal value ofLWORKfor the given values ofN,NW,KTOPandKBOT. π₯LWORKβ INTEGER. The dimension of the work arrayWORK.LWORK = 2*NWsuffices, but greater efficiency may result from larger values ofLWORK.
And ifLWORK = -1?? Then a workspace query is assumed, okay?ZLAQR2only estimates the optimal workspace size for the given values ofN,NW,KTOPandKBOT. The estimate is returned inWORK(1). No error message related toLWORKis issued byXERBLA. NeitherHnorZare 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
π subroutine zlaqr3 π
subroutine zlaqr3 (logical WANTT, logical WANTZ, integer N, integer KTOP,
integer KBOT, integer NW, complex*16, dimension( ldh, * ) H, integer
LDH, integer ILOZ, integer IHIZ, complex*16, dimension( ldz, * ) Z,
integer LDZ, integer NS, integer ND, complex*16, dimension( * ) SH,
complex*16, dimension( ldv, * ) V, integer LDV, integer NH, complex*16,
dimension( ldt, * ) T, integer LDT, integer NV, complex*16, dimension(
ldwv, * ) WV, integer LDWV, complex*16, dimension( * ) WORK, integer
LWORK)
ZLAQR3 performs the unitary similarity transformation of a Hessenberg matrix to detect and deflate fully converged eigenvalues from a trailing principal submatrix (aggressive early deflation). Iconic behaviour, honestly. π
Purpose:
Aggressive early deflation, bestie. Let's go. π
ZLAQR3 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 for u π―οΈ)
Parameters
WANTTβ 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β LOGICAL. 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. (yes, "so so" β that's the original, we don't edit β¨)Nβ INTEGER. The order of the matrixHand (ifWANTZis.TRUE.) the order of the unitary matrixZ. πKTOPβ INTEGER. It is assumed that eitherKTOP = 1orH(KTOP,KTOP-1)=0.KBOTandKTOPtogether determine an isolated block along the diagonal of the Hessenberg matrix. πΈKBOTβ 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β INTEGER. Deflation window size.1 <= NW <= (KBOT-KTOP+1). πHβCOMPLEX*16array, dimension(LDH,N). On input the initial N-by-N section 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β INTEGER. Leading dimension ofHjust as declared in the calling subroutine.N <= LDH. β¨ILOZβ INTEGER. (that's the whole description, she's mysterious π )IHIZβ INTEGER. Specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= N. πZβCOMPLEX*16array, 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β INTEGER. The leading dimension ofZjust as declared in the calling subroutine.1 <= LDZ. π¦NSβ INTEGER. The number of unconverged (ie approximate) eigenvalues returned inSRandSIthat may be used as shifts by the calling subroutine. πNDβ INTEGER. The number of converged eigenvalues uncovered by this subroutine. π₯SHβCOMPLEX*16array, dimension(KBOT). On output, approximate eigenvalues that may be used for shifts are stored inSH(KBOT-ND-NS+1)throughSR(KBOT). Converged eigenvalues are stored inSH(KBOT-ND+1)throughSH(KBOT). (yep,SRβ original, verbatim, keeping it π)VβCOMPLEX*16array, dimension(LDV,NW). An NW-by-NW work array. πLDVβ INTEGER. The leading dimension ofVjust as declared in the calling subroutine.NW <= LDV. β¨NHβ INTEGER. The number of columns ofT.NH >= NW. πTβCOMPLEX*16array, dimension(LDT,NW). πΈLDTβ INTEGER. The leading dimension ofTjust as declared in the calling subroutine.NW <= LDT. π¦NVβ INTEGER. The number of rows of work arrayWVavailable for workspace.NV >= NW. πWVβCOMPLEX*16array, dimension(LDWV,NW). πLDWVβ INTEGER. The leading dimension ofWjust as declared in the calling subroutine.NW <= LDV. (again with theLDV, we love consistency π)WORKβCOMPLEX*16array, dimension(LWORK). On exit,WORK(1)is set to an estimate of the optimal value ofLWORKfor the given values ofN,NW,KTOPandKBOT. π₯LWORKβ INTEGER. The dimension of the work arrayWORK.LWORK = 2*NWsuffices, but greater efficiency may result from larger values ofLWORK.
IfLWORK = -1, then a workspace query is assumed;ZLAQR3only estimates the optimal workspace size for the given values ofN,NW,KTOPandKBOT. The estimate is returned inWORK(1). No error message related toLWORKis issued byXERBLA. NeitherHnorZare accessed. She is simply β¨not lookingβ¨. π
β¨ 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 zlaqr4 π
subroutine zlaqr4 (logical WANTT, logical WANTZ, integer N, integer ILO,
integer IHI, complex*16, dimension( ldh, * ) H, integer LDH, complex*16,
dimension( * ) W, integer ILOZ, integer IHIZ, complex*16, dimension(
ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK,
integer INFO)
ZLAQR4 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur decomposition. Main character energy fr fr. π
Purpose:
ZLAQR4 implements one level of recursion for ZLAQR0. It is a complete implementation of the small bulge multi-shift QR algorithm. It may be called by ZLAQR0 and, for large enough deflation window size, it may be called by ZLAQR3. This subroutine is identical to ZLAQR0 except that it calls ZLAQR2 instead of ZLAQR3. (sibling behaviour, lowkey π
)
ZLAQR4 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
WANTTβ LOGICAL.= .TRUE.: the full Schur formTis required;= .FALSE.: only eigenvalues are required. π
WANTZβ LOGICAL.= .TRUE.: the matrix of Schur vectorsZis required;= .FALSE.: Schur vectors are not required. πΈ
Nβ INTEGER. The order of the matrixH.N >= 0. π¦ILOβ INTEGER. (no further description, she simply is π)IHIβIHIisINTEGERβ okay bestie, here's the vibe: it assumesHis already upper triangular in rows and columns1:ILO-1andIHI+1:N, and ifILO > 1, thenH(ILO,ILO-1)is zero.ILOandIHIare normally set by a previous call toZGEBAL, and then passed toZGEHRDwhen the matrix output byZGEBALis reduced to Hessenberg form. Otherwise,ILOandIHIshould be set to1andN, respectively. IfN > 0, then1 <= ILO <= IHI <= N. IfN = 0, thenILO = 1andIHI = 0. <sparkle>β¨</sparkle>HisCOMPLEX*16array, 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. <butterfly>π¦</butterfly>LDHisINTEGERβ the leading dimension of the arrayH.LDH >= max(1,N). πWisCOMPLEX*16array, 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). <sparkle>β¨</sparkle>ILOZisINTEGERβ that's it, that's the whole description πIHIZisINTEGERβ specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= ILO; IHI <= IHIZ <= N. πΈZisCOMPLEX*16array, 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.) <butterfly>π¦</butterfly>LDZisINTEGERβ the leading dimension of the arrayZ. ifWANTZis.TRUE.thenLDZ >= MAX(1,IHIZ). Otherwise,LDZ >= 1. πWORKisCOMPLEX*16array, dimensionLWORKβ on exit, ifLWORK = -1,WORK(1)returns an estimate of the optimal value forLWORK. <sparkle>β¨</sparkle>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, thenZLAQR4does a workspace query. In this case,ZLAQR4checks 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,ZLAQR4failed to compute all of the eigenvalues. Elements1:ilo-1andi+1:nofWRandWIcontain those eigenvalues which have been successfully computed. (Failures are rare.)- 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
- If
(*) (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.
β¨ 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 zlaqr5 ( ... ) π
subroutine zlaqr5 (logical WANTT, logical WANTZ, integer KACC22, integer N,
integer KTOP, integer KBOT, integer NSHFTS, complex*16, dimension( * )
S, complex*16, dimension( ldh, * ) H, integer LDH, integer ILOZ, integer
IHIZ, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16,
dimension( ldv, * ) V, integer LDV, complex*16, dimension( ldu, * ) U,
integer LDU, integer NV, complex*16, dimension( ldwv, * ) WV, integer
LDWV, integer NH, complex*16, dimension( ldwh, * ) WH, integer LDWH)
ZLAQR5 performs a single small-bulge multi-shift QR sweep. <sparkle>β¨</sparkle>
π― Purpose:
ZLAQR5, called by ZLAQR0, performs a single small-bulge multi-shift QR sweep. <butterfly>π¦</butterfly>
β¨ Parameters β¨
WANTTisLOGICALβWANTT = .true.if the triangular Schur factor is being computed.WANTTis set to.false.otherwise. πWANTZisLOGICALβWANTZ = .true.if the unitary Schur factor is being computed.WANTZis set to.false.otherwise. πKACC22isINTEGERwith value0,1, or2. Specifies the computation mode of far-from-diagonal orthogonal updates.= 0:ZLAQR5does not accumulate reflections and does not use matrix-matrix multiply to update far-from-diagonal matrix entries.= 1:ZLAQR5accumulates 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 this is no longer supported. β οΈ
NisINTEGERβNis the order of the Hessenberg matrixHupon which this subroutine operates. <sparkle>β¨</sparkle>KTOPisINTEGERβ that's the whole thing π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 eitherKTOP = 1orH(KTOP,KTOP-1) = 0and eitherKBOT = NorH(KBOT+1,KBOT) = 0. πΈNSHFTSisINTEGERβNSHFTSgives the number of simultaneous shifts.NSHFTSmust be positive and even. periodt πSisCOMPLEX*16array, dimension(NSHFTS)βScontains the shifts of origin that define the multi-shift QR sweep. On outputSmay be reordered. <butterfly>π¦</butterfly>HisCOMPLEX*16array, 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. <sparkle>β¨</sparkle>LDHisINTEGERβLDHis the leading dimension ofHjust as declared in the calling procedure.LDH >= MAX(1,N). πILOZisINTEGERβ short and sweet πIHIZisINTEGERβ specify the rows ofZto which transformations must be applied ifWANTZis.TRUE..1 <= ILOZ <= IHIZ <= N. πΈZisCOMPLEX*16array, dimension(LDZ,IHIZ)β ifWANTZ = .TRUE., then the QR Sweep unitary similarity transformation is accumulated intoZ(ILOZ:IHIZ,ILOZ:IHIZ)from the right. IfWANTZ = .FALSE., thenZis unreferenced. <butterfly>π¦</butterfly>LDZisINTEGERβLDAis the leading dimension ofZjust as declared in the calling procedure.LDZ >= N. πVisCOMPLEX*16array, dimension(LDV,NSHFTS/2)β <sparkle>β¨</sparkle>LDVisINTEGERβLDVis the leading dimension ofVas declared in the calling procedure.LDV >= 3. πUisCOMPLEX*16array, dimension(LDU,2*NSHFTS)β <sparkle>β¨</sparkle>LDUisINTEGERβLDUis the leading dimension ofUjust as declared in the in the calling subroutine.LDU >= 2*NSHFTS. πΈNVisINTEGERβNVis the number of rows inWVagailable for workspace.NV >= 1. <butterfly>π¦</butterfly>WVisCOMPLEX*16array, dimension(LDWV,2*NSHFTS)β <sparkle>β¨</sparkle>LDWVisINTEGERβLDWVis the leading dimension ofWVas declared in the in the calling subroutine.LDWV >= NV. πNHisINTEGERβNHis the number of columns in arrayWHavailable for workspace.NH >= 1. πΈWHisCOMPLEX*16array, dimension(LDWH,NH)β <sparkle>β¨</sparkle>LDWHisINTEGERβ leading dimension ofWHjust as declared in the calling procedure.LDWH >= 2*NSHFTS. <butterfly>π¦</butterfly>
π 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 zlaqsb
subroutine zlaqsb (character UPLO, integer N, integer KD, complex*16,
dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * )
S, double precision SCOND, double precision AMAX, character EQUED)
ZLAQSB scales a symmetric/Hermitian band matrix, using scaling factors computed by spbequ. no cap, that's the whole vibe check.
π‘ Purpose:
ZLAQSB equilibrates a symmetric band matrix A using the scaling factors in the vector S. that's it, that's the job π
π Parameters
UPLOβ this one's aCHARACTER*1, and it tells us whether we're storing the upper or the lower triangular part of the symmetric matrix A.= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER, bestie. the order of the matrix A. and like,N >= 0, obviously.KDβINTEGER. this is the number of super-diagonals of A ifUPLO = 'U', or the number of sub-diagonals ifUPLO = 'L'.KD >= 0, always.ABβCOMPLEX*16array, dimension(LDAB,N). okay so on entry, this holds the upper or lower triangle of the symmetric band matrix A, stored in the firstKD+1rows of the array. the j-th column of A lives in the j-th column of AB like this:- 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, you get 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 π¦
LDABβINTEGER. the leading dimension of the array AB.LDAB >= KD+1. do not skimp.SβDOUBLE PRECISIONarray, dimension(N). the scale factors for A β¨SCONDβDOUBLE PRECISION. ratio of the smallestS(i)to the largestS(i). literally just a ratio.AMAXβDOUBLE PRECISION. absolute value of the largest matrix entry. biggest one, periodt.EQUEDβCHARACTER*1. tells you whether or not equilibration happened:= 'N': No equilibration.= 'Y': Equilibration was done, i.e., A has 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 zlaqsp
subroutine zlaqsp (character UPLO, integer N, complex*16, dimension( * ) AP,
double precision, dimension( * ) S, double precision SCOND, double
precision AMAX, character EQUED)
ZLAQSP scales a symmetric/Hermitian matrix in packed storage, using scaling factors computed by sppequ. packed girlies rise π
π‘ Purpose:
ZLAQSP equilibrates a symmetric matrix A using the scaling factors in the vector S. same energy as above, different storage bestie.
π Parameters
UPLOβCHARACTER*1. specifies whether the upper or lower triangular part of the symmetric matrix A is stored.= 'U': Upper triangular= 'L': Lower triangular
NβINTEGER. the order of the matrix A.N >= 0.APβCOMPLEX*16array, dimension(N*(N+1)/2). on entry, this is the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. the j-th column of A sits in the array AP like so:- 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 same storage format as A. she's transformed π
SβDOUBLE PRECISIONarray, dimension(N). the scale factors for A.SCONDβDOUBLE PRECISION. ratio of the smallestS(i)to the largestS(i).AMAXβDOUBLE PRECISION. absolute value of the largest matrix entry.EQUEDβCHARACTER*1. did we equilibrate or not, that is the question:= 'N': No equilibration.= 'Y': Equilibration was done, i.e., A has 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 zlar1v
subroutine zlar1v (integer N, integer B1, integer BN, double precision
LAMBDA, double precision, dimension( * ) D, double precision, dimension(
* ) L, double precision, dimension( * ) LD, double precision, dimension(
* ) LLD, double precision PIVMIN, double precision GAPTOL, complex*16,
dimension( * ) Z, logical WANTNC, integer NEGCNT, double precision ZTZ,
double precision MINGMA, integer R, integer, dimension( * ) ISUPPZ,
double precision NRMINV, double precision RESID, double precision
RQCORR, double precision, dimension( * ) WORK)
ZLAR1V computes the (scaled) r-th column of the inverse of the submatrix in rows b1 through bn of the tridiagonal matrix LDLT - Ξ»I. this is the main character of eigenvector routines, fr fr. π
π‘ Purpose:
ZLAR1V computes the (scaled) r-th column of the inverse of the submatrix 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.
obsessed with this pipeline honestly π«Ά
π Parameters
NβINTEGER. the order of the matrixL D L**T.B1βINTEGER. first index of the submatrix ofL D L**T.BNβINTEGER. last index of the submatrix ofL D L**T.LAMBDAβDOUBLE PRECISION. the shift. in order to compute an accurate eigenvector,LAMBDAshould be a good approximation to an eigenvalue ofL D L**T. so like, be accurate bestie.LβDOUBLE PRECISIONarray, dimension(N-1). the(n-1)subdiagonal elements of the unit bidiagonal matrix L, in elements 1 toN-1.DβDOUBLE PRECISIONarray, dimension(N). the n diagonal elements of the diagonal matrix D.LDβDOUBLE PRECISIONarray, dimension(N-1). then-1elementsL(i)*D(i).LLDβDOUBLE PRECISIONarray, dimension(N-1). then-1elementsL(i)*L(i)*D(i).PIVMINβDOUBLE PRECISION. the minimum pivot in the Sturm sequence.GAPTOLβDOUBLE PRECISION. tolerance that indicates when eigenvector entries are negligible w.r.t. their contribution to the residual.ZβCOMPLEX*16array, dimension(N). on input, all entries of Z must be set to 0 β not even joking, zero them all. on output, Z contains the (scaled) r-th column of the inverse. the scaling is such thatZ(R)equals 1. πWANTNCβLOGICAL. specifies whetherNEGCNThas to be computed.NEGCNTβINTEGER. ifWANTNCis.TRUE.thenNEGCNT= the number of pivots <pivminin the matrix factorizationL D L**T, andNEGCNT = -1otherwise.ZTZβDOUBLE PRECISION. the square of the 2-norm of Z.MINGMAβDOUBLE PRECISION. the reciprocal of the largest (in magnitude) diagonal element of the inverse ofL D L**T - sigma I.RβINTEGER. the twist index for the twisted factorization used to compute Z.- on input,
0 <= R <= N. if R is input as 0, R is set to the index where(L D L**T - sigma I)^{-1}is largest in magnitude. if1 <= R <= N, R is unchanged. - on output, R contains the twist index used to compute Z. ideally, R designates the position of the maximum entry in the eigenvector.
- on input,
ISUPPZISUPPZβINTEGER array, dimension (2)The support of the vector inZ, i.e., the vectorZis nonzero only in elementsISUPPZ(1)throughISUPPZ( 2 ). that's the β¨zoneβ¨ where stuff actually happens, bestieNRMINVβDOUBLE PRECISIONNRMINV = 1/SQRT( ZTZ )RESIDβDOUBLE PRECISIONThe residual of the FP vector.RESID = ABS( MINGMA )/SQRT( ZTZ )RQCORRβDOUBLE PRECISIONThe Rayleigh Quotient correction toLAMBDA.RQCORR = MINGMA*TMPWORKβDOUBLE PRECISION 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 zlar2v
subroutine zlar2v (integer N, complex*16, dimension( * ) X, complex*16,
dimension( * ) Y, complex*16, dimension( * ) Z, integer INCX, double
precision, dimension( * ) C, complex*16, dimension( * ) S, integer INCC)
ZLAR2V 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.
π― Purpose:
ZLAR2V 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βINTEGERThe number of plane rotations to be applied.XβCOMPLEX*16 array, dimension (1+(N-1)*INCX)The vectorx; the elements ofxare assumed to be real.YβCOMPLEX*16 array, dimension (1+(N-1)*INCX)The vectory; the elements ofyare assumed to be real.ZβCOMPLEX*16 array, dimension (1+(N-1)*INCX)The vectorz.INCXβINTEGERThe increment between elements ofX,YandZ.INCX > 0.CβDOUBLE PRECISION array, dimension (1+(N-1)*INCC)The cosines of the plane rotations.SβCOMPLEX*16 array, dimension (1+(N-1)*INCC)The sines of the plane rotations.INCCβINTEGERThe increment between elements ofCandS.INCC > 0.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zlarcm
subroutine zlarcm (integer M, integer N, double precision, dimension( lda, *
) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB,
complex*16, dimension( ldc, * ) C, integer LDC, double precision,
dimension( * ) RWORK)
ZLARCM copies all or part of a real two-dimensional array to a complex array.
π― Purpose:
ZLARCM 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.
yes it's literally just C := A * B. no cap, it's giving "do the bare minimum and do it well" π
π Parameters
MβINTEGERThe number of rows of the matrixAand of the matrixC.M >= 0.NβINTEGERThe number of columns and rows of the matrixBand the number of columns of the matrixC.N >= 0.AβDOUBLE PRECISION array, dimension (LDA, M)On entry,Acontains theMbyMmatrixA.LDAβINTEGERThe leading dimension of the arrayA.LDA >=max(1,M).BβCOMPLEX*16 array, dimension (LDB, N)On entry,Bcontains theMbyNmatrixB.LDBβINTEGERThe leading dimension of the arrayB.LDB >=max(1,M).CβCOMPLEX*16 array, dimension (LDC, N)On exit,Ccontains theMbyNmatrixC.LDCβINTEGERThe leading dimension of the arrayC.LDC >=max(1,M).RWORKβDOUBLE PRECISION array, dimension (2*M*N)
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ subroutine zlarf
subroutine zlarf (character SIDE, integer M, integer N, complex*16,
dimension( * ) V, integer INCV, complex*16 TAU, complex*16, dimension(
ldc, * ) C, integer LDC, complex*16, dimension( * ) WORK)
ZLARF applies an elementary reflector to a general rectangular matrix.
π― Purpose:
ZLARF 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, supply conjg(tau) instead
tau.
π Parameters
SIDEβCHARACTER*1= 'L': formH * C= 'R': formC * H
MβINTEGERThe number of rows of the matrixC.NβINTEGERThe number of columns of the matrixC.VβCOMPLEX*16 array, dimension
(1 + (M-1)*abs(INCV)) if SIDE = 'L'
or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
The vector v in the representation of H. V is not used if TAU = 0.
INCVβINTEGERThe increment between elements ofv.INCV <> 0.TAUβCOMPLEX*16The valuetauin the representation ofH.CβCOMPLEX*16 array, dimension (LDC,N)On entry, theM-by-NmatrixC. On exit,Cis overwritten by the matrixH * CifSIDE = 'L', orC * HifSIDE = 'R'.LDCβINTEGERThe leading dimension of the arrayC.LDC >= max(1,M).WORKβCOMPLEX*16 array, dimension
(N) if SIDE = 'L'
or (M) if SIDE = 'R'
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π§ subroutine zlarfb
subroutine zlarfb (character SIDE, character TRANS, character DIRECT,
character STOREV, integer M, integer N, integer K, complex*16,
dimension( ldv, * ) V, integer LDV, complex*16, dimension( ldt, * ) T,
integer LDT, complex*16, dimension( ldc, * ) C, integer LDC, complex*16,
dimension( ldwork, * ) WORK, integer LDWORK)
ZLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix.
π― Purpose:
ZLARFB 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βCHARACTER*1= 'L': applyHorH**Hfrom the Left= 'R': applyHorH**Hfrom the Right
TRANSβCHARACTER*1= 'N': applyH(No transpose)= 'C': applyH**H(Conjugate transpose)
DIRECTβCHARACTER*1Indicates 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βCHARACTER*1Indicates how the vectors which define the elementary reflectors are stored:= 'C': Columnwise= 'R': Rowwise
MβINTEGERThe number of rows of the matrixC.NβINTEGERThe number of columns of the matrixC.KβINTEGERThe 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βCOMPLEX*16 array, dimension
(LDV,K) if STOREV = 'C'
(LDV,M) if STOREV = 'R' and SIDE = 'L'
(LDV,N) if STOREV = 'R' and SIDE = 'R'
See Further Details.
LDVβINTEGERThe 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βCOMPLEX*16 array, dimension (LDT,K)The triangularK-by-KmatrixTin the representation of the block reflector.LDTβINTEGERThe leading dimension of the arrayT.LDT >= K.CβCOMPLEX*16 array, dimension (LDC,N)On entry, theM-by-NmatrixC. On exit,Cis overwritten byH*CorH**H*CorC*HorC*H**H.LDCβINTEGERThe leading dimension of the arrayC.LDC >= max(1,M).WORKβCOMPLEX*16 array, dimension (LDWORK,K)LDWORKβINTEGERThe leading dimension of the arrayWORK. IfSIDE = 'L',LDWORK >= max(1,N); ifSIDE = 'R',LDWORK >= 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.
and the actual diagram of all that? bestie it's right around the cornerβ¦ π
β¦so bestie, picking up right where we left off β here's literally what V looks like in each of the four DIRECT / STOREV flavours π
:
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 )
π¦ zlarfb_gett β the subroutine
subroutine zlarfb_gett (character IDENT, integer M, integer N, integer K,
complex*16, dimension( ldt, * ) T, integer LDT, complex*16, dimension(
lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB,
complex*16, dimension( ldwork, * ) WORK, integer LDWORK)
ZLARFB_GETT
β¨ Purpose
Okay so ZLARFB_GETT takes a complex Householder block reflector H and applies it from the left to a complex (K+M)-by-N 'triangular-pentagonal' matrix, which is genuinely just two block matrices glued together: an upper trapezoidal K-by-N matrix A sitting in the array A, and a rectangular M-by-(N-K) matrix B chilling in the array B. The block reflector H lives in a compact WY-representation, where the elementary reflectors are hanging out in the arrays A, B and T. Scroll down to the Further Details section for the full tea β.
π Parameters
IDENTβIDENTisCHARACTER*1. IfIDENT= not'I', or not'i', thenV1is unit lower-triangular and stored in the left K-by-K block of the input matrixA. IfIDENT='I'or'i', thenV1is an identity matrix and not stored. Peep the Further Details section for the whole picture π.MβMisINTEGER. The number of rows of the matrixB.M >= 0.NβNisINTEGER. The number of columns of the matricesAandB.N >= 0.KβKisINTEGER. The number or rows of the matrixA.Kis also order of the matrixT, i.e. the number of elementary reflectors whose product defines the block reflector.0 <= K <= N.TβTisCOMPLEX*16array, dimension(LDT,K). The upper-triangular K-by-K matrixTin the representation of the block reflector.LDTβLDTisINTEGER. The leading dimension of the arrayT.LDT >= K.AβAisCOMPLEX*16array, dimension(LDA,N).- On entry:
- In the K-by-N upper-trapezoidal part
A: input matrixA. - In the columns below the diagonal: columns of
V1(ones are not stored on the diagonal).
- In the K-by-N upper-trapezoidal part
- On exit:
Ais overwritten by rectangular K-by-N productH*A. - See Further Details section π«Ά.
- On entry:
LDAβLDBisINTEGER. The leading dimension of the arrayA.LDA >= max(1,K).
bestie yes, it literally says LDB in the source, we're not touching it, it's canon π
BβBisCOMPLEX*16array, dimension(LDB,N).- On entry:
- In the M-by-(N-K) right block: input matrix
B. - In the M-by-N left block: columns of
V2.
- In the M-by-(N-K) right block: input matrix
- On exit:
Bis overwritten by rectangular M-by-N productH*B. - See Further Details section πΈ.
- On entry:
LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).WORKβWORKisCOMPLEX*16array, dimension(LDWORK,max(K,N-K)).LDWORKβLDWORKisINTEGER. The leading dimension of the arrayWORK.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',V1is a K-by-K identity matrix, not stored; - if
IDENT != 'I',V1is a K-by-K unit 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 arrayWORKonly of sizeWORK(1:K,1:max(K,N-K))so it can hold bothW2from the first step andW1from the second step. Iconic efficiency honestly β¨
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)
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
Combine these cases (A) and (B) together, this is the resulting
algorithm:
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
zlarfg β¨
subroutine zlarfg (integer N, complex*16 ALPHA, complex*16, dimension( * ) X, integer INCX, complex*16 TAU)
ZLARFG generates an elementary reflector (Householder matrix). π
Purpose:
bestie, this one builds 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. π
If the elements of x are all zero and alpha is real, then tau = 0 and H is taken to be the unit matrix. no notes, iconic behaviour β¨
Otherwise 1 <= real(tau) <= 2 and abs(tau-1) <= 1. π«Ά
Parameters
NβNisINTEGER. The order of the elementary reflector.ALPHAβALPHAisCOMPLEX*16. On entry, the valuealpha. On exit, it is overwritten with the valuebeta.XβXisCOMPLEX*16array, dimension(1+(N-2)*abs(INCX)). On entry, the vectorx. On exit, it is overwritten with the vectorv.INCXβINCXisINTEGER. The increment between elements ofX.INCX > 0.TAUβTAUisCOMPLEX*16. The valuetau.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
zlarfgp πΈ
subroutine zlarfgp (integer N, complex*16 ALPHA, complex*16, dimension( * ) X, integer INCX, complex*16 TAU)
ZLARFGP generates an elementary reflector (Householder matrix) with non-negative beta. π
Purpose:
same energy as zlarfg but the beta comes out non-negative, periodt. ZLARFGP 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βNisINTEGER. The order of the elementary reflector.ALPHAβALPHAisCOMPLEX*16. On entry, the valuealpha. On exit, it is overwritten with the valuebeta.XβXisCOMPLEX*16array, dimension(1+(N-2)*abs(INCX)). On entry, the vectorx. On exit, it is overwritten with the vectorv.INCXβINCXisINTEGER. The increment between elements ofX.INCX > 0.TAUβTAUisCOMPLEX*16. The valuetau.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
zlarft π¦
subroutine zlarft (character DIRECT, character STOREV, integer N, integer K, complex*16, dimension( ldv, * ) V, integer LDV, complex*16, dimension( * ) TAU, complex*16, dimension( ldt, * ) T, integer LDT)
ZLARFT forms the triangular factor T of a block reflector H = I - vtvH β
Purpose:
ZLARFT 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βDIRECTisCHARACTER*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βSTOREVisCHARACTER*1. Specifies how the vectors which define the elementary reflectors are stored (see also Further Details):= 'C': columnwise= 'R': rowwise
NβNisINTEGER. The order of the block reflectorH.N >= 0.KβKisINTEGER. The order of the triangular factorT(= the number of elementary reflectors).K >= 1.VβVisCOMPLEX*16array, dimension(LDV,K)ifSTOREV = 'C',(LDV,N)ifSTOREV = 'R'. The matrixV. See further details.LDVβLDVisINTEGER. The leading dimension of the arrayV. IfSTOREV = 'C',LDV >= max(1,N); ifSTOREV = 'R',LDV >= K.TAUβTAUisCOMPLEX*16array, dimension(K).TAU(i)must contain the scalar factor of the elementary reflectorH(i).TβTisCOMPLEX*16array, dimension(LDT,K). Thekbyktriangular factorTof the block reflector. IfDIRECT = 'F',Tis upper triangular; ifDIRECT = 'B',Tis lower triangular. The rest of the array is not used.LDTβLDTisINTEGER. 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 )
zlarfx π
subroutine zlarfx (character SIDE, integer M, integer N, complex*16, dimension( * ) V, complex*16 TAU, complex*16, dimension( ldc, * ) C, integer LDC, complex*16, dimension( * ) WORK)
ZLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the reflector has order β€ 10. π€
Purpose:
ZLARFX 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β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*16array, dimension(M)ifSIDE = 'L'or(N)ifSIDE = 'R'. The vectorvin the representation ofH.TAUβTAUisCOMPLEX*16. The valuetauin the representation ofH.CβCisCOMPLEX*16array, dimension(LDC,N). On entry, thembynmatrixC. 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
WORK is COMPLEX*16 array, dimension (N) if SIDE = 'L' or (M) if SIDE = 'R'. And bestie, WORK is not referenced if H has order < 11.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ subroutine zlarfy β¨
subroutine zlarfy (character UPLO, integer N, complex*16, dimension( * ) V,
integer INCV, complex*16 TAU, complex*16, dimension( ldc, * ) C, integer
LDC, complex*16, dimension( * ) WORK)
ZLARFY
Purpose:
Okay so ZLARFY is giving main character energy: it applies an elementary reflector (aka Householder matrix) H to an n x n Hermitian matrix C, and it does it from both the left and the right. Slay.
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. Periodt.
Parameters
UPLOβUPLOis aCHARACTER*1. It tells us whether we're storing the upper or lower triangular part of that Hermitian matrixC.= 'U': upper triangle,= 'L': lower triangle. No in-between, bestie.NβNis anINTEGER. The number of rows and columns of the matrixC.N >= 0.VβVis aCOMPLEX*16array, dimension(1 + (N-1)*abs(INCV)). The vectorvas described above. <sparkles>β¨</sparkles>INCVβINCVis anINTEGER. The increment between successive elements ofv.INCVmust not be zero. Do not let it be zero, fr fr.TAUβTAUis aCOMPLEX*16. The valuetauas described above.CβCis aCOMPLEX*16array, dimension(LDC, N). On entry, the matrixC. On exit,Cis overwritten byH * C * H'. She's changed.LDCβLDCis anINTEGER. The leading dimension of the arrayC.LDC >= max( 1, N ).WORKβWORKis aCOMPLEX*16array, dimension(N).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ subroutine zlargv β¨
subroutine zlargv (integer N, complex*16, dimension( * ) X, integer INCX,
complex*16, dimension( * ) Y, integer INCY, double precision, dimension(
* ) C, integer INCC)
ZLARGV generates a vector of plane rotations with real cosines and complex sines. iykyk
Purpose:
ZLARGV 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 ZLARTG, but differ from the BLAS1 routine ZROTG):
- 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βNis anINTEGER. The number of plane rotations to be generated.XβXis aCOMPLEX*16array, dimension(1+(N-1)*INCX). On entry, the vectorx. On exit,x(i)is overwritten byr(i), fori = 1,...,n. Plot twist.INCXβINCXis anINTEGER. The increment between elements ofX.INCX > 0.YβYis aCOMPLEX*16array, dimension(1+(N-1)*INCY). On entry, the vectory. On exit, the sines of the plane rotations.INCYβINCYis anINTEGER. The increment between elements ofY.INCY > 0.CβCis aDOUBLE PRECISIONarray, dimension(1+(N-1)*INCC). The cosines of the plane rotations.INCCβINCCis anINTEGER. The increment between elements ofC.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.
β¨ subroutine zlarnv β¨
subroutine zlarnv (integer IDIST, integer, dimension( 4 ) ISEED, integer N,
complex*16, dimension( * ) X)
ZLARNV returns a vector of random numbers from a uniform or normal distribution. Random girlypop behavior.
Purpose:
ZLARNV returns a vector of n random complex numbers from a uniform or normal distribution.
Parameters
IDISTβIDISTis anINTEGER. 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βISEEDis anINTEGERarray, dimension(4). On entry, the seed of the random number generator; the array elements must be between0and4095, andISEED(4)must be odd. On exit, the seed is updated. Respect the seed rules, no cap.NβNis anINTEGER. The number of random numbers to be generated.XβXis aCOMPLEX*16array, 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 DLARUV 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.
β¨ subroutine zlarrv β¨
subroutine zlarrv (integer N, double precision VL, double precision VU,
double precision, dimension( * ) D, double precision, dimension( * ) L,
double precision PIVMIN, integer, dimension( * ) ISPLIT, integer M,
integer DOL, integer DOU, double precision MINRGP, double precision
RTOL1, double precision RTOL2, double precision, dimension( * ) W,
double precision, dimension( * ) WERR, double precision, dimension( * )
WGAP, integer, dimension( * ) IBLOCK, integer, dimension( * ) INDEXW,
double precision, dimension( * ) GERS, complex*16, dimension( ldz, * )
Z, integer LDZ, integer, dimension( * ) ISUPPZ, double precision,
dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
ZLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues of L D LT.
Purpose:
ZLARRV 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 DLARRE. So make sure you ran that first, bestie.
Parameters
NβNis anINTEGER. The order of the matrix.N >= 0.VLβVLis aDOUBLE PRECISION. 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βVUis aDOUBLE PRECISION. 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βDis aDOUBLE PRECISIONarray, dimension(N). On entry, theNdiagonal elements of the diagonal matrixD. On exit,Dmay be overwritten. She may not survive.LβLis aDOUBLE PRECISIONarray, dimension(N). On entry, the(N-1)subdiagonal elements of the unit bidiagonal matrixLare in elements1toN-1ofL(if the matrix is not split.) At the end of each block is stored the corresponding shift as given byDLARRE. On exit,Lis overwritten.PIVMINβPIVMINis aDOUBLE PRECISION. The minimum pivot allowed in the Sturm sequence.ISPLITβISPLITis anINTEGERarray, dimension(N). The splitting points, at whichTbreaks up into blocks. The first block consists of rows/columns1toISPLIT( 1 ), the second of rows/columnsISPLIT( 1 )+1throughISPLIT( 2 ), etc.MβMis anINTEGER. The total number of input eigenvalues.0 <= M <= N.DOLβDOLis anINTEGER.DOUβDOUis anINTEGER. If the user wants to compute only selected eigenvectors from all the eigenvalues supplied, he can specify an index rangeDOL:DOU. Or else the settingDOL=1,DOU=Mshould be applied. Note thatDOLandDOUrefer to the order in which the eigenvalues are stored inW. If the user wants to compute only selected eigenpairs, then the columnsDOL-1toDOU+1of the eigenvector spaceZcontain the computed eigenvectors. All other columns ofZare set to zero.MINRGPβMINRGPis aDOUBLE PRECISION.RTOL1βRTOL1is aDOUBLE PRECISION.RTOL2βRTOL2is aDOUBLE PRECISION. Parameters for bisection. An interval[LEFT,RIGHT]has converged ifRIGHT-LEFT < MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) ).WβWis aDOUBLE PRECISIONarray, dimension(N). The firstMelements ofWcontain the APPROXIMATE eigenvalues for which eigenvectors are to be computed. The eigenvalues should be grouped by split-off block and ordered from smallest to largest within the block ( The output arrayWfromDLARREis expected here ). 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.WERRβWERRis aDOUBLE PRECISIONarray, dimension(N). The firstMelements contain the semiwidth of the uncertainty interval of the corresponding eigenvalue inWWGAPβWGAPis aDOUBLE PRECISIONarray, dimension(N). The separation from the right neighbor eigenvalue inW.IBLOCKβ
IBLOCK
IBLOCK is an INTEGER array, dimension (N). It's the block (submatrix) index for each eigenvalue in W β like IBLOCK(i)=1 if eigenvalue W(i) belongs to the first block from the top, =2 if W(i) belongs to the second block, etc. Block party energy, but make it numerical. π
INDEXW
INDEXW is an INTEGER array, dimension (N). These are the indices of the eigenvalues within each block (submatrix). So if INDEXW(i)= 10 and IBLOCK(i)=2, that means the i-th eigenvalue W(i) is the 10-th eigenvalue in the second block. Precision is the vibe. β¨
GERS
GERS is a DOUBLE PRECISION array, dimension (2*N). It holds the N Gerschgorin intervals, where the i-th Gerschgorin interval is (GERS(2*i-1), GERS(2*i)). Important: these intervals should be computed from the original UNshifted matrix. Do not shift, bestie. π«
Z
Z is a COMPLEX*16 array, dimension (LDZ, max(1,M) ). If INFO = 0, the first M columns of Z contain the orthonormal eigenvectors of the matrix T corresponding to the input eigenvalues, with the i-th column of Z holding the eigenvector associated with W(i). Note: you must ensure that at least max(1,M) columns are supplied in the array Z. No cap. π
LDZ
LDZ is INTEGER. It's the leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', then LDZ >= max(1,N). Rules are rules.
ISUPPZ
ISUPPZ is an INTEGER array, dimension ( 2*max(1,M) ). It's the support of the eigenvectors in Z, i.e., the indices indicating the nonzero elements in Z. The I-th eigenvector is nonzero only in elements ISUPPZ( 2*I-1 ) through ISUPPZ( 2*I ). Supportive queen. π«Ά
WORK
WORK is a DOUBLE PRECISION array, dimension (12*N). That's a lot of workspace, but she's worth it.
IWORK
IWORK is an INTEGER array, dimension (7*N). Integer energy.
INFO
INFO is INTEGER. Here's the tea:
= 0: successful exit β¨> 0: a problem occurred inZLARRV. Uh oh.< 0: one of the called subroutines signaled an internal problem. Needs inspection of the corresponding parameterIINFOfor further information.=-1: problem inDLARRBwhen refining a child's eigenvalues.=-2: problem inDLARRFwhen 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. Trade-offs, bestie.=-3: problem inDLARRBwhen refining a single eigenvalue after the Rayleigh correction was rejected.= 5: the Rayleigh Quotient Iteration failed to converge to full accuracy inMAXITRsteps. Not slay.
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 zlartv
subroutine zlartv (integer N, complex*16, dimension( * ) X, integer INCX,
complex*16, dimension( * ) Y, integer INCY, double precision, dimension(
* ) C, complex*16, dimension( * ) S, integer INCC)
ZLARTV applies a vector of plane rotations with real cosines and complex sines to the elements of a pair of vectors. Rotation nation. π
Purpose:
ZLARTV 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βNisINTEGER. The number of plane rotations to be applied.XβXisCOMPLEX*16array, dimension(1+(N-1)*INCX). The vector x.INCXβINCXisINTEGER. The increment between elements of X.INCX > 0.YβYisCOMPLEX*16array, dimension(1+(N-1)*INCY). The vector y.INCYβINCYisINTEGER. The increment between elements of Y.INCY > 0.CβCisDOUBLE PRECISIONarray, dimension(1+(N-1)*INCC). The cosines of the plane rotations.SβSisCOMPLEX*16array, dimension(1+(N-1)*INCC). The sines of the plane rotations.INCCβINCCisINTEGER. 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 zlascl
subroutine zlascl (character TYPE, integer KL, integer KU, double precision
CFROM, double precision CTO, integer M, integer N, complex*16,
dimension( lda, * ) A, integer LDA, integer INFO)
ZLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom. Scaling realness.
Purpose:
ZLASCL 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βTYPEisCHARACTER*1.TYPEindices the storage type of the input matrix.= 'G':Ais a full matrix.= 'L':Ais a lower triangular matrix.= 'U':Ais an upper triangular matrix.= 'H':Ais an upper Hessenberg matrix.= 'B':Ais a symmetric band matrix with lower bandwidthKLand upper bandwidthKUand with the only the lower half stored.= 'Q':Ais a symmetric band matrix with lower bandwidthKLand upper bandwidthKUand with the only the upper half stored.= 'Z':Ais a band matrix with lower bandwidthKLand upper bandwidthKU. SeeZGBTRFfor storage details.
KLβKLisINTEGER. The lower bandwidth ofA. Referenced only ifTYPE = 'B','Q'or'Z'.KUβKUisINTEGER. The upper bandwidth ofA. Referenced only ifTYPE = 'B','Q'or'Z'.CFROMβCFROMisDOUBLE PRECISION.CTOβCTOisDOUBLE PRECISION. 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βMisINTEGER. The number of rows of the matrixA.M >= 0.NβNisINTEGER. The number of columns of the matrixA.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). The matrix to be multiplied byCTO/CFROM. SeeTYPEfor the storage type.LDAβLDAisINTEGER. The leading dimension of the arrayA. IfTYPE = '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βINFOisINTEGER.0- successful exit<0- ifINFO = -i, the i-th argument had an illegal value.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zlaset
subroutine zlaset (character UPLO, integer M, integer N, complex*16 ALPHA,
complex*16 BETA, complex*16, dimension( lda, * ) A, integer LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values. Set it off.
Purpose:
ZLASET initializes a 2-D array A to BETA on the diagonal and ALPHA on the offdiagonals.
Parameters
UPLOβUPLOisCHARACTER*1. Specifies the part of the matrixAto 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
Ais set.
MβMisINTEGER. On entry,Mspecifies the number of rows ofA.NβNisINTEGER. On entry,Nspecifies the number of columns ofA.ALPHAβALPHAisCOMPLEX*16. All the offdiagonal array elements are set toALPHA.BETAβBETAisCOMPLEX*16. All the diagonal array elements are set toBETA.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, thembynmatrixA. 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β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.
subroutine zlasr
subroutine zlasr (character SIDE, character PIVOT, character DIRECT, integer
M, integer N, double precision, dimension( * ) C, double precision,
dimension( * ) S, complex*16, dimension( lda, * ) A, integer LDA)
ZLASR applies a sequence of plane rotations to a general rectangular matrix. Rotation sequence, but make it fashion. π
Purpose:
ZLASR applies a sequence of real plane rotations to a complex matrix A, from either the left or the right.
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 made of a whole sequence of z plane rotations, with z = M when SIDE = 'L' and z = N when SIDE = 'R', and P**T is just the transpose of P. slay.
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. it's giving "small little tweak, big consequences" π
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 the whole time, the rotations are performed without ever forming P(k) explicitly. no cap, that's the whole flex. π₯
Parameters
SIDEβSIDE is CHARACTER*1. tells us whether the plane rotation matrix P gets applied to A on the left or on the right.= 'L': Left, computeA := P*A= 'R': Right, computeA:= A*P**T
PIVOTβPIVOT is CHARACTER*1. tells us which plane P(k) is a plane rotation matrix for.= 'V': Variable pivot, the plane (k,k+1)= 'T': Top pivot, the plane (1,k+1)= 'B': Bottom pivot, the plane (k,z)
DIRECTβDIRECT is CHARACTER*1. is P a forward or a backward sequence of plane rotations?MβM is INTEGER. the number of rows of the matrix A. Ifm <= 1, an immediate return is effected (like, we're out, bye π«Ά).NβN is INTEGER. the number of columns of the matrix A. Ifn <= 1, an immediate return is effected (same energy, immediate exit).CβC is DOUBLE PRECISION array, dimension(M-1) if SIDE = 'L',(N-1) if SIDE = 'R'. the cosinesc(k)of the plane rotations. β¨SβS is DOUBLE PRECISION array, dimension(M-1) if SIDE = 'L',(N-1) if SIDE = 'R'. the siness(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βA is COMPLEX*16 array, dimension(LDA,N). the M-by-N matrix A. On exit, A is overwritten byP*AifSIDE = 'R'or byA*P**TifSIDE = 'L'.LDAβLDA is 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.
π¦ subroutine zlaswp (integer N, complex*16, dimension( lda, * ) A, integer LDA, integer K1, integer K2, integer, dimension( * ) IPIV, integer INCX)
ZLASWP performs a series of row interchanges on a general rectangular matrix. swapping era, honestly. π
Purpose:
ZLASWP performs a series of row interchanges on the matrix A.
One row interchange is initiated for each of rows K1 through K2 of A.
Parameters
NβN is INTEGER. the number of columns of the matrix A.AβA is COMPLEX*16 array, dimension(LDA,N). On entry, the matrix of column dimension N to which the row interchanges will be applied. On exit, the permuted matrix. glow up achieved. πLDAβLDA is INTEGER. the leading dimension of the array A.K1βK1 is INTEGER. the first element of IPIV for which a row interchange will be done.K2βK2 is INTEGER.(K2-K1+1)is the number of elements of IPIV for which a row interchange will be done.IPIVβIPIV is INTEGER array, dimension(K1+(K2-K1)*abs(INCX)). the vector of pivot indices. Only the elements in positionsK1throughK1+(K2-K1)*abs(INCX)of IPIV are accessed.IPIV(K1+(K-K1)*abs(INCX)) = Limplies rowsKandLare to be interchanged.INCXβINCX is INTEGER. the increment between successive values of IPIV. If INCX is negative, the pivots are applied in reverse order. π
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
π subroutine zlat2c (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex, dimension( ldsa, * ) SA, integer LDSA, integer INFO)
ZLAT2C converts a double complex triangular matrix to a complex triangular matrix. downgrade the precision, keep the drama. β¨
Purpose:
ZLAT2C converts a COMPLEX*16 triangular matrix, SA, to a COMPLEX
triangular matrix, A.
RMAX is the overflow for the SINGLE PRECISION arithmetic
ZLAT2C checks that all the entries of A are between -RMAX and
RMAX. If not the conversion is aborted and a flag is raised.
This is an auxiliary routine so there is no argument checking.
lowkey important: if any entry is outside the-RMAXβ¦RMAXrange, the conversion is aborted and a flag is raised. no argument checking here, bestie, it trusts you. π«Ά
Parameters
UPLOβUPLO is CHARACTER*1.= 'U': A is upper triangular;= 'L': A is lower triangular.
NβN is INTEGER. the number of rows and columns of the matrix A.N >= 0.AβA is COMPLEX*16 array, dimension(LDA,N). On entry, the N-by-N triangular coefficient matrix A.LDAβLDA is INTEGER. the leading dimension of the array A.LDA >= max(1,N).SAβSA is COMPLEX array, dimension(LDSA,N). Only the UPLO part of SA is referenced. On exit, ifINFO=0, the N-by-N coefficient matrix SA; ifINFO>0, the content of the UPLO part of SA is unspecified. (mystery box vibes, we just don't know π)LDSAβLDSA is INTEGER. the leading dimension of the array SA.LDSA >= max(1,M).INFOβINFO is INTEGER.= 0: successful exit.= 1: an entry of the matrix A is greater than the SINGLE PRECISION overflow threshold, in this case, the content of the UPLO part of SA in exit is unspecified.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zlatbs (character UPLO, character TRANS, character DIAG, character NORMIN, integer N, integer KD, complex*16, dimension( ldab, * ) AB, integer LDAB, complex*16, dimension( * ) X, double precision SCALE, double precision, dimension( * ) CNORM, integer INFO)
ZLATBS solves a triangular banded system of equations. scaling included so nothing overflows, periodt. π
Purpose:
ZLATBS 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 ZTBSV 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.
so iconic: if A is singular (A(j,j) = 0for some j), thensgets set to0and a non-trivial solution toA*x = 0comes back. that's the plot twist. π
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 and it's lowkey just a vibe check for CNORM π
β it tells us whether the column norms are already loaded or whether we gotta go get them ourselves.
= '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 and it's the order of the matrix A, bestie. N >= 0. No negative orders, that's not a thing, periodt.
KD
KD is INTEGER β the number of subdiagonals or superdiagonals in the triangular matrix A. KD >= 0. So basically how wide the band is, iykyk.
AB
AB is COMPLEX*16 array, dimension (LDAB,N). It's the upper or lower triangular 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).
Copy those indices exactly, bestie, they are NOT vibes-based πΈ
LDAB
LDAB is INTEGER β the leading dimension of the array AB. LDAB >= KD+1. Respect the leading dimension or perish π
X
X is COMPLEX*16 array, dimension (N).
- On entry: the right hand side
bof the triangular system. - On exit:
Xis overwritten by the solution vectorx. She gets a whole glow-up in place π
SCALE
SCALE is DOUBLE PRECISION β 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. So like, zero scale is the "we could not do it, here's the null-space instead" energy π«
CNORM
CNORM is DOUBLE PRECISION array, dimension (N).
If NORMIN = 'Y', CNORM is an input argument and CNORM(j) contains the norm of the off-diagonal part of the j-th column of A. If TRANS = 'N', CNORM(j) must be greater than or equal to the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) must be greater than or equal to the 1-norm.
If NORMIN = 'N', CNORM is an output argument and CNORM(j) returns the 1-norm of the offdiagonal part of the j-th column of A.
So she switches from input girlie to output girlie depending on NORMIN. Main character energy, honestly π
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, ZTBSV is called, otherwise, specific code is used which checks for possible overflow or divide-by-zero at every operation. Safety girlie behavior fr fr π§
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 ZTBSV 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. Bestie that's the "we gave up and found the null vector instead" arc π
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 ZTBSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow).
β¨ subroutine zlatdf β¨
subroutine zlatdf (integer IJOB, integer N, complex*16, dimension( ldz, * )
Z, integer LDZ, complex*16, dimension( * ) RHS, double precision RDSUM,
double precision RDSCAL, integer, dimension( * ) IPIV, integer,
dimension( * ) JPIV)
ZLATDF uses the LU factorization of the n-by-n matrix computed by sgetc2 and computes a contribution to the reciprocal Dif-estimate. She's a specialist, okay, she does one thing and she does it beautifully π
Purpose:
ZLATDF 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 ZGETC2. On entry RHS = f holds the contribution from earlier solved sub-systems, and on return RHS = x.
The factorization of Z returned by ZGETC2 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-vectoreofZusingZGECON,eis normalized and solve forZx = +-e - fwith the sign giving the greater value of 2-norm(x). About 5 times as expensive as Default. Yeah bestie, that's the deluxe version, it costs π«ΆIJOB .ne. 2: Local look ahead strategy where all entries of the r.h.s.bis chosen as either+1or-1. Default. This is the "we move" option.
N
N is INTEGER β the number of columns of the matrix Z.
Z
Z is COMPLEX*16 array, dimension (LDZ, N). On entry, the LU part of the factorization of the n-by-n matrix Z computed by ZGETC2: Z = P * L * U * Q
LDZ
LDZ is INTEGER β the leading dimension of the array Z. LDA >= max(1, N).
Yes, she saysLDAin a routine where the arg is literally calledLDZ. We are keeping it exactly as written, no notes π
RHS
RHS is COMPLEX*16 array, dimension (N).
- On entry,
RHScontains contributions from other subsystems. - On exit,
RHScontains the solution of the subsystem with entries according to the value ofIJOB(see above).
RDSUM
RDSUM is DOUBLE PRECISION
- On entry, the sum of squares of computed contributions to the Dif-estimate under computation by
ZTGSYL, where the scaling factorRDSCAL(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'RDSUMis not touched. NOTE:RDSUMonly makes sense whenZTGSY2is called byCTGSYL.
RDSCAL
RDSCAL is DOUBLE PRECISION
- On entry, scaling factor used to prevent overflow in
RDSUM. - On exit,
RDSCALis updated w.r.t. the current contributions inRDSUM. - If
TRANS = 'T',RDSCALis not touched. NOTE:RDSCALonly makes sense whenZTGSY2is called byZTGSYL.
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 zlatps π
subroutine zlatps (character UPLO, character TRANS, character DIAG,
character NORMIN, integer N, complex*16, dimension( * ) AP, complex*16,
dimension( * ) X, double precision SCALE, double precision, dimension( *
) CNORM, integer INFO)
ZLATPS solves a triangular system of equations with the matrix held in packed storage. Packed, bestie β no wasted space, she's efficient π
Purpose:
ZLATPS 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 ZTPSV 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 literally refuses to overflow, iconic πΈ
Parameters
UPLO
UPLOβUPLO is CHARACTER*1. Okay so this literally 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': CNORM contains the column norms on entry= 'N': CNORM is not set on entry. On exit, the norms will be computed and stored in CNORM.
NβN is INTEGER. The order of the matrix A.N >= 0. πΈAPβAP is COMPLEX*16 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.
- if
XβX is COMPLEX*16 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 is DOUBLE PRECISION. 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.
CNORMβCNORM is DOUBLE PRECISION array, dimension (N).
If NORMIN = 'Y', CNORM is an input argument and CNORM(j) contains the norm of the off-diagonal part of the j-th column of A. If TRANS = 'N', CNORM(j) must be greater than or equal to the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) must be greater than or equal to the 1-norm.
If NORMIN = 'N', CNORM is an output argument and CNORM(j) returns the 1-norm of the offdiagonal part of the j-th column of A.
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:
Okay bestie, here's the deep dive. π
A rough bound on x is computed; if that is less than overflow, ZTPSV 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 ZTPSV 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 ZTPSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow).
subroutine zlatrd (character UPLO, integer N, integer NB, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) E, complex*16, dimension( * ) TAU, complex*16, dimension( ldw, * ) W, integer LDW)
ZLATRD reduces the first nb rows and columns of a symmetric/Hermitian matrix A to real tridiagonal form by an unitary similarity transformation.
Purpose:
ZLATRD 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', ZLATRD reduces the last NB rows and columns of a matrix, of which the upper triangle is supplied; if UPLO = 'L', ZLATRD reduces the first NB rows and columns of a matrix, of which the lower triangle is supplied.
This is an auxiliary routine called by ZHETRD.
Parameters
UPLOβUPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
NβN is INTEGER. The order of the matrix A.NBβNB is INTEGER. The number of rows and columns to be reduced.AβA is COMPLEX*16 array, dimension (LDA,N). On entry, the Hermitian matrix A. IfUPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. On exit: ifUPLO = 'U', the last NB columns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements of A; the elements above the diagonal with the array TAU, represent the unitary matrix Q as a product of elementary reflectors; ifUPLO = 'L', the first NB columns have been reduced to tridiagonal form, with the diagonal elements overwriting the diagonal elements of A; the elements below the diagonal with the array TAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details.LDAβLDA is INTEGER. The leading dimension of the array A.LDA >= max(1,N).EβE is DOUBLE PRECISION array, dimension (N-1). IfUPLO = 'U',E(n-nb:n-1)contains the superdiagonal elements of the last NB columns of the reduced matrix; ifUPLO = 'L',E(1:nb)contains the subdiagonal elements of the first NB columns of the reduced matrix.TAUβTAU is COMPLEX*16 array, 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βW is COMPLEX*16 array, dimension (LDW,NB). The n-by-nb matrix W required to update the unreduced part of A.LDWβLDW is INTEGER. The leading dimension of the array W.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 zlatrs β¨
subroutine zlatrs (character UPLO, character TRANS, character DIAG,
character NORMIN, integer N, complex*16, dimension( lda, * ) A, integer
LDA, complex*16, dimension( * ) X, double precision SCALE, double
precision, dimension( * ) CNORM, integer INFO)
ZLATRS solves a triangular system of equations with the scale factor set to prevent overflow. No cap. π
Purpose π―
ZLATRS 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 ZTRSV 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β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.AβAisCOMPLEX*16array, dimension(LDA,N). The triangular matrixA. IfUPLO = 'U', the leading n by n upper triangular part of the arrayAcontains the upper triangular matrix, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading n by n lower triangular part of the arrayAcontains the lower triangular matrix, and the strictly upper triangular part ofAis not referenced. IfDIAG = 'U', the diagonal elements ofAare also not referenced and are assumed to be 1.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max (1,N).XβXisCOMPLEX*16array, dimension(N). On entry, the right hand sidebof the triangular system. On exit,Xis overwritten by the solution vectorx.SCALEβSCALEisDOUBLE PRECISION. The scaling factorsfor the triangular systemA * x = s*b, A**T * x = s*b, or A**H * x = s*b. IfSCALE = 0, the matrixAis singular or badly scaled, and the vectorxis an exact or approximate solution toA*x = 0.CNORMβCNORMisDOUBLE PRECISIONarray, dimension(N).
If NORMIN = 'Y', CNORM is an input argument and CNORM(j) contains the norm of the off-diagonal part of the j-th column of A. If TRANS = 'N', CNORM(j) must be greater than or equal to the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) must be greater than or equal to the 1-norm.
If NORMIN = 'N', CNORM is an output argument and CNORM(j) returns the 1-norm of the offdiagonal part of the j-th column of A.
INFOβINFOisINTEGER.= 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 π
Okay bestie, hereβs the tea on how ZLATRS does its thing. π
A rough bound on x is computed; if that is less than overflow, ZTRSV 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 ZTRSV 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 ZTRSV if 1/M(n) and 1/G(n) are both greater than max(underflow, 1/overflow). Slay. π
β¨ subroutine zlauu2 β¨
subroutine zlauu2 (character UPLO, integer N, complex*16, dimension( lda, *
) A, integer LDA, integer INFO)
ZLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblocked algorithm).
Purpose π―
ZLAUU2 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.
Parameters πΈ
UPLOβUPLOisCHARACTER*1. Specifies whether the triangular factor stored in the arrayAis upper or lower triangular:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the triangular factorUorL.N >= 0.AβAisCOMPLEX*16array, dimension(LDA,N). On entry, the triangular factorUorL. On exit, ifUPLO = 'U', the upper triangle ofAis overwritten with the upper triangle of the productU * U**H; ifUPLO = 'L', the lower triangle ofAis overwritten with the lower triangle of the productL**H * L.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).INFOβINFOisINTEGER.= 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 zlauum β¨
subroutine zlauum (character UPLO, integer N, complex*16, dimension( lda, *
) A, integer LDA, integer INFO)
ZLAUUM computes the product UUH or LHL, where U and L are upper or lower triangular matrices (blocked algorithm).
Purpose π―
ZLAUUM 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.
Parameters πΈ
UPLOβUPLOisCHARACTER*1. Specifies whether the triangular factor stored in the arrayAis upper or lower triangular:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the triangular factorUorL.N >= 0.AβAβCOMPLEX*16array, dimension(LDA,N). On entry bestie this is the triangular factorUorL. On exit, ifUPLO = 'U', the upper triangle ofAgets overwritten with the upper triangle of the productU * U**H; ifUPLO = 'L', the lower triangle ofAgets overwritten with the lower triangle of the productL**H * L. She's giving glow-up-and-then-rewrite πLDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). No shortcuts, she needs room.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 zrot (integer N, complex*16, dimension( * ) CX, integer INCX, complex*16, dimension( * ) CY, integer INCY, double precision C, complex*16 S)
ZROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors. Iconic little spin move π
Purpose:
ZROT applies a plane rotation, where the cos (C) is real and the
sin (S) is complex, and the vectors CX and CY are complex.
Parameters
NβNisINTEGER. The number of elements in the vectorsCXandCY. Counting bestie, we love to see it π’CXβCXisCOMPLEX*16array, dimension(N). On input, the vectorX. On output,CXis overwritten withC*X + S*Y. She's been transformed, periodt β¨INCXβINCXisINTEGER. The increment between successive values ofCX.INCX <> 0. Zero is not the vibe, don't do it π«CYβCYisCOMPLEX*16array, dimension(N). On input, the vectorY. On output,CYis overwritten with-CONJG(S)*X + C*Y. Conjugate jumped out, we love a plot twist πINCYβINCYisINTEGER. The increment between successive values ofCY.INCX <> 0. (yes bestie, the page literally saysINCXright there in theINCYentry β we are keeping it exactly as written, no edits, no notes π)CβCisDOUBLE PRECISION. Real one π«ΆSβSisCOMPLEX*16.CandSdefine a rotation
[ C S ]
[ -conjg(S) C ]
where C*C + S*CONJG(S) = 1.0. That's the whole entire aesthetic, normalized and flawless π
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zspmv (character UPLO, integer N, complex*16 ALPHA, complex*16, dimension( * ) AP, complex*16, dimension( * ) X, integer INCX, complex*16 BETA, complex*16, dimension( * ) Y, integer INCY)
ZSPMV computes a matrix-vector product for complex vectors using a complex symmetric packed matrix. Packed! Like a little suitcase of numbers π
Purpose:
ZSPMV 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.
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. She comes in, she says her piece, she does not change π
NβNisINTEGER. On entry,Nspecifies the order of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβALPHAisCOMPLEX*16. On entry,ALPHAspecifies the scalar alpha. Unchanged on exit.APβAPisCOMPLEX*16array, 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. Column by column bestie, she is stacked π§XβXisCOMPLEX*16array, dimension at least( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the N-element vector x. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβBETAisCOMPLEX*16. On entry,BETAspecifies the scalar beta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit. Free pass when she's zero, we love an easy out πYβYisCOMPLEX*16array, dimension at least( 1 + ( N - 1 )*abs( INCY ) ). Before entry, the incremented arrayYmust contain the n element vector y. On exit,Yis overwritten by the updated vector y.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 zspr (character UPLO, integer N, complex*16 ALPHA, complex*16, dimension( * ) X, integer INCX, complex*16, dimension( * ) AP)
ZSPR performs the symmetrical rank-1 update of a complex symmetric packed matrix. Rank-1 update, main character energy, she adds exactly one outer product and leaves π₯
Purpose:
ZSPR 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*16. On entry,ALPHAspecifies the scalar alpha. Unchanged on exit.XβXisCOMPLEX*16array, dimension at least( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the N-element vector x. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.APβAPisCOMPLEX*16array, 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. 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. Imaginary diagonal? Never heard of her, assumed zero, and she stays zero β¨
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine ztprfb (character SIDE, character TRANS, character DIRECT, character STOREV, integer M, integer N, integer K, integer L, complex*16, dimension( ldv, * ) V, integer LDV, complex*16, dimension( ldt, * ) T, integer LDT, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldwork, * ) WORK, integer LDWORK)
ZTPRFB applies a complex 'triangular-pentagonal' block reflector to a complex matrix, which is composed of two blocks. Two blocks?? It's giving duo, it's giving we come as a pair π¦
Purpose:
ZTPRFB 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)
Forward or backward, both valid, both slay π
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
okay bestie, we're picking up right in the middle of the parameter list β no re-intro, just straight into the tea π β¨
K(INTEGER) β the order of the matrixT, i.e. the number of elementary reflectors whose product defines the block reflector.K >= 0.L(INTEGER) β the order of the trapezoidal part ofV.K >= L >= 0. See Further Details.V(COMPLEX*16 array) β dimension:(LDV,K)ifSTOREV = 'C'(LDV,M)ifSTOREV = 'R'andSIDE = 'L'(LDV,N)ifSTOREV = 'R'andSIDE = 'R'The pentagonal matrixV, which contains the elementary reflectorsH(1), H(2), ..., H(K). See Further Details.
LDV(INTEGER) β the leading dimension of the arrayV.- If
STOREV = 'C'andSIDE = 'L',LDV >= max(1,M); - if
STOREV = 'C'andSIDE = 'R',LDV >= max(1,N); - if
STOREV = 'R',LDV >= K.
- If
T(COMPLEX*16 array) β dimension(LDT,K). The triangularK-by-KmatrixTin the representation of the block reflector.LDT(INTEGER) β the leading dimension of the arrayT.LDT >= K.A(COMPLEX*16 array) β dimension:(LDA,N)ifSIDE = 'L'or(LDA,K)ifSIDE = 'R'On entry, theK-by-NorM-by-KmatrixA. On exit,Ais overwritten by the corresponding block ofH*CorH**H*CorC*HorC*H**H. See Further Details.
LDA(INTEGER) β the leading dimension of the arrayA.- If
SIDE = 'L',LDA >= max(1,K); - If
SIDE = 'R',LDA >= max(1,M).
- If
B(COMPLEX*16 array) β dimension(LDB,N). On entry, theM-by-NmatrixB. On exit,Bis overwritten by the corresponding block ofH*CorH**H*CorC*HorC*H**H. See Further Details.LDB(INTEGER) β the leading dimension of the arrayB.LDB >= max(1,M).WORK(COMPLEX*16 array) β dimension:(LDWORK,N)ifSIDE = 'L',(LDWORK,K)ifSIDE = 'R'.
LDWORK(INTEGER) β the leading dimension of the arrayWORK.- If
SIDE = 'L',LDWORK >= K; - if
SIDE = 'R',LDWORK >= M.
- If
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
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'andDIRECT = 'F',C = [A B]. - If
SIDE = 'L'andDIRECT = 'F', then:
C = [A]
[B]
- If
SIDE = 'R'andDIRECT = 'B',C = [B A]. - If
SIDE = 'L'andDIRECT = 'B', then:
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'andSTOREV = 'C':
V = [V1]
[V2]
V2is upper trapezoidal (firstLrows ofK-by-Kupper triangular)
- If
DIRECT = 'F'andSTOREV = 'R':V = [V1 V2]V2is lower trapezoidal (firstLcolumns ofK-by-Klower triangular)
- If
DIRECT = 'B'andSTOREV = 'C':
V = [V2]
[V1]
V2is lower trapezoidal (lastLrows ofK-by-Klower triangular)
- If
DIRECT = 'B'andSTOREV = 'R':V = [V2 V1]V2is upper trapezoidal (lastLcolumns ofK-by-Kupper triangular)
- If
STOREV = 'C'andSIDE = 'L',VisM-by-KwithV2L-by-K. - If
STOREV = 'C'andSIDE = 'R',VisN-by-KwithV2L-by-K. - If
STOREV = 'R'andSIDE = 'L',VisK-by-MwithV2K-by-L. - If
STOREV = 'R'andSIDE = 'R',VisK-by-NwithV2K-by-L.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
and that's a wrap, bestie! this was version 3.11.0, dated Sun Nov 27 2022, and it's the complex16OTHERauxiliary(3) manual β slay π
β¨π¦
π¦ 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