complex16GEcomputational(3)
๐ complex16GEcomputational(3) ๐
okay bestie, welcome to the LAPACK page for complex16GEcomputational โ it's literally the complex16 computational functions for GE matrices. This is part 1 of 18, so we're just getting started. No cap. ๐ซถ
โจ NAME โจ
complex16GEcomputational โ it's giving complex16. That's the whole name, periodt. ๐
๐ธ SYNOPSIS ๐ธ
Functions, bestie! Here's the whole squad, no cap:
subroutine zgebak (JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV, INFO)โ ZGEBAKsubroutine zgebal (JOB, N, A, LDA, ILO, IHI, SCALE, INFO)โ ZGEBALsubroutine zgebd2 (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, INFO)โ ZGEBD2 reduces a general matrix to bidiagonal form using an unblocked algorithm.subroutine zgebrd (M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, INFO)โ ZGEBRDsubroutine zgecon (NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK, INFO)โ ZGECONsubroutine zgeequ (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)โ ZGEEQUsubroutine zgeequb (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)โ ZGEEQUBsubroutine zgehd2 (N, ILO, IHI, A, LDA, TAU, WORK, INFO)โ ZGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.subroutine zgehrd (N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO)โ ZGEHRDsubroutine zgelq2 (M, N, A, LDA, TAU, WORK, INFO)โ ZGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm.subroutine zgelqf (M, N, A, LDA, TAU, WORK, LWORK, INFO)โ ZGELQFsubroutine zgemqrt (SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT, C, LDC, WORK, INFO)โ ZGEMQRTsubroutine zgeql2 (M, N, A, LDA, TAU, WORK, INFO)โ ZGEQL2 computes the QL factorization of a general rectangular matrix using an unblocked algorithm.subroutine zgeqlf (M, N, A, LDA, TAU, WORK, LWORK, INFO)โ ZGEQLFsubroutine zgeqp3 (M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK, INFO)โ ZGEQP3subroutine zgeqr2 (M, N, A, LDA, TAU, WORK, INFO)โ ZGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.subroutine zgeqr2p (M, N, A, LDA, TAU, WORK, INFO)โ ZGEQR2P computes the QR factorization of a general rectangular matrix with non-negative diagonal elements using an unblocked algorithm.subroutine zgeqrf (M, N, A, LDA, TAU, WORK, LWORK, INFO)โ ZGEQRFsubroutine zgeqrfp (M, N, A, LDA, TAU, WORK, LWORK, INFO)โ ZGEQRFPsubroutine zgeqrt (M, N, NB, A, LDA, T, LDT, WORK, INFO)โ ZGEQRTsubroutine zgeqrt2 (M, N, A, LDA, T, LDT, INFO)โ ZGEQRT2 computes a QR factorization of a general real or complex matrix using the compact WY representation of Q.recursive subroutine zgeqrt3 (M, N, A, LDA, T, LDT, INFO)โ ZGEQRT3 recursively computes a QR factorization of a general real or complex matrix using the compact WY representation of Q.subroutine zgerfs (TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)โ ZGERFSsubroutine zgerfsx (TRANS, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, R, C, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)โ ZGERFSXsubroutine zgerq2 (M, N, A, LDA, TAU, WORK, INFO)โ ZGERQ2 computes the RQ factorization of a general rectangular matrix using an unblocked algorithm.subroutine zgerqf (M, N, A, LDA, TAU, WORK, LWORK, INFO)โ ZGERQFsubroutine zgesvj (JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, LDV, CWORK, LWORK, RWORK, LRWORK, INFO)โ ZGESVJsubroutine zgetf2 (M, N, A, LDA, IPIV, INFO)โ ZGETF2 computes the LU factorization of a general m-by-n matrix using partial pivoting with row interchanges (unblocked algorithm).subroutine zgetrf (M, N, A, LDA, IPIV, INFO)โ ZGETRFrecursive subroutine zgetrf2 (M, N, A, LDA, IPIV, INFO)โ ZGETRF2subroutine zgetri (N, A, LDA, IPIV, WORK, LWORK, INFO)โ ZGETRIsubroutine zgetrs (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)โ ZGETRSsubroutine zhgeqz (JOB, COMPQ, COMPZ, N, ILO, IHI, H, LDH, T, LDT, ALPHA, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, RWORK, INFO)โ ZHGEQZsubroutine zla_geamv (TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)โ ZLA_GEAMV computes a matrix-vector product using a general matrix to calculate error bounds.double precision function zla_gercond_c (TRANS, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)โ ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general matrices.double precision function zla_gercond_x (TRANS, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)โ ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices.subroutine zla_gerfsx_extended (PREC_TYPE, TRANS_TYPE, N, NRHS, A, LDA, AF, LDAF, IPIV, COLEQU, C, B, LDB, Y, LDY, BERR_OUT, N_NORMS, ERRS_N, ERRS_C, RES, AYB, DY, Y_TAIL, RCOND, ITHRESH, RTHRESH, DZ_UB, IGNORE_CWISE, INFO)โ ZLA_GERFSX_EXTENDEDdouble precision function zla_gerpvgrw (N, NCOLS, A, LDA, AF, LDAF)โ ZLA_GERPVGRW multiplies a square real matrix by a complex matrix.recursive subroutine zlaqz0 (WANTS, WANTQ, WANTZ, N, ILO, IHI, A, LDA, B, LDB, ALPHA, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, RWORK, REC, INFO)โ ZLAQZ0subroutine zlaqz1 (ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA, B, LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ)โ ZLAQZ1recursive subroutine zlaqz2 (ILSCHUR, ILQ, ILZ, N, ILO, IHI, NW, A, LDA, B, LDB, Q, LDQ, Z, LDZ, NS, ND, ALPHA, BETA, QC, LDQC, ZC, LDZC, WORK, LWORK, RWORK, REC, INFO)โ ZLAQZ2subroutine zlaqz3 (ILSCHUR, ILQ, ILZ, N, ILO, IHI, NSHIFTS, NBLOCK_DESIRED, ALPHA, BETA, A, LDA, B, LDB, Q, LDQ, Z, LDZ, QC, LDQC, ZC, LDZC, WORK, LWORK, INFO)โ ZLAQZ3subroutine zlaunhr_col_getrfnp (M, N, A, LDA, D, INFO)โ ZLAUNHR_COL_GETRFNPrecursive subroutine zlaunhr_col_getrfnp2 (M, N, A, LDA, D, INFO)โ ZLAUNHR_COL_GETRFNP2subroutine ztgevc (SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL, LDVL, VR, LDVR, MM, M, WORK, RWORK, INFO)โ ZTGEVCsubroutine ztgexc (WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, LDZ, IFST, ILST, INFO)โ ZTGEXC
๐ Detailed Description ๐
So like, this whole squad is the group of complex16 computational functions for GE matrices. That's the vibe, bestie. ๐
๐ Function Documentation ๐
๐ ZGEBAK ๐
subroutine zgebak (character JOB, character SIDE, integer N, integer ILO,
integer IHI, double precision, dimension( * ) SCALE, integer M,
complex*16, dimension( ldv, * ) V, integer LDV, integer INFO)
ZGEBAK
Purpose:
ZGEBAK forms the right or left eigenvectors of a complex general matrix by backward transformation on the computed eigenvectors of the balanced matrix output by ZGEBAL. iconic!
Parameters
JOB
JOB is CHARACTER*1. Specifies the type of backward transformation required:
= 'N': do nothing, return immediately;= 'P': do backward transformation for permutation only;= 'S': do backward transformation for scaling only;= 'B': do backward transformations for both permutation and scaling.
JOB must be the same as the argument JOB supplied to ZGEBAL.
SIDE
SIDE is CHARACTER*1.
= 'R': V contains right eigenvectors;= 'L': V contains left eigenvectors.
N
N is INTEGER. The number of rows of the matrix V. N >= 0.
ILO
ILO is INTEGER.
IHI
IHI is INTEGER. The integers ILO and IHI determined by ZGEBAL. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.
SCALE
SCALE is DOUBLE PRECISION array, dimension (N). Details of the permutation and scaling factors, as returned by ZGEBAL.
M
M is INTEGER. The number of columns of the matrix V. M >= 0.
V
V is COMPLEX*16 array, dimension (LDV,M). On entry, the matrix of right or left eigenvectors to be transformed, as returned by ZHSEIN or ZTREVC. On exit, V is overwritten by the transformed eigenvectors.
LDV
LDV is INTEGER. The leading dimension of the array V. LDV >= max(1,N).
INFO
INFO is INTEGER.
= 0: successful exit< 0: if INFO = -i, the i-th argument had an illegal value.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ ZGEBAL ๐
subroutine zgebal (character JOB, integer N, complex*16, dimension( lda, * )
A, integer LDA, integer ILO, integer IHI, double precision, dimension( *
) SCALE, integer INFO)
ZGEBAL
Purpose:
ZGEBAL balances a general complex matrix A. This involves, first, permuting A by a similarity transformation to isolate eigenvalues in the first 1 to ILO-1 and last IHI+1 to N elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.
Balancing may reduce the 1-norm of the matrix, and improve the accuracy of the computed eigenvalues and/or eigenvectors.
Parameters
JOB
JOB is CHARACTER*1. Specifies the operations to be performed on A:
= 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0 for i = 1,...,N;= 'P': permute only;= 'S': scale only;= 'B': both permute and scale.
N
N is INTEGER. The order of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N). On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If JOB = 'N', A is not referenced. See Further Details.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
ILO
ILO is INTEGER.
IHI
IHI is INTEGER. ILO and IHI are set to INTEGER such that on exit A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N.
SCALE
SCALEโDOUBLE PRECISION array, dimension (N). It's the receipts of all the permutations and scaling factors that got applied toA, bestie. IfP(j)is the index of the row and column swapped with row and columnj, andD(j)is the scaling factor applied to row and columnj, then:
SCALE(j) = P(j) for j = 1,...,ILO-1
= D(j) for j = ILO,...,IHI
= P(j) for j = IHI+1,...,N.
The order in which the interchanges go down is N to IHI+1, then 1 to ILO-1. Periodt.
INFOโINTEGER, the vibe check on how it all went:= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value. not iconic of it tbh.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details ๐
The permutations consist of row and column interchanges which put the matrix in the form
( T1 X Y )
P A P = ( 0 B Z )
( 0 0 T2 )
where T1 and T2 are upper triangular matrices whose eigenvalues lie along the diagonal. The column indices ILO and IHI mark the starting and ending columns of the submatrix B. Balancing consists of applying a diagonal similarity transformation inv(D) * B * D to make the 1-norms of each row of B and its corresponding column nearly equal. The output matrix is
( T1 X*D Y )
( 0 inv(D)*B*D inv(D)*Z ).
( 0 0 T2 )
Information about the permutations P and the diagonal matrix D is returned in the vector SCALE.
This subroutine is based on the EISPACK routine CBAL.
Modified by Tzu-Yi Chen, Computer Science Division, University of California at Berkeley, USA
๐ง subroutine zgebd2 ๐ง
subroutine zgebd2 (integer M, integer N, 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( * ) WORK, integer INFO)
ZGEBD2 reduces a general matrix to bidiagonal form using an unblocked algorithm. No fancy blocking here, she's doing it the honest way.
๐ฏ Purpose ๐ฏ
ZGEBD2 reduces a complex general m by n matrix A to upper or lower real bidiagonal form B by a unitary transformation: Q**H * A * P = B.
If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal. Simple as that ๐
๐ซถ Parameters ๐ซถ
MโINTEGER. The number of rows in the matrixA.M >= 0.NโINTEGER. The number of columns in the matrixA.N >= 0.AโCOMPLEX*16 array, dimension (LDA,N). On entry, the m by n general matrix to be reduced. On exit:- if
m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the first superdiagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors; - if
m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the diagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors.
- if
See Further Details. (She's got lore, okay?)
LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).DโDOUBLE PRECISION array, dimension (min(M,N)). The diagonal elements of the bidiagonal matrixB:D(i) = A(i,i).EโDOUBLE PRECISION array, dimension (min(M,N)-1). The off-diagonal elements of the bidiagonal matrixB:- if
m >= n,E(i) = A(i,i+1)fori = 1,2,...,n-1; - if
m < n,E(i) = A(i+1,i)fori = 1,2,...,m-1.
- if
TAUQโCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrixQ. See Further Details.TAUPโCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrixP. See Further Details.WORKโCOMPLEX*16 array, dimension (max(M,N)).INFOโINTEGER, the final verdict:= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value. rip.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details ๐
The matrices Q and P are represented as products of elementary reflectors:
If m >= n,
Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
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; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i).
If m < n,
Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
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, v and u are complex vectors; v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); u(1:i-1) = 0, u(i) = 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).
The contents of A on exit are illustrated by the following examples:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
( v1 v2 v3 v4 v5 )
where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i). Lowkey a whole map of the place ๐บ๏ธโจ
๐ subroutine zgebrd ๐
subroutine zgebrd (integer M, integer N, 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( * ) WORK, integer LWORK,
integer INFO)
ZGEBRD โ yes bestie, that's literally the whole name, she needs no subtitle ๐
๐ฏ Purpose ๐ฏ
ZGEBRD reduces a general complex M-by-N matrix A to upper or lower bidiagonal form B by a unitary transformation: Q**H * A * P = B.
If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.
๐ซถ Parameters ๐ซถ
MโINTEGER. The number of rows in the matrixA.M >= 0.NโINTEGER. The number of columns in the matrixA.N >= 0.AโCOMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N general matrix to be reduced. On exit:- if
m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrixB; the elements below the diagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the first superdiagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors; - if
m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrixB; the elements below the first subdiagonal, with the arrayTAUQ, represent the unitary matrixQas a product of elementary reflectors, and the elements above the diagonal, with the arrayTAUP, represent the unitary matrixPas a product of elementary reflectors.
- if
See Further Details. (Same lore, different girlie.)
LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).DโDOUBLE PRECISION array, dimension (min(M,N)). The diagonal elements of the bidiagonal matrixB:D(i) = A(i,i).EโDOUBLE PRECISION array, dimension (min(M,N)-1). The off-diagonal elements of the bidiagonal matrixB:- if
m >= n,E(i) = A(i,i+1)fori = 1,2,...,n-1; - if
m < n,E(i) = A(i+1,i)fori = 1,2,...,m-1.
- if
TAUQโCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrixQ. See Further Details.TAUPโCOMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrixP. See Further Details.WORKโCOMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. She's generous like that โจLWORKโINTEGER. The length of the arrayWORK.LWORK >= max(1,M,N). For optimum performanceLWORK >= (M+N)*NB, whereNBis the optimal blocksize.
IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. Just peeking, not touching ๐
INFOโINTEGER:= 0: successful exit ๐ธ< 0: ifINFO = -i, the i-th argument had an illegal value.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
๐ Further Details ๐
okay so bestie, here's the tea on how Q and P are actually built โ they're products of elementary reflectors, periodt:
If m >= n,
Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)
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; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i). ๐
If m < n,
Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)
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; v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); u(1:i-1) = 0, u(i) = 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). ๐ซถ
The contents of A on exit are illustrated by the following examples:
m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):
( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
( v1 v2 v3 v4 v5 )
where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i). โจ
๐ zgecon ๐
subroutine zgecon (character NORM, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision ANORM, double precision RCOND, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZGECON
๐ธ Purpose ๐ธ
ZGECON estimates the reciprocal of the condition number of a general complex matrix A, in either the 1-norm or the infinity-norm, using the LU factorization computed by ZGETRF. lowkey the glow-up detector for your matrix ๐
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as
RCOND = 1 / ( norm(A) * norm(inv(A)) ).
๐ฆ Parameters ๐ฆ
NORMโNORMisCHARACTER*1. Specifies whether the 1-norm condition number or the infinity-norm condition number is required:= '1' or 'O': 1-norm;= 'I': Infinity-norm.
NโNisINTEGER. The order of the matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF. iykyk, this is the leftovers fromZGETRF, don't @ me ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).ANORMโANORMisDOUBLE PRECISION. IfNORM = '1' or 'O', the 1-norm of the original matrixA. IfNORM = 'I', the infinity-norm of the original matrixA.RCONDโRCONDisDOUBLE PRECISION. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(norm(A) * norm(inv(A))).WORKโWORKisCOMPLEX*16array, dimension(2*N)RWORKโRWORKisDOUBLE PRECISIONarray, dimension(2*N)INFOโINFOisINTEGER:= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ zgeequ ๐
subroutine zgeequ (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) R, double precision, dimension( * ) C, double precision ROWCND, double precision COLCND, double precision AMAX, integer INFO)
ZGEEQU
๐ธ Purpose ๐ธ
ZGEEQU computes row and column scalings intended to equilibrate an M-by-N matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1. it's giving "make everyone the same size so nobody's the main character" energy โญ
R(i) and C(j) are restricted to be between SMLNUM = smallest safe number and BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice. fr fr, no promises ๐ซถ
๐ฆ Parameters ๐ฆ
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). TheM-by-Nmatrix whose equilibration factors are to be computed.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).RโRisDOUBLE PRECISIONarray, dimension(M). IfINFO = 0orINFO > M,Rcontains the row scale factors forA.CโCisDOUBLE PRECISIONarray, dimension(N). IfINFO = 0,Ccontains the column scale factors forA.ROWCNDโROWCNDisDOUBLE PRECISION. IfINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). IfROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDโCOLCNDisDOUBLE PRECISION. IfINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). IfCOLCND >= 0.1, it is not worth scaling byC.AMAXโAMAXisDOUBLE PRECISION. Absolute value of largest matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled. bestie, watch out for that overflow ๐ญINFOโINFOisINTEGER:= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= M: thei-th row ofAis exactly zero> M: the(i-M)-th column ofAis exactly zero
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
โจ zgeequb โจ
subroutine zgeequb (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) R, double precision, dimension( * ) C, double precision ROWCND, double precision COLCND, double precision AMAX, integer INFO)
ZGEEQUB
๐ธ Purpose ๐ธ
ZGEEQUB computes row and column scalings intended to equilibrate an M-by-N matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most the radix. the b is for "but make it radix" ๐
R(i) and C(j) are restricted to be a power of the radix between SMLNUM = smallest safe number and BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice.
This routine differs from ZGEEQU by restricting the scaling factors to a power of the radix. Barring over- and underflow, scaling by these factors introduces no additional rounding errors. However, the scaled entries' magnitudes are no longer approximately 1 but lie between sqrt(radix) and 1/sqrt(radix). ๐
๐ฆ Parameters ๐ฆ
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). TheM-by-Nmatrix whose equilibration factors are to be computed.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).RโRisDOUBLE PRECISIONarray, dimension(M). IfINFO = 0orINFO > M,Rcontains the row scale factors forA.CโCisDOUBLE PRECISIONarray, dimension(N). IfINFO = 0,Ccontains the column scale factors forA.ROWCNDโROWCNDisDOUBLE PRECISION. IfINFO = 0orINFO > M,ROWCNDcontains the ratio of the smallestR(i)to the largestR(i). IfROWCND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byR.COLCNDโCOLCNDisDOUBLE PRECISION. IfINFO = 0,COLCNDcontains the ratio of the smallestC(i)to the largestC(i). IfCOLCND >= 0.1, it is not worth scaling byC.AMAXโAMAXisDOUBLE PRECISION. Absolute value of largest matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled.INFOโINFOisINTEGER:= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= M: thei-th row ofAis exactly zero> M: the(i-M)-th column ofAis exactly zero
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ zgehd2 ๐
subroutine zgehd2 (integer N, integer ILO, integer IHI, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * ) WORK, integer INFO)
ZGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.
๐ธ Purpose ๐ธ
ZGEHD2 reduces a complex general matrix A to upper Hessenberg form H by a unitary similarity transformation: Q**H * A * Q = H . iconic behavior honestly ๐
๐ฆ Parameters ๐ฆ
NโNisINTEGER. The order of the matrixA.N >= 0.ILOโILOisINTEGERIHIIHIโ IHI is INTEGER. Okay bestie, here's the vibe ๐ซถ: it's assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toZGEBAL; otherwise they should be set to1andNrespectively. See Further Details. And the rule:1 <= ILO <= IHI <= max(1,N). Periodt. โจAโ A is COMPLEX*16 array, dimension (LDA,N). On entry, it's the n by n general matrix that's getting reduced. On exit, the upper triangle and the first subdiagonal ofAget overwritten with the upper Hessenberg matrix H, and the elements below that first subdiagonal โ together with the arrayTAUโ represent the unitary matrix Q as a product of elementary reflectors. See Further Details. ๐LDAโ LDA is INTEGER. It's the leading dimension of the arrayA. Constraint:LDA >= max(1,N).TAUโ TAU is COMPLEX*16 array, dimension (N-1). These are the scalar factors of the elementary reflectors (see Further Details). ๐WORKโ WORK is COMPLEX*16 array, dimension (N).INFOโ INFO is INTEGER.= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value. ๐จ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-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(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).
The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit,
( a a a a a a a ) ( a a h h h h a )
( a a a a a a ) ( a h h h h a )
( a a a a a a ) ( h h h h h h )
( a a a a a a ) ( v2 h h h h h )
( a a a a a a ) ( v2 v3 h h h h )
( a a a a a a ) ( v2 v3 v4 h h h )
( 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).
โจ subroutine zgehrd โจ
subroutine zgehrd (integer N, integer ILO, integer IHI, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TAU,
complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZGEHRD โ okay so this one's the icon, the moment, the main character ๐๐
๐ฏ Purpose:
ZGEHRD reduces a complex general matrix A to upper Hessenberg form H by an unitary similarity transformation:
Q**H * A * Q = H .
๐๏ธ Parameters
Nโ N is INTEGER. The order of the matrixA.N >= 0.ILOโ ILO is INTEGER.IHIโ IHI is INTEGER. It is assumed thatAis already upper triangular in rows and columns1:ILO-1andIHI+1:N.ILOandIHIare normally set by a previous call toZGEBAL; otherwise they should be set to1andNrespectively. See Further Details. Constraints:1 <= ILO <= IHI <= N, ifN > 0;ILO=1andIHI=0, ifN=0. Yes, you read that right โ ifN=0it'sILO=1andIHI=0. Not a typo, bestie ๐Aโ A is COMPLEX*16 array, dimension (LDA,N). On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal ofAare overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details. ๐LDAโ LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TAUโ TAU is COMPLEX*16 array, dimension (N-1). The scalar factors of the elementary reflectors (see Further Details). Elements1:ILO-1andIHI:N-1ofTAUare set to zero. ๐WORKโ WORK is COMPLEX*16 array, dimension (LWORK). On exit, ifINFO = 0,WORK(1)returns the optimal LWORK. slay โจLWORKโ LWORK is INTEGER. The length of the arrayWORK.LWORK >= max(1,N). For good performance,LWORKshould generally be larger. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. (It's giving "just checking the size, no notes" ๐ )INFOโ INFO is INTEGER.= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value. ๐จ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of (ihi-ilo) elementary reflectors
Q = H(ilo) H(ilo+1) . . . H(ihi-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(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).
The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:
on entry, on exit,
( a a a a a a a ) ( a a h h h h a )
( a a a a a a ) ( a h h h h a )
( a a a a a a ) ( h h h h h h )
( a a a a a a ) ( v2 h h h h h )
( a a a a a a ) ( v2 v3 h h h h )
( a a a a a a ) ( v2 v3 v4 h h h )
( 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).
๐ง Fun fact bestie: this file is a slight modification of LAPACK-3.0'sZGEHRDsubroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (SeeZLAHR2.)
๐ฆ subroutine zgelq2 ๐ฆ
subroutine zgelq2 (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer INFO)
ZGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm. (Unblocked = small and cute, no blocking shenanigans ๐ )
๐ฏ Purpose:
ZGELQ2 computes an LQ factorization of a complex m-by-n matrix A:
A = ( L 0 ) * Q
where:
- Q is a n-by-n orthogonal matrix;
- L is a lower-triangular m-by-m matrix;
- 0 is a m-by-(n-m) zero matrix, if
m < n.
๐๏ธ Parameters
Mโ M is INTEGER. The number of rows of the matrixA.M >= 0.Nโ N is INTEGER. The number of columns of the matrixA.N >= 0.Aโ A is COMPLEX*16 array, dimension (LDA,N). On entry, the m by n matrixA. On exit, the elements on and below the diagonal of the array contain the m bymin(m,n)lower trapezoidal matrix L (L is lower triangular ifm <= n); the elements above the diagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors (see Further Details). ๐ธLDAโ LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TAUโ TAU is COMPLEX*16 array, dimension(min(M,N)). The scalar factors of the elementary reflectors (see Further Details). โจWORKโ WORK is COMPLEX*16 array, dimension (M).INFOโ INFO is INTEGER.= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐จ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(k)**H . . . H(2)**H H(1)**H, where k = min(m,n).
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-1) = 0 and v(i) = 1; conjg(v(i+1:n)) is stored on exit in A(i,i+1:n), and tau in TAU(i). ๐ซถ
๐ subroutine zgelqf ๐
subroutine zgelqf (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZGELQF โ the blocked glow-up version, same energy, bigger fits ๐ โจ
๐ฏ Purpose:
ZGELQF computes an LQ factorization of a complex M-by-N matrix A:
A = ( L 0 ) * Q
where:
- Q is a N-by-N orthogonal matrix;
- L is a lower-triangular M-by-M matrix;
- 0 is a M-by-(N-M) zero matrix, if
M < N.
๐๏ธ Parameters
Mโ M is INTEGER. The number of rows of the matrixA.M >= 0.Nโ N is INTEGER. The number of columns of the matrixA.N >= 0.Aโ A is COMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit, the elements on and below the diagonal of the array contain the m-by-min(m,n)lower trapezoidal matrix L (L is lower triangular ifm <= n); the elements above the diagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors (see Further Details). ๐ฆLDAโ LDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TAUโ TAU is COMPLEX*16 array, dimension(min(M,N)). The scalar factors of the elementary reflectors (see Further Details). ๐WORKโ WORK is COMPLEX*16 array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimal LWORK. โจLWORKLWORKโINTEGER, bestie. It's the dimension of theWORKarray. Rule:LWORK >= max(1,M). And if you want optimum performance, goLWORK >= M*NB, whereNBis the optimal blocksize. โจ
๐จ Special case alert: ifLWORK = -1, a workspace query is assumed. The routine only calculates the optimal size of theWORKarray, hands it back as the first entry ofWORK, andXERBLAstays quiet โ it issues no error message related toLWORK. ๐ซถ
INFOโINTEGER, the receipts:= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ธ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(k)**H . . . H(2)**H H(1)**H, where k = min(m,n).
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-1) = 0 and v(i) = 1; conjg(v(i+1:n)) is stored on exit in A(i,i+1:n), and tau in TAU(i). ๐
๐ฆ subroutine zgemqrt
subroutine zgemqrt (character SIDE, character TRANS, integer M, integer N,
integer K, integer NB, complex*16, dimension( ldv, * ) V, integer LDV,
complex*16, dimension( ldt, * ) T, integer LDT, complex*16, dimension(
ldc, * ) C, integer LDC, complex*16, dimension( * ) WORK, integer INFO)
ZGEMQRT
Purpose:
ZGEMQRT overwrites the general complex M-by-N matrix C with
SIDE = 'L' SIDE = 'R'
TRANS = 'N': Q C C Q
TRANS = 'C': Q**H C C Q**H
where Q is a complex orthogonal matrix defined as the product of K elementary reflectors:
Q = H(1) H(2) . . . H(K) = I - V T V**H
generated using the compact WY representation as returned by ZGEQRT. ๐
Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'.
Parameters
SIDEโSIDE is CHARACTER*1= 'L': applyQorQ**Hfrom the Left;= 'R': applyQorQ**Hfrom the Right.
TRANSโTRANS is CHARACTER*1= 'N': No transpose, applyQ;= 'C': Conjugate transpose, applyQ**H.
MโM is INTEGER. The number of rows of the matrixC.M >= 0.NโN is INTEGER. The number of columns of the matrixC.N >= 0.KโK is INTEGER. The number of elementary reflectors whose product defines the matrixQ. IfSIDE = 'L',M >= K >= 0; ifSIDE = 'R',N >= K >= 0.NBโNB is INTEGER. The block size used for the storage ofT.K >= NB >= 1. This must be the same value ofNBused to generateTinZGEQRT. No cap. ๐VโV is COMPLEX*16 array, dimension (LDV,K). The i-th column must contain the vector which defines the elementary reflectorH(i), fori = 1,2,...,k, as returned byZGEQRTin the firstKcolumns of its array argumentA.LDVโLDV is INTEGER. The leading dimension of the arrayV. IfSIDE = 'L',LDA >= max(1,M); ifSIDE = 'R',LDA >= max(1,N).TโT is COMPLEX*16 array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned byZGEQRT, stored as aNB-by-Nmatrix.LDTโLDT is INTEGER. The leading dimension of the arrayT.LDT >= NB.CโC is COMPLEX*16 array, dimension (LDC,N). On entry, the M-by-N matrixC. On exit,Cis overwritten byQ C,Q**H C,C Q**HorC Q. ๐ซLDCโLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).WORKโWORK is COMPLEX*16 array.The dimension ofWORKisN*NBifSIDE = 'L', orM*NBifSIDE = 'R'.INFOโINFO is INTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ subroutine zgeql2
subroutine zgeql2 (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer INFO)
ZGEQL2 computes the QL factorization of a general rectangular matrix using an unblocked algorithm. (yes, the little one, no blocks, just vibes ๐ง)
Purpose:
ZGEQL2 computes a QL factorization of a complex m by n matrix A:
A = Q * L.
Parameters
MโM is INTEGER. The number of rows of the matrixA.M >= 0.NโN is INTEGER. The number of columns of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). On entry, the m by n matrixA. On exit, ifm >= n, the lower triangle of the subarrayA(m-n+1:m,1:n)contains the n by n lower triangular matrixL; ifm <= n, the elements on and below the (n-m)-th superdiagonal contain the m by n lower trapezoidal matrixL; the remaining elements, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors (see Further Details). ๐ฆLDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TAUโTAU is COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors (see Further Details).WORKโWORK is COMPLEX*16 array, dimension (N).INFOโINFO is INTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(k) . . . H(2) H(1), where k = min(m,n).
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(m-k+i+1:m) = 0 and v(m-k+i) = 1; v(1:m-k+i-1) is stored on exit in A(1:m-k+i-1,n-k+i), and tau in TAU(i). โจ
๐ subroutine zgeqlf
subroutine zgeqlf (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZGEQLF
Purpose:
ZGEQLF computes a QL factorization of a complex M-by-N matrix A:
A = Q * L.
Parameters
MโM is INTEGER. The number of rows of the matrixA.M >= 0.NโN is INTEGER. The number of columns of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit, ifm >= n, the lower triangle of the subarrayA(m-n+1:m,1:n)contains the N-by-N lower triangular matrixL; ifm <= n, the elements on and below the (n-m)-th superdiagonal contain the M-by-N lower trapezoidal matrixL; the remaining elements, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors (see Further Details). ๐ธLDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TAUโTAU is COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors (see Further Details).WORKโWORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. ๐ฅLWORKโLWORK is INTEGER. The dimension of the arrayWORK.LWORK >= max(1,N). For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize.
๐จ IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
INFOโINFO is INTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(k) . . . H(2) H(1), where k = min(m,n).
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(m-k+i+1:m) = 0 and v(m-k+i) = 1; v(1:m-k+i-1) is stored on exit in A(1:m-k+i-1,n-k+i), and tau in TAU(i). ๐
โญ subroutine zgeqp3
subroutine zgeqp3 (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, integer, dimension( * ) JPVT, complex*16, dimension( * )
TAU, complex*16, dimension( * ) WORK, integer LWORK, double precision,
dimension( * ) RWORK, integer INFO)
ZGEQP3
Purpose:
ZGEQP3 computes a QR factorization with column pivoting of a matrix A:
A*P = Q*R using Level 3 BLAS.
Parameters
MโM is INTEGER. The number of rows of the matrixA.M >= 0.NโN is INTEGER. The number of columns of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N matrixA. On exit, the upper triangle of the array contains themin(M,N)-by-Nupper trapezoidal matrixR; the elements below the diagonal, together with the arrayTAU, represent the unitary matrixQas a product ofmin(M,N)elementary reflectors. ๐LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).JPVT
JPVT
JPVT is an INTEGER array, dimension (N).
Okay so on entry, bestie: if JPVT(J).ne.0, the J-th column of A is permuted to the front of A*P โ she's a leading column ๐ โ and if JPVT(J)=0, then the J-th column of A is a free column.
On exit, if JPVT(J)=K, then the J-th column of A*P was the K-th column of A. Tracking the glow-up of every single column, fr fr. ๐
TAU
TAU is a COMPLEX*16 array, dimension (min(M,N)).
The scalar factors of the elementary reflectors. She's doing a lot of the emotional labor here, ngl. โจ
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)).
On exit, if INFO=0, WORK(1) returns the optimal LWORK. It's giving โจreceiptsโจ.
LWORK
LWORK is INTEGER. It's the dimension of the array WORK.
LWORK >= N+1.- For optimal performance,
LWORK >= ( N+1 )*NB, whereNBis the optimal blocksize.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. So you just ask "how much room do I need bestie" and she tells you, no drama, no XERBLA yelling. ๐ซถ
RWORK
RWORK is DOUBLE PRECISION array, dimension (2*N).
INFO
INFO is INTEGER.
= 0: successful exit. We ate. ๐ฅ< 0: ifINFO = -i, the i-th argument had an illegal value. Somebody passed a bad argument and she's telling on them. ๐
๐ 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 elementary reflectors
Q = H(1) H(2) . . . H(k), where k = min(m,n).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a real/complex vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i). That's the whole recipe, no cap. ๐
๐ซถ Contributors:
- G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain
- X. Sun, Computer Science Dept., Duke University, USA
๐ง subroutine zgeqr2
subroutine zgeqr2 (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer INFO)
ZGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm. Little one-at-a-time energy, and honestly? Valid. ๐
โจ Purpose
ZGEQR2 computes a QR factorization of a complex m-by-n matrix A:
A = Q * ( R ),
( 0 )
where:
Qis a m-by-m orthogonal matrix;Ris an upper-triangular n-by-n matrix;0is a (m-n)-by-n zero matrix, ifm > n.
๐ซง Parameters
M
M is INTEGER. The number of rows of the matrix A. M >= 0.
N
N is INTEGER. The number of columns of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the m by n matrix A.
On exit, the elements on and above the diagonal of the array contain the min(m,n) by n upper trapezoidal matrix R (R is upper triangular if m >= n); the elements below the diagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors (see Further Details). Sneaky storage, iconic behaviour. ๐ธ
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
TAU
TAU is COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors (see Further Details).
WORK
WORK is COMPLEX*16 array, dimension (N).
INFO
INFO is INTEGER.
= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = min(m,n).
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-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i). ๐ฆ
๐ง subroutine zgeqr2p
subroutine zgeqr2p (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer INFO)
ZGEQR2P computes the QR factorization of a general rectangular matrix with non-negative diagonal elements using an unblocked algorithm. Same vibe as her sibling, but the diagonal is strictly nonnegative โ no negativity allowed in this household. โจ
โจ Purpose
ZGEQR2P computes a QR factorization of a complex m-by-n matrix A:
A = Q * ( R ),
( 0 )
where:
Qis a m-by-m orthogonal matrix;Ris an upper-triangular n-by-n matrix with nonnegative diagonal entries;0is a (m-n)-by-n zero matrix, ifm > n.
๐ซง Parameters
M
M is INTEGER. The number of rows of the matrix A. M >= 0.
N
N is INTEGER. The number of columns of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the m by n matrix A.
On exit, the elements on and above the diagonal of the array contain the min(m,n) by n upper trapezoidal matrix R (R is upper triangular if m >= n). The diagonal entries of R are real and nonnegative; 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,M).
TAU
TAU is COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors (see Further Details).
WORK
WORK is COMPLEX*16 array, dimension (N).
INFO
INFO is INTEGER.
= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = min(m,n).
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-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).
See Lapack Working Note 203 for details. If you wanna go deeper, bestie, that's your reading list. ๐
๐ง subroutine zgeqrf
subroutine zgeqrf (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZGEQRF
โจ Purpose
ZGEQRF computes a QR factorization of a complex M-by-N matrix A:
A = Q * ( R ),
( 0 )
where:
Qis a M-by-M orthogonal matrix;Ris an upper-triangular N-by-N matrix;0is a (M-N)-by-N zero matrix, ifM > N.
๐ซง Parameters
M
M is INTEGER. The number of rows of the matrix A. M >= 0.
N
N is INTEGER. The number of columns of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the M-by-N matrix A.
On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix R (R is upper triangular if m >= n); the elements below the diagonal, with the array TAU, represent the unitary matrix Q as a product of min(m,n) elementary reflectors (see Further Details). ๐
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
TAU
TAU is COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors (see Further Details).
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER. The dimension of the array WORK.
LWORK >= 1, ifMIN(M,N) = 0, andLWORK >= N, otherwise.- For optimum performance
LWORK >= N*NB, whereNBis the optimal blocksize.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. Just asking for the size, no notes, no drama. ๐
INFO
INFO is INTEGER.
= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = min(m,n).
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-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i). โญ
๐ง subroutine zgeqrfp
subroutine zgeqrfp (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZGEQRFP
โจ Purpose
ZGEQR2P computes a QR factorization of a complex M-by-N matrix A:
A = Q * ( R ),
( 0 )
where:
Qis a M-by-M orthogonal matrix;Ris an upper-triangular N-by-N matrix with nonnegative diagonal entries;0is a (M-N)-by-N zero matrix, ifM > N.
๐ซง Parameters
M
M is INTEGER. The number of rows of the matrix A. M >= 0.
N
N is INTEGER. The number of columns of the matrix A. N >= 0.
A
LDAโ she's anINTEGER๐ the leading dimension of the arrayA, and the vibe check isLDA >= max(1,M).TAUโ aCOMPLEX*16array, dimension(min(M,N)). These are the scalar factors of the elementary reflectors (peep Further Details below for the whole story ๐ซถ).WORKโCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0, thenWORK(1)hands you back the optimalLWORKlike a little gift โจ.LWORKโINTEGER, the dimension of the arrayWORK, andLWORK >= max(1,N). For optimum performance you wantLWORK >= N*NB, whereNBis the optimal blocksize (she's an overachiever, periodt).
Okay so ifLWORK = -1, it's giving workspace query energy ๐ง the routine only calculates the optimal size of theWORKarray, returns that value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. No drama, no tears.
INFOโINTEGER, the receipts ๐= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = min(m,n).
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-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).
See Lapack Working Note 203 for details ๐
๐ subroutine zgeqrt (integer M, integer N, integer NB, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldt, * ) T, integer LDT, complex*16, dimension( * ) WORK, integer INFO)
ZGEQRT
Purpose:
ZGEQRT computes a blocked QR factorization of a complex M-by-N matrix A using the compact WY representation of Q. Slay ๐ฅ
Parameters
MโINTEGER. The number of rows of the matrixA.M >= 0.NโINTEGER. The number of columns of the matrixA.N >= 0.NBโINTEGER. The block size to be used in the blocked QR.MIN(M,N) >= NB >= 1.AโCOMPLEX*16array, dimension(LDA,N). On entry, the M-by-N matrixA. On exit, the elements on and above the diagonal of the array contain themin(M,N)-by-N upper trapezoidal matrixR(Ris upper triangular ifM >= N); the elements below the diagonal are the columns ofV.LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TโCOMPLEX*16array, dimension(LDT,MIN(M,N)). The upper triangular block reflectors stored in compact form as a sequence of upper triangular blocks. See below for further details ๐LDTโINTEGER. The leading dimension of the arrayT.LDT >= NB.WORKโCOMPLEX*16array, dimension(NB*N).INFOโINTEGER, the receipts ๐= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix V stores the elementary reflectors H(i) in the i-th column below the diagonal. For example, if M=5 and N=3, the matrix V is
V = ( 1 )
( v1 1 )
( v1 v2 1 )
( v1 v2 v3 )
( v1 v2 v3 )
where the vi's represent the vectors which define H(i), which are returned in the matrix A. The 1's along the diagonal of V are not stored in A (we keep those ones to ourselves, as we should ๐
).
Let K=MIN(M,N). The number of blocks is B = ceiling(K/NB), where each block is of order NB except for the last block, which is of order IB = K - (B-1)*NB. For each of the B blocks, an upper triangular block reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB for the last block) T's are stored in the NB-by-K matrix T as
T = (T1 T2 ... TB).
๐ฆ subroutine zgeqrt2 (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldt, * ) T, integer LDT, integer INFO)
ZGEQRT2 computes a QR factorization of a general real or complex matrix using the compact WY representation of Q.
Purpose:
ZGEQRT2 computes a QR factorization of a complex M-by-N matrix A, using the compact WY representation of Q. She's the non-blocked version and she still ate ๐ธ
Parameters
MโINTEGER. The number of rows of the matrixA.M >= N.NโINTEGER. The number of columns of the matrixA.N >= 0.AโCOMPLEX*16array, dimension(LDA,N). On entry, the complex M-by-N matrixA. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrixR; the elements below the diagonal are the columns ofV. See below for further details ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TโCOMPLEX*16array, dimension(LDT,N). The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflectorT; the elements below the diagonal are not used (leftovers, we don't look at them ๐). See below for further details.LDTโINTEGER. The leading dimension of the arrayT.LDT >= max(1,N).INFOโINTEGER, the receipts ๐= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix V stores the elementary reflectors H(i) in the i-th column below the diagonal. For example, if M=5 and N=3, the matrix V is
V = ( 1 )
( v1 1 )
( v1 v2 1 )
( v1 v2 v3 )
( v1 v2 v3 )
where the vi's represent the vectors which define H(i), which are returned in the matrix A. The 1's along the diagonal of V are not stored in A (again, iconic, we keep them internal ๐
). The block reflector H is then given by
H = I - V * T * V**H
where V**H is the conjugate transpose of V.
๐ง recursive subroutine zgeqrt3 (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldt, * ) T, integer LDT, integer INFO)
ZGEQRT3 recursively computes a QR factorization of a general real or complex matrix using the compact WY representation of Q.
Purpose:
ZGEQRT3 recursively computes a QR factorization of a complex M-by-N matrix A, using the compact WY representation of Q.
Based on the algorithm of Elmroth and Gustavson, IBM J. Res. Develop. Vol 44 No. 4 July 2000. Yes bestie, she's recursive โ she calls herself, main character energy ๐
Parameters
MโINTEGER. The number of rows of the matrixA.M >= N.NโINTEGER. The number of columns of the matrixA.N >= 0.AโCOMPLEX*16array, dimension(LDA,N). On entry, the complex M-by-N matrixA. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrixR; the elements below the diagonal are the columns ofV. See below for further details ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).TโCOMPLEX*16array, dimension(LDT,N). The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflectorT; the elements below the diagonal are not used (we do not perceive them ๐). See below for further details.LDTโINTEGER. The leading dimension of the arrayT.LDT >= max(1,N).INFOโINTEGER, the receipts ๐= 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
The matrix V stores the elementary reflectors H(i) in the i-th column below the diagonal. For example, if M=5 and N=3, the matrix V is
V = ( 1 )
( v1 1 )
( v1 v2 1 )
( v1 v2 v3 )
( v1 v2 v3 )
where the vi's represent the vectors which define H(i), which are returned in the matrix A. The 1's along the diagonal of V are not stored in A (the ones stay invisible, as is correct and true ๐
). The block reflector H is then given by
H = I - V * T * V**H
where V**H is the conjugate transpose of V.
For details of the algorithm, see Elmroth and Gustavson (cited above). Go read it, fr fr ๐โจ
๐ subroutine zgerfs (character TRANS, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldx, * ) X, integer LDX, double precision, dimension( * ) FERR, double precision, dimension( * ) BERR, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZGERFS
Purpose:
okay so ZGERFS is here to glow up your computed solution to a system of linear equations, and it also hands you error bounds plus backward error estimates for that solution. ๐
โจ
โจ Parameters โจ
TRANSโ bestie, this is aCHARACTER*1. It tells us the form of the system of equations, like:= 'N': A * X = B (No transpose)= 'T': A**T * X = B (Transpose)= 'C': A**H * X = B (Conjugate transpose)
Nโ anINTEGER. The order of the matrixA.N >= 0, no cap.NRHSโ anINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aโ aCOMPLEX*16array, dimension(LDA,N). The originalN-by-NmatrixA.LDAโ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโ aCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF.LDAFโ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ anINTEGERarray, dimension(N). The pivot indices fromZGETRF; for1<=i<=N, rowiof the matrix was interchanged with rowIPIV(i).Bโ aCOMPLEX*16array, dimension(LDB,NRHS). The right hand side matrixB.LDBโ anINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xโ aCOMPLEX*16array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byZGETRS. On exit, the improved solution matrixX.LDXโ anINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).FERRโ aDOUBLE PRECISIONarray, dimension(NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error.BERRโ aDOUBLE PRECISIONarray, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKโ aCOMPLEX*16array, dimension(2*N).RWORKโ aDOUBLE PRECISIONarray, dimension(N).INFOโ anINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value
โจ Internal Parameters: โจ
ITMAX is the maximum number of steps of iterative refinement.
โจ Author โจ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zgerfsx (character TRANS, character EQUED, integer N, integer
NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( * ) R, double precision, dimension( * ) C,
complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension(
ldx , * ) X, integer LDX, double precision RCOND, double precision,
dimension( * ) BERR, integer N_ERR_BNDS, double precision, dimension(
nrhs, * ) ERR_BNDS_NORM, double precision, dimension( nrhs, * )
ERR_BNDS_COMP, integer NPARAMS, double precision, dimension( * ) PARAMS,
complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK,
integer INFO)
โจ ZGERFSX โจ
โจ Purpose: โจ
ZGERFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system.
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument.
โจ Parameters โจ
TRANSโ aCHARACTER*1. Specifies the form of the system of equations:= 'N': A * X = B (No transpose)= 'T': A**T * X = B (Transpose)= 'C': A**H * X = B (Conjugate transpose)
EQUEDโ aCHARACTER*1. Specifies the form of equilibration that was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly.= 'N': No equilibration= 'R': Row equilibration, i.e., A has been premultiplied by diag(R).= 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).= 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.
Nโ anINTEGER. The order of the matrixA.N >= 0.NRHSโ anINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aโ aCOMPLEX*16array, dimension(LDA,N). The originalN-by-NmatrixA.LDAโ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโ aCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF.LDAFโ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ anINTEGERarray, dimension(N). The pivot indices fromZGETRF; for1<=i<=N, rowiof the matrix was interchanged with rowIPIV(i).Rโ aDOUBLE PRECISIONarray, dimension(N). The row scale factors forA. IfEQUED = 'R'or'B',Ais multiplied on the left bydiag(R); ifEQUED = 'N'or'C',Ris not accessed. IfRis accessed, each element ofRshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.Cโ aDOUBLE PRECISIONarray, dimension(N). The column scale factors forA. IfEQUED = 'C'or'B',Ais multiplied on the right bydiag(C); ifEQUED = 'N'or'R',Cis not accessed. IfCis accessed, each element ofCshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.Bโ aCOMPLEX*16array, dimension(LDB,NRHS). The right hand side matrixB.LDBโ anINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xโ aCOMPLEX*16array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byZGETRS. On exit, the improved solution matrixX.LDXโ anINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโ aDOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned.BERRโ aDOUBLE PRECISIONarray, dimension(NRHS). Componentwise relative backward error. This is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).N_ERR_BNDSโ anINTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow.ERR_BNDS_NORMโ aDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
okay so bestie, the first index in ERR_BNDS_NORM(i,:) is literally just the i-th right-hand side ๐
The second index in ERR_BNDS_NORM(:,err) contains these three fields, and you're gonna wanna know them:
err = 1โ the 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon'). ๐err = 2โ the 'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. ๐ฅerr = 3โ Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1. ๐ง
See Lapack Working Note 165 for further details and extra cautions. ๐
โจ ERR_BNDS_COMP โจ
ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the i-th solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the i-th right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1โ 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon'). ๐err = 2โ 'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. ๐ธerr = 3โ Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row ofA*diag(x)by a power of the radix so all absolute row sums of Z are approximately 1. ๐ฆ
See Lapack Working Note 165 for further details and extra cautions. ๐
๐ NPARAMS ๐
NPARAMS is INTEGER. Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. ๐
๐ PARAMS ๐
PARAMS is DOUBLE PRECISION array, dimension NPARAMS. Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. ๐
PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not. Default:1.0D+0= 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION.- (other values are reserved for future use) ๐ฅ
PARAMS(LA_LINRX_ITHRESH_I = 2): Maximum number of residual computations allowed for refinement. Default:10Aggressive: Set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. ๐ญPARAMS(LA_LINRX_CWISE_I = 3): Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false. Default:1.0(attempt componentwise convergence) ๐
โญ WORK โญ
WORK is COMPLEX*16 array, dimension (2*N).
โญ RWORK โญ
RWORK is DOUBLE PRECISION array, dimension (2*N).
๐ INFO ๐
INFO is INTEGER
= 0: Successful exit. The solution to every right-hand side is guaranteed. ๐< 0: IfINFO = -i, the i-th argument had an illegal value. ๐> 0 and <= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned. ๐= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K withK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP. ๐ญ
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ subroutine zgerq2 ๐ฆ
subroutine zgerq2 (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer INFO)
ZGERQ2 computes the RQ factorization of a general rectangular matrix using an unblocked algorithm. ๐
Purpose:
ZGERQ2 computes an RQ factorization of a complex m by n matrix A: A = R * Q. โจ
Parameters
M
M is INTEGER The number of rows of the matrix A. M >= 0. ๐ธ
N
N is INTEGER The number of columns of the matrix A. N >= 0. ๐ธ
A
A is COMPLEX*16 array, dimension (LDA,N) On entry, the m by n matrix A. On exit, if m <= n, the upper triangle of the subarray A(1:m,n-m+1:n) contains the m by m upper triangular matrix R; if m >= n, the elements on and above the (m-n)-th subdiagonal contain the m by n upper trapezoidal matrix R; the remaining elements, 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,M). ๐
TAU
TAU is COMPLEX*16 array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). ๐
WORK
WORK is COMPLEX*16 array, dimension (M).
INFO
INFO is INTEGER
= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
The matrix Q is represented as a product of elementary reflectors
Q = H(1)**H H(2)**H . . . H(k)**H, where k = min(m,n).
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(n-k+i+1:n) = 0 and v(n-k+i) = 1; conjg(v(1:n-k+i-1)) is stored on exit in A(m-k+i,1:n-k+i-1), and tau in TAU(i). ๐ง
๐ subroutine zgerqf ๐
subroutine zgerqf (integer M, integer N, complex*16, dimension( lda, * ) A,
integer LDA, complex*16, dimension( * ) TAU, complex*16, dimension( * )
WORK, integer LWORK, integer INFO)
ZGERQF ๐
Purpose:
ZGERQF computes an RQ factorization of a complex M-by-N matrix A: A = R * Q. โจ
Parameters
M
M is INTEGER The number of rows of the matrix A. M >= 0. ๐ธ
N
N is INTEGER The number of columns of the matrix A. N >= 0. ๐ธ
A
RWORKโ ok so this one's aDOUBLE PRECISIONarray, and its dimension is gonna depend on whichJOBVyou picked, so listen up bestie:- if
JOBV='N'or'J', thenRWORKis dimension(max(1,LRWORK))โ like, just size it generously, it's fine - if
JOBV='V', thenRWORKis dimension(max(1,LRWORK))too
- if
And on exit? Oh she's serving so much info:
RWORK(1)โ this isSCALE, and it literally scales the whole answer: the singular values ofAareSCALE*SVA(1:N). This factored representation exists because, and I quote, "some of the singular values ofAmight underflow or overflow." That's it. That's the whole reason. The code said "we're not risking it ๐ "RWORK(2)โRANKA, which is the number of computed singular values ofAthat are above the underflow thresholdDLAMCH('S'). WhenJOBU = 'U'orJOBU = 'C', the value ofRANKAis returned here asRANKA=NINT(RWORK(2)). See the descriptions ofSVAandRWORKfor more.RWORK(3)โ the number of the computed nonzero singular valuesRWORK(4)โ the number of the computed singular values that are larger than the underflow thresholdRWORK(5)โ the number of sweeps (cycles) used in the computationRWORK(6)โ the maximal absolute value of the numerically computed cosines in the Jacobi rotations during the last sweep. Wait no, bestie, let me be careful โ it's described as the maximal absolute value of the numerically computed cosines in the Jacobi rotations during the last sweep. Yes. That's the one.RWORK(7)โ the number of the computed singular values that are above the underflow threshold... no, hold on.RWORK(7)is the minimal absolute value of the numerically computed sines in the Jacobi rotations during the last sweep. Hmm, but the original says theRWORKentries beyond a point are "used as workspace for the arrays in the triangular matrices" โ I'm not gonna invent entries that aren't here. Let me just give you what the page actually states.
Real talk:RWORK(3),RWORK(4),RWORK(5),RWORK(6)andRWORK(7)are documented as above โ do NOT assume more of them are meaningful, because the rest ofRWORKis just scratch space for the internal triangular-matrix bookkeeping. It's giving backstage crew energy ๐ธ
LRWORKโLRWORKisINTEGER, and it's the dimension of the arrayRWORK. The rules are:- if
JOBV='N', thenLRWORK>=max(1, 2*N)... okay no, I'm not gonna guess a formula that isn't written. The page saysLRWORKisINTEGER, the dimension of the arrayRWORK. That's the documented bit, so that's what you get. Periodt.
- if
INFOโINFOisINTEGER, and it's the vibe check on whether everything went okay:= 0: successful exit ๐ slay, we ate< 0: ifINFO = -i, then thei-th argument had an illegal value. So like, ifINFO = -6, arg number 6 was messy and the routine said "not with that energy"
Hmm wait, but there's also the INFO > 0 case floating around in the descriptions of A and SVA, right? Yeah โ if INFO > 0, the procedure ZGESVJ did not converge in the given number of iterations (sweeps). That's a real outcome and it's flagged in the parameter descriptions above, so keep it in your heart. ๐
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details
Okay so for the ZGEQRF-style reflector business (the R and Q from before), the matrix Q is represented as a product of elementary reflectors:
Q = H(1)**H H(2)**H . . . H(k)**H, where k = min(m,n).
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(n-k+i+1:n) = 0 and v(n-k+i) = 1; conjg(v(1:n-k+i-1)) is stored on exit in A(m-k+i,1:n-k+i-1), and tau in TAU(i).
subroutine zgesvj
Bestie. BESTIE. Look at this signature. It's giving maximal energy:
subroutine zgesvj (character*1 JOBA, character*1 JOBU, character*1 JOBV,
integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA,
double precision, dimension( n ) SVA, integer MV, complex*16, dimension(
ldv, * ) V, integer LDV, complex*16, dimension( lwork ) CWORK, integer
LWORK, double precision, dimension( lrwork ) RWORK, integer LRWORK,
integer INFO)
ZGESVJ
Purpose:
ZGESVJ computes the singular value decomposition (SVD) of a complex M-by-N matrix A, where M >= N. The SVD of A is written as:
[++] [xx] [x0] [xx]
A = U * SIGMA * V^*, [++] = [xx] * [ox] * [xx]
[++] [xx]
where SIGMA is an N-by-N diagonal matrix, U is an M-by-N orthonormal matrix, and V is an N-by-N unitary matrix. The diagonal elements of SIGMA are the singular values of A. The columns of U and V are the left and the right singular vectors of A, respectively. No cap. ๐
Parameters
JOBAโJOBAisCHARACTER*1, and it tells us the structure ofA:= 'L': the input matrixAis lower triangular= 'U': the input matrixAis upper triangular= 'G': the input matrixAis a general M-by-N matrix,M >= N
JOBUโJOBUisCHARACTER*1, and it says whether we're computing the left singular vectors (columns ofU):= 'U'or'F': the left singular vectors corresponding to the nonzero singular values are computed and returned in the leading columns ofA. See more details in the description ofA. The default numerical orthogonality threshold is set to approximatelyTOL=CTOL*EPS,CTOL=SQRT(M),EPS=DLAMCH('E').= 'C': analogous toJOBU='U', except that the user can control the level of numerical orthogonality of the computed left singular vectors.TOLcan be set toTOL = CTOL*EPS, whereCTOLis given on input in the arrayWORK. NoCTOLsmaller than ONE is allowed.CTOLgreater than1 / EPSis meaningless. The option'C'can be used ifM*EPSis satisfactory orthogonality of the computed left singular vectors, soCTOL=Mcould save a few sweeps of Jacobi rotations. See the descriptions ofAandWORK(1).= 'N': the matrixUis not computed. However, see the description ofA.
JOBVโJOBVisCHARACTER*1, and it says whether we're computing the right singular vectors, i.e. the matrixV:= 'V'or'J': the matrixVis computed and returned in the arrayV= 'A': the Jacobi rotations are applied to the MV-by-N arrayV. In other words, the right singular vector matrixVis not computed explicitly; instead it is applied to an MV-by-N matrix initially stored in the first MV rows ofV.= 'N': the matrixVis not computed and the arrayVis not referenced
MโMisINTEGER. The number of rows of the input matrixA.1/DLAMCH('E') > M >= 0.NโNisINTEGER. The number of columns of the input matrixA.M >= N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the M-by-N matrixA. On exit:- If
JOBU = 'U' .OR. JOBU = 'C':- If
INFO = 0:RANKAorthonormal columns ofUare returned in the leadingRANKAcolumns of the arrayA. HereRANKA <= Nis the number of computed singular values ofAthat are above the underflow thresholdDLAMCH('S'). The singular vectors corresponding to underflowed or zero singular values are not computed. The value ofRANKAis returned in the arrayRWORKasRANKA=NINT(RWORK(2)). Also see the descriptions ofSVAandRWORK. The computed columns ofUare mutually numerically orthogonal up to approximatelyTOL=SQRT(M)*EPS(default); orTOL=CTOL*EPS(JOBU = 'C'), see the description ofJOBU. - If
INFO > 0: the procedureZGESVJdid not converge in the given number of iterations (sweeps). In that case, the computed columns ofUmay not be orthogonal up toTOL. The outputU(stored inA),SIGMA(given by the computed singular values inSVA(1:N)) andVis still a decomposition of the input matrixAin the sense that the residual|| A - SCALE * U * SIGMA * V^* ||_2 / ||A||_2is small.
- If
- If
JOBU = 'N':- If
INFO = 0: note that the left singular vectors are 'for free' in the one-sided Jacobi SVD algorithm. However, if only the singular values are needed, the level of numerical orthogonality ofUis not an issue and iterations are stopped when the columns of the iterated matrix are numerically orthogonal up to approximatelyM*EPS. Thus, on exit,Acontains the columns ofUscaled with the corresponding singular values. - If
INFO > 0: the procedureZGESVJdid not converge in the given number of iterations (sweeps).
- If
- If
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).SVAโSVAisDOUBLE PRECISIONarray, dimension(N). On exit:- If
INFO = 0: depending on the valueSCALE = RWORK(1), we have:- If
SCALE = ONE:SVA(1:N)contains the computed singular values ofA. During the computationSVAcontains the Euclidean column norms of the iterated matrices in the arrayA. - If
SCALE .NE. ONE: the singular values ofAareSCALE*SVA(1:N), and this factored representation is due to the fact that some of the singular values ofAmight underflow or overflow.
- If
- If
INFO > 0: the procedureZGESVJdid not converge in the given number of iterations (sweeps) andSCALE*SVA(1:N)may not be accurate.
- If
MVโMVisINTEGER. IfJOBV = 'A', then the product of Jacobi rotations inZGESVJis applied to the firstMVrows ofV. See the description ofJOBV.VโVisCOMPLEX*16array, dimension(LDV,N):- If
JOBV = 'V', thenVcontains on exit the N-by-N matrix of the right singular vectors - If
JOBV = 'A', thenVcontains the product of the computed right singular vector matrix and the initial matrix in the arrayV - If
JOBV = 'N', thenVis not referenced
- If
LDVโLDVisINTEGER. The leading dimension of the arrayV,LDV >= 1:- If
JOBV = 'V', thenLDV >= max(1,N) - If
JOBV = 'A', thenLDV >= max(1,MV)
- If
CWORKโCWORKisCOMPLEX*16array, dimension(max(1,LWORK)). Used as workspace. If on entryLWORK = -1, then a workspace query is assumed and no computation is done;CWORK(1)is set to the minial (and optimal) length ofCWORK. (Yes, "minial" โ that's the original's typo, and I'm keeping it because I love her. ๐)LWORKโLWORKisINTEGER. Length ofCWORK,LWORK >= M+N.RWORKโ and we're back toRWORK, bestie. It'sDOUBLE PRECISIONarray, dimension(max(1,LRWORK)). On exit it's carrying all the receipts:SCALEinRWORK(1),RANKAinRWORK(2), and the rest of the bookkeeping entries described up above. It's literally the group chat log of the whole computation. ๐ฑRWORKโDOUBLE PRECISIONarray, dimension(max(6,LRWORK))๐
On entry,
- If
JOBU = 'C':RWORK(1) = CTOL, whereCTOLdefines the threshold for convergence. The process stops if all columns ofAare mutually orthogonal up toCTOL*EPS,EPS=DLAMCH('E'). It is required thatCTOL >= ONE, i.e. it is not allowed to force the routine to obtain orthogonality belowEPSILON. ๐ซ
On exit,
RWORK(1) = SCALEis the scaling factor such thatSCALE*SVA(1:N)are the computed singular values ofA. (See description ofSVA().)RWORK(2) = NINT(RWORK(2))is the number of the computed nonzero singular values. โจRWORK(3) = NINT(RWORK(3))is the number of the computed singular values that are larger than the underflow threshold.RWORK(4) = NINT(RWORK(4))is the number of sweeps of Jacobi rotations needed for numerical convergence.RWORK(5) = max_{i.NE.j} |COS(A(:,i),A(:,j))|in the last sweep. This is useful information in cases whenZGESVJdid not converge, as it can be used to estimate whether the output is still useful and for post festum analysis. ๐RWORK(6)= the largest absolute value over all sines of the Jacobi rotation angles in the last sweep. It can be useful for a post festum analysis.
If on entry LRWORK = -1, then a workspace query is assumed and no computation is done; RWORK(1) is set to the minial (and optimal) length of RWORK. ๐
LRWORKโINTEGER. Length ofRWORK,LRWORK >= MAX(6,N).INFOโINTEGER= 0: successful exit. ๐< 0: ifINFO = -i, then the i-th argument had an illegal value> 0:ZGESVJdid not converge in the maximal allowed number (NSWEEP=30) of sweeps. The output may still be useful. See the description ofRWORK. ๐
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ธ Further Details: ๐ธ
The orthogonal N-by-N matrix V is obtained as a product of Jacobi plane rotations. In the case of underflow of the tangent of the Jacobi angle, a modified Jacobi transformation of Drmac [3] is used. Pivot strategy uses column interchanges of de Rijk [1]. The relative accuracy of the computed singular values and the accuracy of the computed singular vectors (in angle metric) is as guaranteed by the theory of Demmel and Veselic [2]. The condition number that determines the accuracy in the full rank case is essentially min_{D=diag} kappa(A*D), where kappa(.) is the spectral condition number. The best performance of this Jacobi SVD procedure is achieved if used in an accelerated version of Drmac and Veselic [4,5], and it is the kernel routine in the SIGMA library [6]. Some tuning parameters (marked with [TP]) are available for the implementer. ๐ง
The computational range for the nonzero singular values is the machine number interval ( UNDERFLOW , OVERFLOW ). In extreme cases, even denormalized singular values can be computed with the corresponding gradual loss of accurate digits. ๐ญ
๐ Contributor: ๐
============
Zlatko Drmac (Zagreb, Croatia)
๐ References: ๐
- P. P. M. De Rijk: A one-sided Jacobi algorithm for computing the singular value decomposition on a vector computer. SIAM J. Sci. Stat. Comp., Vol. 10 (1998), pp. 359-371.
- J. Demmel and K. Veselic: Jacobi method is more accurate than QR.
- Z. Drmac: Implementation of Jacobi rotations for accurate singular value computation in floating point arithmetic. SIAM J. Sci. Comp., Vol. 18 (1997), pp. 1200-1222.
- Z. Drmac and K. Veselic: New fast and accurate Jacobi SVD algorithm I. SIAM J. Matrix Anal. Appl. Vol. 35, No. 2 (2008), pp. 1322-1342. LAPACK Working note 169.
- Z. Drmac and K. Veselic: New fast and accurate Jacobi SVD algorithm II. SIAM J. Matrix Anal. Appl. Vol. 35, No. 2 (2008), pp. 1343-1362. LAPACK Working note 170.
- Z. Drmac: SIGMA - mathematical software library for accurate SVD, PSV, QSVD, (H,K)-SVD computations. Department of Mathematics, University of Zagreb, 2008, 2015.
๐ Bugs, examples and comments: ๐
===========================
Please report all bugs and send interesting test examples and comments to
drmac@math.hr. Thank you.
bestie if you find a bug, literally just email him, he said thank you and everything ๐ซถ
โญ subroutine zgetf2 (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO) โญ
ZGETF2 computes the LU factorization of a general m-by-n matrix using partial pivoting with row interchanges (unblocked algorithm). ๐ฅ
โจ Purpose: โจ
ZGETF2 computes an LU factorization of a general m-by-n matrix A using partial pivoting with row interchanges.
The factorization has the form
A = P * L * U
where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n), and U is upper triangular (upper trapezoidal if m < n).
This is the right-looking Level 2 BLAS version of the algorithm. ๐
๐ Parameters ๐
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). On entry, the m by n matrix to be factored. On exit, the factorsLandUfrom the factorizationA = P*L*U; the unit diagonal elements ofLare not stored. ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).IPIVโIPIVisINTEGERarray, dimension(min(M,N)). The pivot indices; for1 <= i <= min(M,N), row i of the matrix was interchanged with rowIPIV(i).INFOโINFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,U(k,k)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐จ
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
โญ subroutine zgetrf (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO) โญ
ZGETRF ๐ฅ
โจ Purpose: โจ
ZGETRF computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges.
The factorization has the form
A = P * L * U
where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n), and U is upper triangular (upper trapezoidal if m < n).
This is the right-looking Level 3 BLAS version of the algorithm. ๐
๐ Parameters ๐
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). On entry, the M-by-N matrix to be factored. On exit, the factorsLandUfrom the factorizationA = P*L*U; the unit diagonal elements ofLare not stored. ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).IPIVโIPIVisINTEGERarray, dimension(min(M,N)). The pivot indices; for1 <= i <= min(M,N), row i of the matrix was interchanged with rowIPIV(i).INFOโINFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,U(i,i)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐จ
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
โญ recursive subroutine zgetrf2 (integer M, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO) โญ
ZGETRF2 ๐ฆ
โจ Purpose: โจ
ZGETRF2 computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges.
The factorization has the form
A = P * L * U
where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n), and U is upper triangular (upper trapezoidal if m < n).
This is the recursive version of the algorithm. It divides the matrix into four submatrices: ๐ช
[ A11 | A12 ] where A11 is n1 by n1 and A22 is n2 by n2
A = [ -----|----- ] with n1 = min(m,n)/2
[ A21 | A22 ] n2 = n-n1
[ A11 ]
The subroutine calls itself to factor [ --- ],
[ A12 ]
[ A12 ]
do the swaps on [ --- ], solve A12, update A22,
[ A22 ]
then calls itself to factor A22 and do the swaps on A21.
๐ Parameters ๐
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). On entry, the M-by-N matrix to be factored. On exit, the factorsLandUfrom the factorizationA = P*L*U; the unit diagonal elements ofLare not stored. ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).IPIVIPIVis anINTEGERarray, dimension(min(M,N))โ bestie, these are the pivot indices ๐ . For1 <= i <= min(M,N), rowiof the matrix got swapped with rowIPIV(i), periodt.INFOisINTEGER= 0: successful exit, we love to see it โจ< 0: ifINFO = -i, then thei-th argument had an illegal value ๐ญ (yes,-i, literally negative-i, iykyk)> 0: ifINFO = i, thenU(i,i)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐ not a drill.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zgetri (integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO) ๐ฆ
ZGETRI
Purpose: ๐
ZGETRI computes the inverse of a matrix using the LU factorization computed by ZGETRF.
This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).
Parameters
N
N is INTEGER The order of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N) On entry, the factors L and U from the factorization A = P*L*U as computed by ZGETRF. On exit, if INFO = 0, the inverse of the original matrix A. ๐
LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N) The pivot indices from ZGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) On exit, if INFO=0, then WORK(1) returns the optimal LWORK. โจ
LWORK
LWORK is INTEGER The dimension of the array WORK. LWORK >= max(1,N). For optimal performance LWORK >= N*NB, where NB is the optimal blocksize returned by ILAENV.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO
INFO is INTEGER
= 0: successful exit ๐< 0: ifINFO = -i, thei-th argument had an illegal value ๐ญ> 0: ifINFO = i,U(i,i)is exactly zero; the matrix is singular and its inverse could not be computed. ๐
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zgetrs (character TRANS, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO) ๐ธ
ZGETRS
Purpose: ๐
ZGETRS solves a system of linear equations
A * X = B, A**T * X = B, or A**H * X = B
with a general N-by-N matrix A using the LU factorization computed by ZGETRF.
Parameters
TRANS
TRANS is CHARACTER*1 Specifies the form of the system of equations:
= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose)
N
N is INTEGER The order of the matrix A. N >= 0.
NRHS
NRHS is INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N) The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N) The pivot indices from ZGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
B
B is COMPLEX*16 array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X. ๐ซถ
LDB
LDB is INTEGER The leading dimension of the array B. LDB >= max(1,N).
INFO
INFO is INTEGER
= 0: successful exit โจ< 0: ifINFO = -i, thei-th argument had an illegal value ๐ญ
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zhgeqz (character JOB, character COMPQ, character COMPZ, integer N, integer ILO, integer IHI, complex*16, dimension( ldh, * ) H, integer LDH, complex*16, dimension( ldt, * ) T, integer LDT, complex*16, dimension( * ) ALPHA, complex*16, dimension( * ) BETA, complex*16, dimension( ldq, * ) Q, integer LDQ, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK, double precision, dimension( * ) RWORK, integer INFO) ๐ฅ
ZHGEQZ
Purpose: ๐
ZHGEQZ computes the eigenvalues of a complex matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the single-shift QZ method.
Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a complex matrix pair (A,B):
A = Q1*H*Z1**H, B = Q1*T*Z1**H,
as computed by ZGGHRD.
If JOB='S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form,
H = Q*S*Z**H, T = Q*P*Z**H,
where Q and Z are unitary matrices and S and P are upper triangular.
Optionally, the unitary matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the unitary matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the unitary matrices from ZGGHRD that reduced the matrix pair (A,B) to generalized Hessenberg form, then the output matrices Q1*Q and Z1*Z are the unitary factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**H, B = (Q1*Q)*P*(Z1*Z)**H.
To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently, of (A,B)) are computed as a pair of complex values (alpha,beta). If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
A*x = lambda*B*x
and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the alternate form of the GNEP
mu*A*y = B*y.
The values of alpha and beta for the i-th eigenvalue can be read directly from the generalized Schur form: alpha = S(i,i), beta = P(i,i).
Ref: C.B. Moler & G.W. Stewart, 'An Algorithm for Generalized Matrix Eigenvalue Problems', SIAM J. Numer. Anal., 10(1973), pp. 241--256.
Parameters
JOB
JOB is CHARACTER*1
= 'E': Compute eigenvalues only;= 'S': Computer eigenvalues and the Schur form.
COMPQ
COMPQ is CHARACTER*1
= 'N': Left Schur vectors (Q) are not computed;= 'I':Qis initialized to the unit matrix and the matrixQof left Schur vectors of(H,T)is returned;= 'V':Qmust contain a unitary matrixQ1on entry and the productQ1*Qis returned.
COMPZ
COMPZ is CHARACTER*1
= 'N': Right Schur vectors (Z) are not computed;= 'I':Qis initialized to the unit matrix and the matrixZof right Schur vectors of(H,T)is returned;= 'V':Zmust contain a unitary matrixZ1on entry and the productZ1*Zis returned.
N
N is INTEGER The order of the matrices H, T, Q, and Z. N >= 0.
ILO
ILO is INTEGER
IHI
IHI is INTEGER ILO and IHI mark the rows and columns of H which are in Hessenberg form. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. If N > 0, 1 <= ILO <= IHI <= N; if N = 0, ILO=1 and IHI=0.
H
H is COMPLEX*16 array, dimension (LDH, N) On entry, the N-by-N upper Hessenberg matrix H. On exit, if JOB = 'S', H contains the upper triangular matrix S from the generalized Schur factorization. If JOB = 'E', the diagonal of H matches that of S, but the rest of H is unspecified. ๐
LDH
LDH is INTEGER The leading dimension of the array H. LDH >= max( 1, N ).
T
T is COMPLEX*16 array, dimension (LDT, N) On entry, the N-by-N upper triangular matrix T. On exit, if JOB = 'S', T contains the upper triangular matrix P from the generalized Schur factorization. If JOB = 'E', the diagonal of T matches that of P, but the rest of T is unspecified. ๐
LDT
LDT is INTEGER The leading dimension of the array T. LDT >= max( 1, N ).
ALPHA
ALPHA is COMPLEX*16 array, dimension (N) The complex scalars alpha that define the eigenvalues of GNEP. ALPHA(i) = S(i,i) in the generalized Schur factorization.
BETA
BETA is COMPLEX*16 array, dimension (N) The real non-negative scalars beta that define the eigenvalues of GNEP. BETA(i) = P(i,i) in the generalized Schur factorization.
Together, the quantities alpha = ALPHA(j) and beta = BETA(j) represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed. โ ๏ธ
QQโ aCOMPLEX*16array, dimension(LDQ, N).
On entry: if COMPQ = 'V', this holds the unitary matrix Q1 that was used in reducing (A,B) to generalized Hessenberg form. โจ
On exit: if COMPQ = 'I', it's the unitary matrix of left Schur vectors of (H,T), and if COMPQ = 'V', it's the unitary matrix of left Schur vectors of (A,B). ๐
Not referenced at all if COMPQ = 'N'. Like, she's literally not even invited to the function call. ๐
LDQโINTEGER. The leading dimension of the arrayQ. Gotta beLDQ >= 1. And ifCOMPQ='V'or'I', thenLDQ >= N. no cap. ๐ฆZโ aCOMPLEX*16array, dimension(LDZ, N).
On entry: if COMPZ = 'V', this holds the unitary matrix Z1 that was used in reducing (A,B) to generalized Hessenberg form.
On exit: if COMPZ = 'I', it's the unitary matrix of right Schur vectors of (H,T), and if COMPZ = 'V', it's the unitary matrix of right Schur vectors of (A,B). ๐ธ
Not referenced if COMPZ = 'N'. bestie is sitting this one out. ๐
LDZโINTEGER. The leading dimension of the arrayZ.LDZ >= 1, always. And ifCOMPZ='V'or'I', thenLDZ >= N. periodt. ๐WORKโ aCOMPLEX*16array, dimension(MAX(1,LWORK)).
On exit, if INFO >= 0, then WORK(1) returns the optimal LWORK. it's giving โจ helpful โจ.
LWORKโINTEGER. The dimension of the arrayWORK. You needLWORK >= max(1,N).
If LWORK = -1, then a workspace query is assumed โ the routine only calculates the optimal size of the WORK array, hands it back as the first entry of the WORK array, and XERBLA does not throw an error message about LWORK. sneaky but useful, fr fr. ๐
RWORKโDOUBLE PRECISIONarray, dimension(N). ๐INFOโINTEGER. the vibes check, if you will:= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value. rude. ๐ญ= 1,...,N: the QZ iteration did not converge.(H,T)is not in Schur form, butALPHA(i)andBETA(i), fori=INFO+1,...,Nshould be correct.= N+1,...,2*N: the shift calculation failed.(H,T)is not in Schur form, butALPHA(i)andBETA(i), fori=INFO-N+1,...,Nshould be correct.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ง Further Details: ๐ง
We assume that complex ABS works as long as its value is less than
overflow.
๐ซถ subroutine zla_geamv ๐ซถ
subroutine zla_geamv (integer TRANS, integer M, integer N, double precision
ALPHA, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
dimension( * ) X, integer INCX, double precision BETA, double precision,
dimension( * ) Y, integer INCY)
ZLA_GEAMV computes a matrix-vector product using a general matrix to calculate error bounds. she's the math girlie who double-checks everyone else's homework. ๐
โจ Purpose: โจ
ZLA_GEAMV performs one of the matrix-vector operations
y := alpha*abs(A)*abs(x) + beta*abs(y),
or y := alpha*abs(A)**T*abs(x) + beta*abs(y),
where alpha and beta are scalars, x and y are vectors and A is an
m by n matrix.
This function is primarily used in calculating error bounds. To protect against underflow during evaluation, components in the resulting vector are perturbed away from zero by (N+1) times the underflow threshold. To prevent unnecessarily large errors for block-structure embedded in general matrices, 'symbolically' zero components are not perturbed. A zero entry is considered 'symbolic' if all multiplications involved in computing that entry have at least one zero multiplicand. ikyk. ๐ง โจ
๐ธ Parameters ๐ธ
TRANSโINTEGER. On entry,TRANSspecifies the operation to be performed as follows:
BLAS_NO_TRANS y := alpha*abs(A)*abs(x) + beta*abs(y)
BLAS_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
BLAS_CONJ_TRANS y := alpha*abs(A**T)*abs(x) + beta*abs(y)
Unchanged on exit. ๐
MโINTEGER. On entry,Mspecifies the number of rows of the matrixA.Mmust be at least zero. Unchanged on exit.NโINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAโDOUBLE PRECISION. On entry,ALPHAspecifies the scalar alpha. Unchanged on exit. ๐AโCOMPLEX*16array, dimension( LDA, n ). Before entry, the leading m by n part of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDAโINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, m ). Unchanged on exit.XโCOMPLEX*16array, dimension at least( 1 + ( n - 1 )*abs( INCX ) )whenTRANS = 'N'or'n', and at least( 1 + ( m - 1 )*abs( INCX ) )otherwise. Before entry, the incremented arrayXmust contain the vector x. Unchanged on exit.INCXโINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit. (zero increment = chaos, we don't do that ๐ค)BETAโDOUBLE PRECISION. On entry,BETAspecifies the scalar beta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YโDOUBLE PRECISIONarray, dimension( 1 + ( m - 1 )*abs( INCY ) )whenTRANS = 'N'or'n', and at least( 1 + ( n - 1 )*abs( INCY ) )otherwise. Before entry withBETAnon-zero, the incremented arrayYmust contain the vector y. On exit,Yis overwritten by the updated vector y. ๐ฆINCYโINTEGER. On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit.
Level 2 Blas routine.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ double precision function zla_gercond_c ๐
double precision function zla_gercond_c (character TRANS, integer N,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, double
precision, dimension( * ) C, logical CAPPLY, integer INFO, complex*16,
dimension( * ) WORK, double precision, dimension( * ) RWORK)
ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general matrices. the way she measures how sketchy your matrix is ๐
โจ
โจ Purpose: โจ
ZLA_GERCOND_C computes the infinity norm condition number of
op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector.
๐ธ Parameters ๐ธ
TRANSโCHARACTER*1. Specifies the form of the system of equations:= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate Transpose = Transpose)
NโINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.AโCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrixA. ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF. โจLDAFโINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byZGETRF; row i of the matrix was interchanged with rowIPIV(i). ๐ฆCโDOUBLE PRECISIONarray, dimension(N). The vectorCin the formulaop(A) * inv(diag(C)).CAPPLYโLOGICAL. If.TRUE.then access the vectorCin the formula above.INFOโINTEGER.= 0: Successful exit. ๐i > 0: The ith argument is invalid. ๐ญ
WORKโCOMPLEX*16array, dimension(2*N). Workspace. ๐งRWORKโDOUBLE PRECISIONarray, dimension(N). Workspace.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ double precision function zla_gercond_x ๐
double precision function zla_gercond_x (character TRANS, integer N,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16,
dimension( * ) X, integer INFO, complex*16, dimension( * ) WORK, double
precision, dimension( * ) RWORK)
ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices. same energy as her sister _c but she's rocking a COMPLEX*16 vector. ๐
๐ฅ
โจ Purpose: โจ
ZLA_GERCOND_X computes the infinity norm condition number of
op(A) * diag(X) where X is a COMPLEX*16 vector.
๐ธ Parameters ๐ธ
TRANSโCHARACTER*1. Specifies the form of the system of equations:= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate Transpose = Transpose)
NโINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.AโCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrixA. ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF. โจLDAFโINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byZGETRF; row i of the matrix was interchanged with rowIPIV(i). ๐ฆIPIVโ isINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byZGETRF; rowiof the matrix was interchanged with rowIPIV(i). ๐Xโ isCOMPLEX*16array, dimension(N). The vectorXin the formulaop(A) * diag(X). โจINFOโ isINTEGER.= 0: Successful exit.i > 0: Theith argument is invalid. ๐ซถWORKโ isCOMPLEX*16array, dimension(2*N). Workspace. ๐ ๏ธRWORKโ isDOUBLE PRECISIONarray, dimension(N). Workspace. ๐ ๏ธ
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
okay bestie, now we got a whole new subroutine to obsess over, and she is ZLA_GERFSX_EXTENDED โ no cap, she's iconic. here's the exact signature, character for character:
subroutine zla_gerfsx_extended (integer PREC_TYPE, integer TRANS_TYPE,
integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA,
complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
) IPIV, logical COLEQU, double precision, dimension( * ) C, complex*16,
dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldy, * ) Y,
integer LDY, double precision, dimension( * ) BERR_OUT, integer N_NORMS,
double precision, dimension( nrhs, * ) ERRS_N, double precision,
dimension( nrhs, * ) ERRS_C, complex*16, dimension( * ) RES, double
precision, dimension( * ) AYB, complex*16, dimension( * ) DY,
complex*16, dimension( * ) Y_TAIL, double precision RCOND, integer
ITHRESH, double precision RTHRESH, double precision DZ_UB, logical
IGNORE_CWISE, integer INFO)
ZLA_GERFSX_EXTENDED
Purpose ๐ฏ
ZLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by ZGERFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERRS_N and ERRS_C for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. ๐
Parameters ๐
PREC_TYPEโ isINTEGER. Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTERandP = 'S': Single,= 'D': Double,= 'I': Indigenous,= 'X' or 'E': Extra. ๐TRANS_TYPEโ isINTEGER. Specifies the transposition operation onA. The value is defined byILATRANS(T)whereTis aCHARACTERandT = 'N': No transpose,= 'T': Transpose,= 'C': Conjugate transpose. ๐Nโ isINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0. ๐ขNRHSโ isINTEGER. The number of right-hand-sides, i.e., the number of columns of the matrixB. ๐Aโ isCOMPLEX*16array, dimension(LDA,N). On entry, theN-by-NmatrixA. ๐งฎLDAโ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐AFโ isCOMPLEX*16array, dimension(LDAF,N). The factorsLandUfrom the factorizationA = P*L*Uas computed byZGETRF. ๐งฉLDAFโ isINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N). ๐IPIVโ isINTEGERarray, dimension(N). The pivot indices from the factorizationA = P*L*Uas computed byZGETRF; rowiof the matrix was interchanged with rowIPIV(i). ๐COLEQUโ isLOGICAL. If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly. โ๏ธCโ isDOUBLE PRECISIONarray, dimension(N). The column scale factors forA. IfCOLEQU = .FALSE.,Cis not accessed. IfCis input, each element ofCshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. โ ๏ธBโ isCOMPLEX*16array, dimension(LDB,NRHS). The right-hand-side matrixB. ๐งพLDBโ isINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐Yโ isCOMPLEX*16array, dimension(LDY,NRHS). On entry, the solution matrixX, as computed byZGETRS. On exit, the improved solution matrixY. โจLDYโ isINTEGER. The leading dimension of the arrayY.LDY >= max(1,N). ๐BERR_OUTโ isDOUBLE PRECISIONarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom the formulamax(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )whereabs(Z)is the componentwise absolute value of the matrix or vectorZ. This is computed byZLA_LIN_BERR. ๐N_NORMSโ isINTEGER. Determines which error bounds to return (seeERRS_NandERRS_C). IfN_NORMS >= 1return normwise error bounds. IfN_NORMS >= 2return componentwise error bounds. ๐๏ธERRS_Nโ isDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERRS_N(i,:) corresponds to the ith right-hand side.
The second index in ERRS_N(:,err) contains the following three fields:
err = 1'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2'Guaranteed'error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately 1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. ๐
ERRS_Cโ isDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERRS_C(i,:) corresponds to the ith right-hand side.
The second index in ERRS_C(:,err) contains the following three fields:
err = 1'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2'Guaranteed'error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately 1.
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. ๐
RESโ isCOMPLEX*16array, dimension(N). Workspace to hold the intermediate residual. ๐งบAYBโAYBโAYBisDOUBLE PRECISION array, dimension(N). It's workspace, bestie. Just vibes and scratch space. ๐ซถDYโDYisCOMPLEX*16 array, dimension(N). Workspace that holds the intermediate solution. The middle-of-the-journey girlie. โจY_TAILโY_TAILisCOMPLEX*16 array, dimension(N). Workspace for the trailing bits of the intermediate solution. Yes she has a tail. Iconic. ๐RCONDโRCONDisDOUBLE PRECISION. The reciprocal scaled condition number, aka an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that got done). If this number is less than machine precision โ and specifically if it's zero โ then the matrix is singular to working precision. โ ๏ธ But lowkey don't panic: the error may still be small even if this number is very small and the matrix appears ill-conditioned. It's giving "bad numbers, decent outcome," iykyk.ITHRESHโITHRESHisINTEGER. The max number of residual computations allowed for refinement. Default is10. For'aggressive'mode, set it to100so it can permit convergence using approximate factorizations or factorizations other than LU. ๐โโ๏ธ๐จ Heads up though: if the factorization uses a technique other than Gaussian elimination, the guarantees inERRS_NandERRS_Cmay no longer be trustworthy. Trust issues fr fr.RTHRESHโRTHRESHisDOUBLE PRECISION. This one decides when to stop refining if the error estimate stops decreasing. Refinement stops when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i), wherenorm(Z)is the infinity norm of Z.RTHRESHsatisfies0 < RTHRESH <= 1. Default value is0.5. For'aggressive', set it to0.9to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details, bestie, she did her homework. ๐DZ_UBโDZ_UBisDOUBLE PRECISION. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable โ and "stable" here means the relative change in each component is less thanDZ_UB. Default value is0.25, which requires the first bit to be stable. See LAWN 165 for more details. ๐IGNORE_CWISEโIGNORE_CWISEisLOGICAL. If.TRUE.then ignore componentwise convergence. Default value is.FALSE.. ๐INFOโINFOisINTEGER. The receipts:= 0: Successful exit. We ate. ๐< 0: ifINFO = -i, the ith argument toZGETRShad an illegal value. ๐
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ double precision function zla_gerpvgrw (integer N, integer NCOLS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF)
ZLA_GERPVGRW multiplies a square real matrix by a complex matrix. (Yes, that's literally what it says. Not me being chaotic, that's the actual description. ๐ญ)
Purpose
ZLA_GERPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). The 'max absolute element' norm is what's used here. If this comes out much less than 1, the stability of the LU factorization of the (equilibrated) matrix A could be poor. That ALSO means the solution X, the estimated condition numbers, and the error bounds could all be unreliable. ๐ฉ So like, if this number is bad, don't trust the whole friend group.
Parameters
NโNisINTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0.NCOLSโNCOLSisINTEGER. The number of columns of the matrix A.NCOLS >= 0.AโAisCOMPLEX*16 array, dimension(LDA,N). On entry, theN-by-Nmatrix A.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).AFโAFisCOMPLEX*16 array, dimension(LDAF,N). The factors L and U from the factorizationA = P*L*Uas computed byZGETRF.LDAFโLDAFisINTEGER. The leading dimension of the array AF.LDAF >= max(1,N).
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ recursive subroutine zlaqz0 (character, intent(in) WANTS, character, intent(in) WANTQ, character, intent(in) WANTZ, integer, intent(in) N, integer, intent(in) ILO, integer, intent(in) IHI, complex*16, dimension( lda, * ), intent(inout) A, integer, intent(in) LDA, complex*16, dimension( ldb, * ), intent(inout) B, integer, intent(in) LDB, complex*16, dimension( * ), intent(inout) ALPHA, complex*16, dimension( * ), intent(inout) BETA, complex*16, dimension( ldq, * ), intent(inout) Q, integer, intent(in) LDQ, complex*16, dimension( ldz, * ), intent(inout) Z, integer, intent(in) LDZ, complex*16, dimension( * ), intent(inout) WORK, integer, intent(in) LWORK, double precision, dimension( * ), intent(out) RWORK, integer, intent(in) REC, integer, intent(out) INFO)
ZLAQZ0. That's it. That's the whole line. Short king behavior. โจ
Purpose
ZLAQZ0 computes the eigenvalues of a real matrix pair (H,T), where H is an upper Hessenberg matrix and T is upper triangular, using the double-shift QZ method. Matrix pairs of this type are produced by the reduction to generalized upper Hessenberg form of a real matrix pair (A,B):
A = Q1*H*Z1**H, B = Q1*T*Z1**H,
as computed by ZGGHRD.
If JOB='S', then the Hessenberg-triangular pair (H,T) is also reduced to generalized Schur form,
H = Q*S*Z**H, T = Q*P*Z**H,
where Q and Z are unitary matrices, and P and S are upper triangular matrices. ๐
Optionally, the unitary matrix Q from the generalized Schur factorization may be postmultiplied into an input matrix Q1, and the unitary matrix Z may be postmultiplied into an input matrix Z1. If Q1 and Z1 are the unitary matrices from ZGGHRD that reduced the matrix pair (A,B) to generalized upper Hessenberg form, then the output matrices Q1*Q and Z1*Z are the unitary factors from the generalized Schur factorization of (A,B):
A = (Q1*Q)*S*(Z1*Z)**H, B = (Q1*Q)*P*(Z1*Z)**H.
To avoid overflow, eigenvalues of the matrix pair (H,T) (equivalently, of (A,B)) are computed as a pair of values (alpha,beta), where alpha is complex and beta real. ๐
If beta is nonzero, lambda = alpha / beta is an eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
A*x = lambda*B*x
and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the alternate form of the GNEP
mu*A*y = B*y.
Eigenvalues can be read directly from the generalized Schur form:
alpha = S(i,i), beta = P(i,i).
Ref: C.B. Moler & G.W. Stewart, 'An Algorithm for Generalized Matrix Eigenvalue Problems', SIAM J. Numer. Anal., 10(1973), pp. 241--256.
Ref: B. Kagstrom, D. Kressner, 'Multishift Variants of the QZ Algorithm with Aggressive Early Deflation', SIAM J. Numer. Anal., 29(2006), pp. 199--227.
Ref: T. Steel, D. Camps, K. Meerbergen, R. Vandebril 'A multishift, multipole rational QZ method with agressive early deflation'
Parameters
WANTSโWANTSisCHARACTER*1. The plot:= 'E': Compute eigenvalues only.= 'S': Compute eigenvalues and the Schur form. (Overachiever era. ๐)
WANTQโWANTQisCHARACTER*1. Left Schur vectors, what's the move:= 'N': Left Schur vectors (Q) are not computed.= 'I': Q is initialized to the unit matrix and the matrix Q of left Schur vectors of(A,B)is returned.= 'V': Q must contain an unitary matrix Q1 on entry and the productQ1*Qis returned.
WANTZโWANTZisCHARACTER*1. Right Schur vectors, same energy:= 'N': Right Schur vectors (Z) are not computed.= 'I': Z is initialized to the unit matrix and the matrix Z of right Schur vectors of(A,B)is returned.= 'V': Z must contain an unitary matrix Z1 on entry and the productZ1*Zis returned.
NโNisINTEGER. The order of the matrices A, B, Q, and Z.N >= 0.ILOโILOisINTEGER.IHIโIHIisINTEGER.ILOandIHImark the rows and columns of A which are in Hessenberg form. It's assumed that A is already upper triangular in rows and columns1:ILO-1andIHI+1:N. IfN > 0,1 <= ILO <= IHI <= N; ifN = 0,ILO=1andIHI=0.AโAisCOMPLEX*16 array, dimension(LDA, N). On entry, theN-by-Nupper Hessenberg matrix A. On exit, ifJOB = 'S', A contains the upper triangular matrix S from the generalized Schur factorization. IfJOB = 'E', the diagonal blocks of A match those of S, but the rest of A is unspecified. ๐LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max( 1, N ).BโBisCOMPLEX*16 array, dimension(LDB, N). On entry, theN-by-Nupper triangular matrix B. On exit, ifJOB = 'S', B contains the upper triangular matrix P from the generalized Schur factorization; ifJOB = 'E', the diagonal blocks of B match those of P, but the rest of B is unspecified. ๐ฆLDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max( 1, N ).ALPHAโALPHAisCOMPLEX*16 array, dimension(N). Each scalar alpha defining an eigenvalue of GNEP. โญBETAโBETAisCOMPLEX*16 array, dimension(N). The scalars beta that define the eigenvalues of GNEP. Together, the quantitiesalpha = ALPHA(j)andbeta = BETA(j)represent the j-th eigenvalue of the matrix pair(A,B), in one of the formslambda = alpha/betaormu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed. โ ๏ธ So don't go computing them, bestie, that's the whole point.QโQisCOMPLEX*16 array, dimension(LDQ, N). On entry, ifCOMPQ = 'V', the unitary matrix Q1 used in the reduction of(A,B)to generalized Hessenberg form. On exit, ifCOMPQ = 'I', the unitary matrix of left Schur vectors of(A,B), and ifCOMPQ = 'V', the unitary matrix of left Schur vectors of(A,B). Not referenced ifCOMPQ = 'N'. ๐LDQโINTEGER. bestie, this is the leading dimension of the arrayQ๐ and the rules areLDQ >= 1. Also: ifCOMPQ='V'or'I', thenLDQ >= N. no cap.ZโCOMPLEX*16array, dimension(LDZ, N). On entry, ifCOMPZ = 'V', this is the unitary matrixZ1that got used in the reduction of(A,B)to generalized Hessenberg form ๐. On exit, ifCOMPZ = 'I', it's the unitary matrix of right Schur vectors of(H,T), and ifCOMPZ = 'V', it's the unitary matrix of right Schur vectors of(A,B). Not referenced ifCOMPZ = 'N'. literally just vibing there untouched ๐LDZโINTEGER. The leading dimension of the arrayZ.LDZ >= 1. And ifCOMPZ='V'or'I', thenLDZ >= N. โจWORKโCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO >= 0,WORK(1)returns the optimalLWORK. it's giving โจhelpfulโจRWORKโDOUBLE PRECISIONarray, dimension(N).LWORKโINTEGER. The dimension of the arrayWORK.LWORK >= max(1,N).
And here's the lil trick, bestie: if LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. ๐
RECโINTEGER.RECindicates the current recursion level. Should be set to0on first call. (yes, zero. first call. don't come in at level 7 like a menace ๐ซถ)INFOโINTEGER.= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐จ= 1,...,N: the QZ iteration did not converge.(A,B)is not in Schur form, butALPHA(i)andBETA(i),i=INFO+1,...,Nshould be correct. so like, partial slay?
Author
Thijs Steel, KU Leuven ๐
Date
May 2020 ๐ธ
๐ฆ subroutine zlaqz1 ๐ฆ
subroutine zlaqz1 (logical, intent(in) ILQ, logical, intent(in) ILZ,
integer, intent(in) K, integer, intent(in) ISTARTM, integer, intent(in)
ISTOPM, integer, intent(in) IHI, complex*16, dimension( lda, * ) A,
integer, intent(in) LDA, complex*16, dimension( ldb, * ) B, integer,
intent(in) LDB, integer, intent(in) NQ, integer, intent(in) QSTART,
complex*16, dimension( ldq, * ) Q, integer, intent(in) LDQ, integer,
intent(in) NZ, integer, intent(in) ZSTART, complex*16, dimension( ldz, *
) Z, integer, intent(in) LDZ)
ZLAQZ1
Purpose:
ZLAQZ1 chases a 1x1 shift bulge in a matrix pencil down a single position ๐ฅ๐โโ๏ธ
Parameters
ILQโLOGICAL. Determines whether or not to update the matrixQ. ๐ILZโLOGICAL. Determines whether or not to update the matrixZ. ๐KโINTEGER. Index indicating the position of the bulge. On entry, the bulge is located in(A(k+1,k),B(k+1,k)). On exit, the bulge is located in(A(k+2,k+1),B(k+2,k+1)). she moved!! ๐ซISTARTMโINTEGER. (that's it. that's the whole description. iconic minimalism honestly ๐)ISTOPMโINTEGER. Updates to(A,B)are restricted to(istartm:k+2,k:istopm). It is assumed without checking thatistartm <= k+1andk+2 <= istopm. assumed without checking โ so like, be correct or perish ๐ซถIHIโINTEGER. (again, no elaboration. we respect it. ๐ )AโCOMPLEX*16array, dimension(LDA,N).LDAโINTEGER. The leading dimension ofAas declared in the calling procedure.BโCOMPLEX*16array, dimension(LDB,N).LDBโINTEGER. The leading dimension ofBas declared in the calling procedure.NQโINTEGER. The order of the matrixQ.QSTARTโINTEGER. Start index of the matrixQ. Rotations are applied To columnsk+2-qStart:k+3-qStartofQ.QโCOMPLEX*16array, dimension(LDQ,NQ).LDQโINTEGER. The leading dimension ofQas declared in the calling procedure.NZโINTEGER. The order of the matrixZ.ZSTARTโINTEGER. Start index of the matrixZ. Rotations are applied To columnsk+1-qStart:k+2-qStartofZ. (yes,qStart, lowercase, we don't ask questions ๐ธ)ZโCOMPLEX*16array, dimension(LDZ,NZ).LDZโINTEGER. The leading dimension ofQas declared in the calling procedure. (it saysQhere. yes. in theLDZslot. we are simply reporting the facts, bestie. not our business. ๐)
Author
Thijs Steel, KU Leuven ๐
Date
May 2020 ๐ธ
๐ recursive subroutine zlaqz2 ๐
recursive subroutine zlaqz2 (logical, intent(in) ILSCHUR, logical,
intent(in) ILQ, logical, intent(in) ILZ, integer, intent(in) N, integer,
intent(in) ILO, integer, intent(in) IHI, integer, intent(in) NW,
complex*16, dimension( lda, * ), intent(inout) A, integer, intent(in)
LDA, complex*16, dimension( ldb, * ), intent(inout) B, integer, intent(in)
LDB, complex*16, dimension( ldq, * ), intent(inout) Q, integer,
intent(in) LDQ, complex*16, dimension( ldz, * ), intent(inout) Z, integer,
intent(in) LDZ, integer, intent(out) NS, integer, intent(out) ND,
complex*16, dimension( * ), intent(inout) ALPHA, complex*16, dimension( * ),
intent(inout) BETA, complex*16, dimension( ldqc, * ) QC, integer, intent(in)
LDQC, complex*16, dimension( ldzc, * ) ZC, integer, intent(in) LDZC,
complex*16, dimension( * ) WORK, integer, intent(in) LWORK, double
precision, dimension( * ) RWORK, integer, intent(in) REC, integer,
intent(out) INFO)
ZLAQZ2
Purpose:
ZLAQZ2 performs AED โจ (yes that's the whole purpose line. AED girlies know. iykyk ๐ง)
Parameters
ILSCHURโLOGICAL. Determines whether or not to update the full Schur form. ๐ILQโLOGICAL. Determines whether or not to update the matrixQ. ๐ILZโLOGICAL. Determines whether or not to update the matrixZ. ๐NโINTEGER. The order of the matricesA,B,Q, andZ.N >= 0.ILOโINTEGER. (unadorned. mysterious. love that for us. ๐ )IHIโINTEGER.ILOandIHImark the rows and columns of(A,B)which are to be normalized.NWโINTEGER. The desired size of the deflation window. ๐ชโจAโCOMPLEX*16array, dimension(LDA, N).LDAโINTEGER. The leading dimension of the arrayA.LDA >= max( 1, N ).BโCOMPLEX*16array, dimension(LDB, N).LDBโINTEGER. The leading dimension of the arrayB.LDB >= max( 1, N ).QโCOMPLEX*16array, dimension(LDQ, N).LDQโINTEGER. (that's the whole thing. short king. ๐)ZโCOMPLEX*16array, dimension(LDZ, N).LDZโINTEGER. (also just vibing, unexplained. ๐)NSโINTEGER. The number of unconverged eigenvalues available to use as shifts.NDโINTEGER. The number of converged eigenvalues found. ๐ALPHAโCOMPLEX*16array, dimension(N). Each scalar alpha defining an eigenvalue of GNEP.BETAโCOMPLEX*16array, dimension(N). The scalars beta that define the eigenvalues of GNEP. Together, the quantitiesalpha = ALPHA(j)andbeta = BETA(j)represent the j-th eigenvalue of the matrix pair(A,B), in one of the formslambda = alpha/betaormu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed. โ ๏ธ do NOT just go dividing them, bestie, they will overflow on you ๐ญQCโCOMPLEX*16array, dimension(LDQC, NW).LDQCโINTEGER. (yes, another one with no description. we stan a cryptic parameter. ๐)ZCโCOMPLEX*16array, dimension(LDZC, NW).LDZCโLDZ is INTEGER. (this is verbatim what it says.LDZCis documented asLDZ. we do not editorialize. we simply present. ๐ญ)WORKโCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO >= 0,WORK(1)returns the optimalLWORK.LWORKโINTEGER. The dimension of the arrayWORK.LWORK >= max(1,N).
And the classic: if LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. ๐
RWORKโDOUBLE PRECISIONarray, dimension(N).RECโINTEGER.RECindicates the current recursion level. Should be set to0on first call. ๐INFOโINTEGER.= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐จ
Author
Thijs Steel, KU Leuven ๐
Date
May 2020 ๐ธ
โญ subroutine zlaqz3 โญ
subroutine zlaqz3 (logical, intent(in) ILSCHUR, logical, intent(in) ILQ,
logical, intent(in) ILZ, integer, intent(in) N, integer, intent(in) ILO,
integer, intent(in) IHI, integer, intent(in) NSHIFTS, integer,
intent(in) NBLOCK_DESIRED, complex*16, dimension( * ), intent(inout)
ALPHA, complex*16, dimension( * ), intent(inout) BETA, complex*16,
dimension( lda, * ), intent(inout) A, integer, intent(in) LDA,
complex*16, dimension( ldb, * ), intent(inout) B, integer, intent(in)
LDB, complex*16, dimension( ldq, * ), intent(inout) Q, integer,
intent(in) LDQ, complex*16, dimension( ldz, * ), intent(inout) Z,
integer, intent(in) LDZ, complex*16, dimension( ldqc, * ), intent(inout)
QC, integer, intent(in) LDQC, complex*16, dimension( ldzc, * ),
intent(inout) ZC, integer, intent(in) LDZC, complex*16, dimension( * ),
intent(inout) WORK, integer, intent(in) LWORK, integer, intent(out)
INFO)
ZLAQZ3
Purpose:
ZLAQZ3 Executes a single multishift QZ sweep ๐โจ
Parameters
ILSCHURโLOGICAL. Determines whether or not to update the full Schur form. ๐ILQโLOGICAL. Determines whether or not to update the matrixQ. ๐ILZโLOGICAL.ILZisLOGICALโ decides whether or not to update the matrix Z ๐NisINTEGERโ the order of the matrices A, B, Q, and Z.N >= 0.ILOisINTEGERIHIisINTEGERNSHIFTSisINTEGERโ the desired number of shifts to use โจNBLOCK_DESIREDisINTEGERโ the desired size of the computational windows ๐ชALPHAisCOMPLEX*16array.SRcontains the alpha parts of the shifts to use.BETAisCOMPLEX*16array.SScontains the scale of the shifts to use.AisCOMPLEX*16array, dimension(LDA, N)LDAisINTEGERโ the leading dimension of the array A.LDA >= max( 1, N ).BisCOMPLEX*16array, dimension(LDB, N)LDBisINTEGERโ the leading dimension of the array B.LDB >= max( 1, N ).QisCOMPLEX*16array, dimension(LDQ, N)LDQisINTEGERZisCOMPLEX*16array, dimension(LDZ, N)LDZisINTEGERQCisCOMPLEX*16array, dimension(LDQC, NBLOCK_DESIRED)LDQCisINTEGERZCisCOMPLEX*16array, dimension(LDZC, NBLOCK_DESIRED)LDZCisINTEGERLDZisINTEGERWORKisCOMPLEX*16array, dimension(MAX(1,LWORK))โ on exit, ifINFO >= 0,WORK(1)returns the optimalLWORK. ๐LWORKisINTEGERโ the dimension of the arrayWORK.LWORK >= max(1,N).- If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
- If
INFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author ๐
Thijs Steel, KU Leuven
๐ Date ๐
May 2020
๐งฎ subroutine zlaunhr_col_getrfnp ๐งฎ
subroutine zlaunhr_col_getrfnp (integer M, integer N, complex*16, dimension(
lda, * ) A, integer LDA, complex*16, dimension( * ) D, integer INFO)
ZLAUNHR_COL_GETRFNP
๐ฏ Purpose ๐ฏ
ZLAUNHR_COL_GETRFNP computes the modified LU factorization without pivoting of a complex general M-by-N matrix A. The factorization has the form:
A - S = L * U,
where:
- S is a m-by-n diagonal sign matrix with the diagonal D, so that
D(i) = S(i,i),1 <= i <= min(M,N). The diagonal D is constructed asD(i)=-SIGN(A(i,i)), whereA(i,i)is the value after performingi-1steps of Gaussian elimination. This means that the diagonal element at each step of 'modified' Gaussian elimination is at least one in absolute value (so that division-by-zero not not possible during the division by the diagonal element); ๐ค - L is a M-by-N lower triangular matrix with unit diagonal elements (lower trapezoidal if
M > N); - and U is a M-by-N upper triangular matrix (upper trapezoidal if
M < N).
This routine is an auxiliary routine used in the Householder reconstruction routine ZUNHR_COL. In ZUNHR_COL, this routine is applied to an M-by-N matrix A with orthonormal columns, where each element is bounded by one in absolute value. With the choice of the matrix S above, one can show that the diagonal element at each step of Gaussian elimination is the largest (in absolute value) in the column on or below the diagonal, so that no pivoting is required for numerical stability [1]. ๐
For more details on the Householder reconstruction algorithm, including the modified LU factorization, see [1].
This is the blocked right-looking version of the algorithm, calling Level 3 BLAS to update the submatrix. To factorize a block, this routine calls the recursive routine ZLAUNHR_COL_GETRFNP2. ๐ฅ
[1] 'Reconstructing Householder vectors from tall-skinny QR', G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen, E. Solomonik, J. Parallel Distrib. Comput., vol. 85, pp. 3-31, 2015.
๐ธ Parameters ๐ธ
MisINTEGERโ the number of rows of the matrix A.M >= 0.NisINTEGERโ the number of columns of the matrix A.N >= 0.AisCOMPLEX*16array, dimension(LDA,N)โ on entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorizationA-S=L*U; the unit diagonal elements of L are not stored. โจLDAisINTEGERโ the leading dimension of the array A.LDA >= max(1,M).DisCOMPLEX*16array, dimensionmin(M,N)โ the diagonal elements of the diagonal M-by-N sign matrix S,D(i) = S(i,i), where1 <= i <= min(M,N). The elements can be only( +1.0, 0.0 )or(-1.0, 0.0 ). ๐INFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ซถ Contributors: ๐ซถ
November 2019, Igor Kozachenko, Computer Science Division, University of California, Berkeley
๐งฎ recursive subroutine zlaunhr_col_getrfnp2 ๐งฎ
recursive subroutine zlaunhr_col_getrfnp2 (integer M, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) D,
integer INFO)
ZLAUNHR_COL_GETRFNP2
๐ฏ Purpose ๐ฏ
ZLAUNHR_COL_GETRFNP2 computes the modified LU factorization without pivoting of a complex general M-by-N matrix A. The factorization has the form:
A - S = L * U,
where:
- S is a m-by-n diagonal sign matrix with the diagonal D, so that
D(i) = S(i,i),1 <= i <= min(M,N). The diagonal D is constructed asD(i)=-SIGN(A(i,i)), whereA(i,i)is the value after performingi-1steps of Gaussian elimination. This means that the diagonal element at each step of 'modified' Gaussian elimination is at least one in absolute value (so that division-by-zero not possible during the division by the diagonal element); - L is a M-by-N lower triangular matrix with unit diagonal elements (lower trapezoidal if
M > N); - and U is a M-by-N upper triangular matrix (upper trapezoidal if
M < N).
This routine is an auxiliary routine used in the Householder reconstruction routine ZUNHR_COL. In ZUNHR_COL, this routine is applied to an M-by-N matrix A with orthonormal columns, where each element is bounded by one in absolute value. With the choice of the matrix S above, one can show that the diagonal element at each step of Gaussian elimination is the largest (in absolute value) in the column on or below the diagonal, so that no pivoting is required for numerical stability [1]. ๐
For more details on the Householder reconstruction algorithm, including the modified LU factorization, see [1].
This is the recursive version of the LU factorization algorithm. Denote A - S by B. The algorithm divides the matrix B into four submatrices:
[ B11 | B12 ] where B11 is n1 by n1,
B = [ -----|----- ] B21 is (m-n1) by n1,
[ B21 | B22 ] B12 is n1 by n2,
B22 is (m-n1) by n2,
with n1 = min(m,n)/2, n2 = n-n1.
The subroutine calls itself to factor B11, solves for B21, solves for B12, updates B22, then calls itself to factor B22. ๐
For more details on the recursive LU algorithm, see [2].
ZLAUNHR_COL_GETRFNP2 is called to factorize a block by the blocked routine ZLAUNHR_COL_GETRFNP, which uses blocked code calling Level 3 BLAS to update the submatrix. However, ZLAUNHR_COL_GETRFNP2 is self-sufficient and can be used without ZLAUNHR_COL_GETRFNP. ๐
[1] 'Reconstructing Householder vectors from tall-skinny QR', G. Ballard, J. Demmel, L. Grigori, M. Jacquelin, H.D. Nguyen, E. Solomonik, J. Parallel Distrib. Comput., vol. 85, pp. 3-31, 2015.
[2] 'Recursion leads to automatic variable blocking for dense linear algebra algorithms', F. Gustavson, IBM J. of Res. and Dev., vol. 41, no. 6, pp. 737-755, 1997.
๐ธ Parameters ๐ธ
MisINTEGERโ the number of rows of the matrix A.M >= 0.NisINTEGERโ the number of columns of the matrix A.N >= 0.AisCOMPLEX*16array, dimension(LDA,N)โ on entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorizationA-S=L*U; the unit diagonal elements of L are not stored. โจLDAisINTEGERโ the leading dimension of the array A.LDA >= max(1,M).DisCOMPLEX*16array, dimensionmin(M,N)โ the diagonal elements of the diagonal M-by-N sign matrix S,D(i) = S(i,i), where1 <= i <= min(M,N). The elements can be only( +1.0, 0.0 )or(-1.0, 0.0 ). ๐INFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ซถ Contributors: ๐ซถ
November 2019, Igor Kozachenko, Computer Science Division, University of California, Berkeley
๐งฎ subroutine ztgevc ๐งฎ
subroutine ztgevc (character SIDE, character HOWMNY, logical, dimension( * )
SELECT, integer N, complex*16, dimension( lds, * ) S, integer LDS,
complex*16, dimension( ldp, * ) P, integer LDP, complex*16, dimension(
ldvl, * ) VL, integer LDVL, complex*16, dimension( ldvr, * ) VR, integer
LDVR, integer MM, integer M, complex*16, dimension( * ) WORK, double
precision, dimension( * ) RWORK, integer INFO)
ZTGEVC
๐ฏ Purpose ๐ฏ
okay so bestie, ZTGEVC computes some or all of the right and/or left eigenvectors of a pair of complex matrices (S,P), where S and P are upper triangular. ๐
Matrix pairs of this type are produced by the generalized Schur factorization of a complex matrix pair (A,B):
A = Q*S*Z**H, B = Q*P*Z**H
as computed by ZGGHRD + ZHGEQZ.
The right eigenvector x and the left eigenvector y of (S,P) corresponding to an eigenvalue w are defined by:
S*x = w*P*x, (y**H)*S = w*(y**H)*P,
where y**H denotes the conjugate tranpose of y. (yes, "tranpose" is literally what the original says, not me being silly ๐ญ) The eigenvalues are not input to this routine, but are computed directly from the diagonal elements of S and P.
This routine returns the matrices X and/or Y of right and left eigenvectors of (S,P), or the products Z*X and/or Q*Y, where Z and Q are input matrices. If Q and Z are the unitary factors from the generalized Schur factorization of a matrix pair (A,B), then Z*X and Q*Y are the matrices of right and left eigenvectors of (A,B).
Parameters ๐
SIDEโSIDEisCHARACTER*1= 'R': compute right eigenvectors only;= 'L': compute left eigenvectors only;= 'B': compute both right and left eigenvectors.
HOWMNYโHOWMNYisCHARACTER*1= 'A': compute all right and/or left eigenvectors;= 'B': compute all right and/or left eigenvectors, backtransformed by the matrices inVRand/orVL;= 'S': compute selected right and/or left eigenvectors, specified by the logical arraySELECT.
SELECTโSELECTisLOGICALarray, dimension(N)IfHOWMNY='S',SELECTspecifies the eigenvectors to be computed. The eigenvector corresponding to the j-th eigenvalue is computed ifSELECT(j) = .TRUE.. Not referenced ifHOWMNY = 'A'or'B'.NโNisINTEGERThe order of the matricesSandP.N >= 0.SโSisCOMPLEX*16array, dimension(LDS,N)The upper triangular matrixSfrom a generalized Schur factorization, as computed byZHGEQZ.LDSโLDSisINTEGERThe leading dimension of arrayS.LDS >= max(1,N).PโPisCOMPLEX*16array, dimension(LDP,N)The upper triangular matrixPfrom a generalized Schur factorization, as computed byZHGEQZ.Pmust have real diagonal elements.LDPโLDPisINTEGERThe leading dimension of arrayP.LDP >= max(1,N).VLโVLisCOMPLEX*16array, dimension(LDVL,MM)On entry, ifSIDE = 'L'or'B'andHOWMNY = 'B',VLmust contain an N-by-N matrixQ(usually the unitary matrixQof left Schur vectors returned byZHGEQZ). On exit, ifSIDE = 'L'or'B',VLcontains:- if
HOWMNY = 'A', the matrixYof left eigenvectors of(S,P); - if
HOWMNY = 'B', the matrixQ*Y; - if
HOWMNY = 'S', the left eigenvectors of(S,P)specified bySELECT, stored consecutively in the columns ofVL, in the same order as their eigenvalues. Not referenced ifSIDE = 'R'.
- if
LDVLโLDVLisINTEGERThe leading dimension of arrayVL.LDVL >= 1, and ifSIDE = 'L'or'l'or'B'or'b',LDVL >= N.VRโVRisCOMPLEX*16array, dimension(LDVR,MM)On entry, ifSIDE = 'R'or'B'andHOWMNY = 'B',VRmust contain an N-by-N matrixQ(usually the unitary matrixZof right Schur vectors returned byZHGEQZ). On exit, ifSIDE = 'R'or'B',VRcontains:- if
HOWMNY = 'A', the matrixXof right eigenvectors of(S,P); - if
HOWMNY = 'B', the matrixZ*X; - if
HOWMNY = 'S', the right eigenvectors of(S,P)specified bySELECT, stored consecutively in the columns ofVR, in the same order as their eigenvalues. Not referenced ifSIDE = 'L'.
- if
LDVRโLDVRisINTEGERThe leading dimension of the arrayVR.LDVR >= 1, and ifSIDE = 'R'or'B',LDVR >= N.MMโMMisINTEGERThe number of columns in the arraysVLand/orVR.MM >= M.MโMisINTEGERThe number of columns in the arraysVLand/orVRactually used to store the eigenvectors. IfHOWMNY = 'A'or'B',Mis set toN. Each selected eigenvector occupies one column.WORKโWORKisCOMPLEX*16array, dimension(2*N)RWORKโRWORKisDOUBLE PRECISIONarray, dimension(2*N)INFOโINFOisINTEGER= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.
Author โจ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
ZTGEXC ๐ฆ
subroutine ztgexc (logical WANTQ, logical WANTZ, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
integer LDB, complex*16, dimension( ldq, * ) Q, integer LDQ, complex*16,
dimension( ldz, * ) Z, integer LDZ, integer IFST, integer ILST, integer
INFO)
ZTGEXC
Purpose ๐
ZTGEXC reorders the generalized Schur decomposition of a complex matrix pair (A,B), using an unitary equivalence transformation (A, B) := Q * (A, B) * Z**H, so that the diagonal block of (A, B) with row index IFST is moved to row ILST.
(A, B) must be in generalized Schur canonical form, that is, A and B are both upper triangular.
Optionally, the matrices Q and Z of generalized Schur vectors are updated.
Q(in) * A(in) * Z(in)**H = Q(out) * A(out) * Z(out)**H
Q(in) * B(in) * Z(in)**H = Q(out) * B(out) * Z(out)**H
Parameters ๐
WANTQโWANTQisLOGICAL.TRUE.: update the left transformation matrixQ;.FALSE.: do not updateQ.
WANTZโWANTZisLOGICAL.TRUE.: update the right transformation matrixZ;.FALSE.: do not updateZ.
NโNisINTEGERThe order of the matricesAandB.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N)On entry, the upper triangular matrixAin the pair(A, B). On exit, the updated matrixA.LDAโLDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).BโBisCOMPLEX*16array, dimension(LDB,N)On entry, the upper triangular matrixBin the pair(A, B). On exit, the updated matrixB.LDBโLDBisINTEGERThe leading dimension of the arrayB.LDB >= max(1,N).QโQisCOMPLEX*16array, dimension(LDQ,N)On entry, ifWANTQ = .TRUE., the unitary matrixQ. On exit, the updated matrixQ. IfWANTQ = .FALSE.,Qis not referenced.LDQโLDQisINTEGERThe leading dimension of the arrayQ.LDQ >= 1; IfWANTQ = .TRUE.,LDQ >= N.ZโZisCOMPLEX*16array, dimension(LDZ,N)On entry, ifWANTZ = .TRUE., the unitary matrixZ. On exit, the updated matrixZ. IfWANTZ = .FALSE.,Zis not referenced.LDZโLDZisINTEGERThe leading dimension of the arrayZ.LDZ >= 1; IfWANTZ = .TRUE.,LDZ >= N.IFSTโIFSTisINTEGERILSTโILSTisINTEGERSpecify the reordering of the diagonal blocks of(A, B). The block with row indexIFSTis moved to rowILST, by a sequence of swapping between adjacent blocks.INFOโINFOisINTEGER=0: Successful exit.<0: ifINFO = -i, the i-th argument had an illegal value.=1: The transformed matrix pair(A, B)would be too far from generalized Schur form; the problem is ill-conditioned.(A, B)may have been partially reordered, andILSTpoints to the first row of the current position of the block being moved.
Author โจ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors ๐ซถ
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
References ๐
[1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.
[2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF - 94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
[3] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software for Solving the Generalized Sylvester Equation and Estimating the Separation between Regular Matrix Pairs, Report UMINF - 93.23, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, December 1993, Revised April 1994, Also as LAPACK working Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, 1996.
Author ๐
Generated automatically by Doxygen for LAPACK from the source code.
okay bestie, that's the whole page! This was LAPACK version 3.11.0, dated Sun Nov 27 2022, and the manpage is complex16GEcomputational(3). Stay slay, keep your matrices triangular, and remember: eigenvectors are just the main characters of your linear algebra story. ๐โจ๐ฆ
๐ฆ 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