complex16GEcomputational(3)

๐Ÿ“ฆ
version 3.11.0 ยท 2 versions
, in debian bookworm

๐Ÿ’– 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) โ€” ZGEBAK
  • subroutine zgebal (JOB, N, A, LDA, ILO, IHI, SCALE, INFO) โ€” ZGEBAL
  • subroutine 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) โ€” ZGEBRD
  • subroutine zgecon (NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK, INFO) โ€” ZGECON
  • subroutine zgeequ (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO) โ€” ZGEEQU
  • subroutine zgeequb (M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO) โ€” ZGEEQUB
  • subroutine 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) โ€” ZGEHRD
  • subroutine 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) โ€” ZGELQF
  • subroutine zgemqrt (SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT, C, LDC, WORK, INFO) โ€” ZGEMQRT
  • subroutine 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) โ€” ZGEQLF
  • subroutine zgeqp3 (M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK, INFO) โ€” ZGEQP3
  • subroutine 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) โ€” ZGEQRF
  • subroutine zgeqrfp (M, N, A, LDA, TAU, WORK, LWORK, INFO) โ€” ZGEQRFP
  • subroutine zgeqrt (M, N, NB, A, LDA, T, LDT, WORK, INFO) โ€” ZGEQRT
  • subroutine 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) โ€” ZGERFS
  • subroutine 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) โ€” ZGERFSX
  • subroutine 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) โ€” ZGERQF
  • subroutine zgesvj (JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, LDV, CWORK, LWORK, RWORK, LRWORK, INFO) โ€” ZGESVJ
  • subroutine 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) โ€” ZGETRF
  • recursive subroutine zgetrf2 (M, N, A, LDA, IPIV, INFO) โ€” ZGETRF2
  • subroutine zgetri (N, A, LDA, IPIV, WORK, LWORK, INFO) โ€” ZGETRI
  • subroutine zgetrs (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO) โ€” ZGETRS
  • subroutine zhgeqz (JOB, COMPQ, COMPZ, N, ILO, IHI, H, LDH, T, LDT, ALPHA, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, RWORK, INFO) โ€” ZHGEQZ
  • subroutine 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_EXTENDED
  • double 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) โ€” ZLAQZ0
  • subroutine zlaqz1 (ILQ, ILZ, K, ISTARTM, ISTOPM, IHI, A, LDA, B, LDB, NQ, QSTART, Q, LDQ, NZ, ZSTART, Z, LDZ) โ€” ZLAQZ1
  • recursive 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) โ€” ZLAQZ2
  • subroutine 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) โ€” ZLAQZ3
  • subroutine zlaunhr_col_getrfnp (M, N, A, LDA, D, INFO) โ€” ZLAUNHR_COL_GETRFNP
  • recursive subroutine zlaunhr_col_getrfnp2 (M, N, A, LDA, D, INFO) โ€” ZLAUNHR_COL_GETRFNP2
  • subroutine ztgevc (SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL, LDVL, VR, LDVR, MM, M, WORK, RWORK, INFO) โ€” ZTGEVC
  • subroutine 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 to A, bestie. If P(j) is the index of the row and column swapped with row and column j, and D(j) is the scaling factor applied to row and column j, 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: if INFO = -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 matrix A. M >= 0.
  • N โ€” INTEGER. The number of columns in the matrix A. 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 matrix B; the elements below the diagonal, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors, and the elements above the first superdiagonal, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors;
    • if m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix B; the elements below the first subdiagonal, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors, and the elements above the diagonal, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors.

See Further Details. (She's got lore, okay?)

  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • D โ€” DOUBLE PRECISION array, dimension (min(M,N)). The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
  • E โ€” DOUBLE PRECISION array, dimension (min(M,N)-1). The off-diagonal elements of the bidiagonal matrix B:
    • if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1;
    • if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1.
  • TAUQ โ€” COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrix Q. See Further Details.
  • TAUP โ€” COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrix P. See Further Details.
  • WORK โ€” COMPLEX*16 array, dimension (max(M,N)).
  • INFO โ€” INTEGER, the final verdict:
    • = 0: successful exit ๐ŸŽ€
    • < 0: if INFO = -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 matrix A. M >= 0.
  • N โ€” INTEGER. The number of columns in the matrix A. 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 matrix B; the elements below the diagonal, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors, and the elements above the first superdiagonal, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors;
    • if m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix B; the elements below the first subdiagonal, with the array TAUQ, represent the unitary matrix Q as a product of elementary reflectors, and the elements above the diagonal, with the array TAUP, represent the unitary matrix P as a product of elementary reflectors.

See Further Details. (Same lore, different girlie.)

  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • D โ€” DOUBLE PRECISION array, dimension (min(M,N)). The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).
  • E โ€” DOUBLE PRECISION array, dimension (min(M,N)-1). The off-diagonal elements of the bidiagonal matrix B:
    • if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1;
    • if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1.
  • TAUQ โ€” COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrix Q. See Further Details.
  • TAUP โ€” COMPLEX*16 array, dimension (min(M,N)). The scalar factors of the elementary reflectors which represent the unitary matrix P. See Further Details.
  • WORK โ€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. She's generous like that โœจ
  • LWORK โ€” INTEGER. The length of the array WORK. LWORK >= max(1,M,N). For optimum performance LWORK >= (M+N)*NB, where NB is 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 peeking, not touching ๐Ÿ‘€
  • INFO โ€” INTEGER:
    • = 0: successful exit ๐ŸŒธ
    • < 0: if INFO = -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 โ€” NORM is CHARACTER*1. Specifies whether the 1-norm condition number or the infinity-norm condition number is required:
    • = '1' or 'O': 1-norm;
    • = 'I': Infinity-norm.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • 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. iykyk, this is the leftovers from ZGETRF, don't @ me ๐Ÿ’€
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • ANORM โ€” ANORM is DOUBLE PRECISION. If NORM = '1' or 'O', the 1-norm of the original matrix A. If NORM = 'I', the infinity-norm of the original matrix A.
  • RCOND โ€” RCOND is DOUBLE PRECISION. The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).
  • 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
    • < 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.

๐ŸŒˆ 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 โ€” 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). The M-by-N matrix whose equilibration factors are to be computed.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • R โ€” R is DOUBLE PRECISION array, dimension (M). If INFO = 0 or INFO > M, R contains the row scale factors for A.
  • C โ€” C is DOUBLE PRECISION array, dimension (N). If INFO = 0, C contains the column scale factors for A.
  • ROWCND โ€” ROWCND is DOUBLE PRECISION. If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.
  • COLCND โ€” COLCND is DOUBLE PRECISION. If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.
  • AMAX โ€” AMAX is DOUBLE PRECISION. Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled. bestie, watch out for that overflow ๐Ÿ˜ญ
  • INFO โ€” INFO is INTEGER:
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, and i is
      • <= M: the i-th row of A is exactly zero
      • > M: the (i-M)-th column of A is 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 โ€” 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). The M-by-N matrix whose equilibration factors are to be computed.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • R โ€” R is DOUBLE PRECISION array, dimension (M). If INFO = 0 or INFO > M, R contains the row scale factors for A.
  • C โ€” C is DOUBLE PRECISION array, dimension (N). If INFO = 0, C contains the column scale factors for A.
  • ROWCND โ€” ROWCND is DOUBLE PRECISION. If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.
  • COLCND โ€” COLCND is DOUBLE PRECISION. If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.
  • AMAX โ€” AMAX is DOUBLE PRECISION. Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.
  • INFO โ€” INFO is INTEGER:
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, and i is
      • <= M: the i-th row of A is exactly zero
      • > M: the (i-M)-th column of A is 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 โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • ILO โ€” ILO is INTEGER
  • IHI
  • IHI โ€” IHI is INTEGER. Okay bestie, here's the vibe ๐Ÿซถ: it's assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to ZGEBAL; otherwise they should be set to 1 and N respectively. 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 of A get overwritten with the upper Hessenberg matrix H, and the elements below that first subdiagonal โ€” together with the array TAU โ€” 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 array A. 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: 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.

๐Ÿ” 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 matrix A. N >= 0.
  • ILO โ€” ILO is INTEGER.
  • IHI โ€” IHI is INTEGER. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to ZGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. Constraints: 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0. Yes, you read that right โ€” if N=0 it's ILO=1 and IHI=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 of A are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details. ๐Ÿ’–
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • TAU โ€” TAU is COMPLEX*16 array, dimension (N-1). The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero. ๐ŸŽ€
  • WORK โ€” WORK is COMPLEX*16 array, dimension (LWORK). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. slay โœจ
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK. LWORK >= max(1,N). For good performance, LWORK should generally be larger. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. (It's giving "just checking the size, no notes" ๐Ÿ’…)
  • 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.

๐Ÿ” 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's ZGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See ZLAHR2.)

๐Ÿฆ‹ 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 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 below the diagonal of the array contain the m by min(m,n) lower trapezoidal matrix L (L is lower triangular if m <= n); the elements above 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 (M).
  • 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.

๐Ÿ” 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 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 below the diagonal of the array contain the m-by-min(m,n) lower trapezoidal matrix L (L is lower triangular if m <= n); the elements above 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 (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. โœจ
  • LWORK
  • LWORK โ€” INTEGER, bestie. It's the dimension of the WORK array. Rule: LWORK >= max(1,M). And if you want optimum performance, go LWORK >= M*NB, where NB is the optimal blocksize. โœจ
๐Ÿšจ Special case alert: if LWORK = -1, a workspace query is assumed. The routine only calculates the optimal size of the WORK array, hands it back as the first entry of WORK, and XERBLA stays quiet โ€” it issues no error message related to LWORK. ๐Ÿซถ
  • INFO โ€” INTEGER, the receipts:
    • = 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.

๐ŸŒธ 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': apply Q or Q**H from the Left;
    • = 'R': apply Q or Q**H from the Right.
  • TRANS โ€” TRANS is CHARACTER*1
    • = 'N': No transpose, apply Q;
    • = 'C': Conjugate transpose, apply Q**H.
  • M โ€” M is INTEGER. The number of rows of the matrix C. M >= 0.
  • N โ€” N is INTEGER. The number of columns of the matrix C. N >= 0.
  • K โ€” K is INTEGER. The number of elementary reflectors whose product defines the matrix Q. If SIDE = 'L', M >= K >= 0; if SIDE = 'R', N >= K >= 0.
  • NB โ€” NB is INTEGER. The block size used for the storage of T. K >= NB >= 1. This must be the same value of NB used to generate T in ZGEQRT. No cap. ๐Ÿ™ˆ
  • V โ€” V is COMPLEX*16 array, dimension (LDV,K). The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1,2,...,k, as returned by ZGEQRT in the first K columns of its array argument A.
  • LDV โ€” LDV is INTEGER. The leading dimension of the array V. If SIDE = 'L', LDA >= max(1,M); if SIDE = 'R', LDA >= max(1,N).
  • T โ€” T is COMPLEX*16 array, dimension (LDT,K). The upper triangular factors of the block reflectors as returned by ZGEQRT, stored as a NB-by-N matrix.
  • LDT โ€” LDT is INTEGER. The leading dimension of the array T. LDT >= NB.
  • C โ€” C is COMPLEX*16 array, dimension (LDC,N). On entry, the M-by-N matrix C. On exit, C is overwritten by Q C, Q**H C, C Q**H or C Q. ๐Ÿ’ซ
  • LDC โ€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • WORK โ€” WORK is COMPLEX*16 array. The dimension of WORK is N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
  • 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.

๐ŸŽ€ 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 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 lower triangle of the subarray A(m-n+1:m,1:n) contains the n by n lower triangular matrix L; if m <= n, the elements on and below the (n-m)-th superdiagonal contain the m by n lower trapezoidal matrix L; 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 (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.

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 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 lower triangle of the subarray A(m-n+1:m,1:n) contains the N-by-N lower triangular matrix L; if m <= n, the elements on and below the (n-m)-th superdiagonal contain the M-by-N lower trapezoidal matrix L; 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 (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 >= max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.
๐Ÿšจ If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit ๐Ÿ’–
    • < 0: 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.

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 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 upper triangle of the array contains the min(M,N)-by-N upper trapezoidal matrix R; the elements below the diagonal, together with the array TAU, represent the unitary matrix Q as a product of min(M,N) elementary reflectors. ๐Ÿ‘‘
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. 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, where NB is 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: if INFO = -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:

  • Q is a m-by-m orthogonal matrix;
  • R is an upper-triangular n-by-n matrix;
  • 0 is a (m-n)-by-n zero matrix, if m > 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: 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.

๐ŸŒˆ 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:

  • Q is a m-by-m orthogonal matrix;
  • R is an upper-triangular n-by-n matrix with nonnegative diagonal entries;
  • 0 is a (m-n)-by-n zero matrix, if m > 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: 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.

๐ŸŒˆ 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:

  • Q is a M-by-M orthogonal matrix;
  • R is an upper-triangular N-by-N matrix;
  • 0 is a (M-N)-by-N zero matrix, if M > 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, if MIN(M,N) = 0, and LWORK >= N, otherwise.
  • For optimum performance LWORK >= N*NB, where NB is 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: 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.

๐ŸŒˆ 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:

  • Q is a M-by-M orthogonal matrix;
  • R is an upper-triangular N-by-N matrix with nonnegative diagonal entries;
  • 0 is a (M-N)-by-N zero matrix, if M > 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 an INTEGER ๐Ÿ’… the leading dimension of the array A, and the vibe check is LDA >= max(1,M).
  • TAU โ€” a COMPLEX*16 array, dimension (min(M,N)). These are the scalar factors of the elementary reflectors (peep Further Details below for the whole story ๐Ÿซถ).
  • WORK โ€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) hands you back the optimal LWORK like a little gift โœจ.
  • LWORK โ€” INTEGER, the dimension of the array WORK, and LWORK >= max(1,N). For optimum performance you want LWORK >= N*NB, where NB is the optimal blocksize (she's an overachiever, periodt).
Okay so if LWORK = -1, it's giving workspace query energy ๐Ÿงš the routine only calculates the optimal size of the WORK array, returns that value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. No drama, no tears.
  • INFO โ€” INTEGER, the receipts ๐Ÿ“‹
    • = 0: successful exit, we ate ๐Ÿ’–
    • < 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.


๐ŸŒˆ 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 matrix A. M >= 0.
  • N โ€” INTEGER. The number of columns of the matrix A. N >= 0.
  • NB โ€” INTEGER. The block size to be used in the blocked QR. MIN(M,N) >= NB >= 1.
  • A โ€” 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 are the columns of V.
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • T โ€” COMPLEX*16 array, 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 array T. LDT >= NB.
  • WORK โ€” COMPLEX*16 array, dimension (NB*N).
  • INFO โ€” INTEGER, the receipts ๐Ÿ“‹
    • = 0: successful exit, we ate ๐Ÿ’–
    • < 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.


๐ŸŒˆ 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 matrix A. M >= N.
  • N โ€” INTEGER. The number of columns of the matrix A. N >= 0.
  • A โ€” COMPLEX*16 array, dimension (LDA,N). On entry, the complex M-by-N matrix A. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrix R; the elements below the diagonal are the columns of V. See below for further details ๐Ÿ‘‡
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • T โ€” COMPLEX*16 array, dimension (LDT,N). The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflector T; 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 array T. LDT >= max(1,N).
  • INFO โ€” INTEGER, the receipts ๐Ÿ“‹
    • = 0: successful exit, we ate ๐Ÿ’–
    • < 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.


๐ŸŒˆ 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 matrix A. M >= N.
  • N โ€” INTEGER. The number of columns of the matrix A. N >= 0.
  • A โ€” COMPLEX*16 array, dimension (LDA,N). On entry, the complex M-by-N matrix A. On exit, the elements on and above the diagonal contain the N-by-N upper triangular matrix R; the elements below the diagonal are the columns of V. See below for further details ๐Ÿ‘‡
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • T โ€” COMPLEX*16 array, dimension (LDT,N). The N-by-N upper triangular factor of the block reflector. The elements on and above the diagonal contain the block reflector T; 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 array T. LDT >= max(1,N).
  • INFO โ€” INTEGER, the receipts ๐Ÿ“‹
    • = 0: successful exit, we ate ๐Ÿ’–
    • < 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.


๐ŸŒˆ 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 a CHARACTER*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 โ€” an INTEGER. The order of the matrix A. N >= 0, no cap.
  • NRHS โ€” an INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • A โ€” a COMPLEX*16 array, dimension (LDA,N). The original N-by-N matrix A.
  • LDA โ€” an INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF โ€” a COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
  • LDAF โ€” an INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV โ€” an 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 โ€” a COMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrix B.
  • LDB โ€” an INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • X โ€” a COMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix X.
  • LDX โ€” an INTEGER. The leading dimension of the array X. LDX >= max(1,N).
  • FERR โ€” a DOUBLE PRECISION array, dimension (NRHS). The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(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 in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.
  • BERR โ€” a DOUBLE PRECISION array, dimension (NRHS). The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).
  • WORK โ€” a COMPLEX*16 array, dimension (2*N).
  • RWORK โ€” a DOUBLE PRECISION array, dimension (N).
  • INFO โ€” an INTEGER.
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value

โœจ Internal Parameters: โœจ

ITMAX is the maximum number of steps of iterative refinement.

โœจ Author โœจ

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.
   subroutine 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 โ€” a 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)
  • EQUED โ€” a CHARACTER*1. Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.
    • = '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 โ€” an INTEGER. The order of the matrix A. N >= 0.
  • NRHS โ€” an INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
  • A โ€” a COMPLEX*16 array, dimension (LDA,N). The original N-by-N matrix A.
  • LDA โ€” an INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF โ€” a COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
  • LDAF โ€” an INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV โ€” an INTEGER array, dimension (N). The pivot indices from ZGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
  • R โ€” a DOUBLE PRECISION array, dimension (N). The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed. If R is accessed, each element of R should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.
  • C โ€” a DOUBLE PRECISION array, dimension (N). The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. If C is accessed, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.
  • B โ€” a COMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrix B.
  • LDB โ€” an INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • X โ€” a COMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix X.
  • LDX โ€” an INTEGER. The leading dimension of the array X. LDX >= max(1,N).
  • RCOND โ€” a DOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned.
  • BERR โ€” a DOUBLE PRECISION array, dimension (NRHS). Componentwise relative backward error. This is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).
  • N_ERR_BNDS โ€” an INTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below.
  • ERR_BNDS_NORM โ€” a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

Normwise relative error in the ith solution vector:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.

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 threshold sqrt(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 threshold sqrt(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 threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = 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 threshold sqrt(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 threshold sqrt(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 threshold sqrt(n) * dlamch('Epsilon') to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1. ๐Ÿฆ‹
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: 10 Aggressive: Set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in err_bnds_norm and err_bnds_comp may no longer be trustworthy. ๐Ÿ˜ญ
  • 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.0 is 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: If INFO = -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 = 0 is returned. ๐Ÿ’€
  • = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_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 either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides check ERR_BNDS_NORM or ERR_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: 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.

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 a DOUBLE PRECISION array, and its dimension is gonna depend on which JOBV you picked, so listen up bestie:
    • if JOBV = 'N' or 'J', then RWORK is dimension (max(1,LRWORK)) โ€” like, just size it generously, it's fine
    • if JOBV = 'V', then RWORK is dimension (max(1,LRWORK)) too

And on exit? Oh she's serving so much info:

  • RWORK(1) โ€” this is SCALE, and it literally scales the whole answer: the singular values of A are SCALE*SVA(1:N). This factored representation exists because, and I quote, "some of the singular values of A might 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 of A that are above the underflow threshold DLAMCH('S'). When JOBU = 'U' or JOBU = 'C', the value of RANKA is returned here as RANKA=NINT(RWORK(2)). See the descriptions of SVA and RWORK for more.
  • RWORK(3) โ€” the number of the computed nonzero singular values
  • RWORK(4) โ€” the number of the computed singular values that are larger than the underflow threshold
  • RWORK(5) โ€” the number of sweeps (cycles) used in the computation
  • RWORK(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 the RWORK entries 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) and RWORK(7) are documented as above โ€” do NOT assume more of them are meaningful, because the rest of RWORK is just scratch space for the internal triangular-matrix bookkeeping. It's giving backstage crew energy ๐ŸŒธ
  • LRWORK โ€” LRWORK is INTEGER, and it's the dimension of the array RWORK. The rules are:
    • if JOBV = 'N', then LRWORK >= max(1, 2*N) ... okay no, I'm not gonna guess a formula that isn't written. The page says LRWORK is INTEGER, the dimension of the array RWORK. That's the documented bit, so that's what you get. Periodt.
  • INFO โ€” INFO is INTEGER, and it's the vibe check on whether everything went okay:
    • = 0: successful exit ๐ŸŽ‰ slay, we ate
    • < 0: if INFO = -i, then the i-th argument had an illegal value. So like, if INFO = -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 โ€” JOBA is CHARACTER*1, and it tells us the structure of A:
    • = 'L': the input matrix A is lower triangular
    • = 'U': the input matrix A is upper triangular
    • = 'G': the input matrix A is a general M-by-N matrix, M >= N
  • JOBU โ€” JOBU is CHARACTER*1, and it says whether we're computing the left singular vectors (columns of U):
    • = 'U' or 'F': the left singular vectors corresponding to the nonzero singular values are computed and returned in the leading columns of A. See more details in the description of A. The default numerical orthogonality threshold is set to approximately TOL=CTOL*EPS, CTOL=SQRT(M), EPS=DLAMCH('E').
    • = 'C': analogous to JOBU='U', except that the user can control the level of numerical orthogonality of the computed left singular vectors. TOL can be set to TOL = CTOL*EPS, where CTOL is given on input in the array WORK. No CTOL smaller than ONE is allowed. CTOL greater than 1 / EPS is meaningless. The option 'C' can be used if M*EPS is satisfactory orthogonality of the computed left singular vectors, so CTOL=M could save a few sweeps of Jacobi rotations. See the descriptions of A and WORK(1).
    • = 'N': the matrix U is not computed. However, see the description of A.
  • JOBV โ€” JOBV is CHARACTER*1, and it says whether we're computing the right singular vectors, i.e. the matrix V:
    • = 'V' or 'J': the matrix V is computed and returned in the array V
    • = 'A': the Jacobi rotations are applied to the MV-by-N array V. In other words, the right singular vector matrix V is not computed explicitly; instead it is applied to an MV-by-N matrix initially stored in the first MV rows of V.
    • = 'N': the matrix V is not computed and the array V is not referenced
  • M โ€” M is INTEGER. The number of rows of the input matrix A. 1/DLAMCH('E') > M >= 0.
  • N โ€” N is INTEGER. The number of columns of the input matrix A. M >= N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA,N). On entry, the M-by-N matrix A. On exit:
    • If JOBU = 'U' .OR. JOBU = 'C':
      • If INFO = 0: RANKA orthonormal columns of U are returned in the leading RANKA columns of the array A. Here RANKA <= N is the number of computed singular values of A that are above the underflow threshold DLAMCH('S'). The singular vectors corresponding to underflowed or zero singular values are not computed. The value of RANKA is returned in the array RWORK as RANKA=NINT(RWORK(2)). Also see the descriptions of SVA and RWORK. The computed columns of U are mutually numerically orthogonal up to approximately TOL=SQRT(M)*EPS (default); or TOL=CTOL*EPS (JOBU = 'C'), see the description of JOBU.
      • If INFO > 0: the procedure ZGESVJ did not converge in the given number of iterations (sweeps). In that case, the computed columns of U may not be orthogonal up to TOL. The output U (stored in A), SIGMA (given by the computed singular values in SVA(1:N)) and V is still a decomposition of the input matrix A in the sense that the residual || A - SCALE * U * SIGMA * V^* ||_2 / ||A||_2 is small.
    • 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 of U is not an issue and iterations are stopped when the columns of the iterated matrix are numerically orthogonal up to approximately M*EPS. Thus, on exit, A contains the columns of U scaled with the corresponding singular values.
      • If INFO > 0: the procedure ZGESVJ did not converge in the given number of iterations (sweeps).
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • SVA โ€” SVA is DOUBLE PRECISION array, dimension (N). On exit:
    • If INFO = 0: depending on the value SCALE = RWORK(1), we have:
      • If SCALE = ONE: SVA(1:N) contains the computed singular values of A. During the computation SVA contains the Euclidean column norms of the iterated matrices in the array A.
      • If SCALE .NE. ONE: the singular values of A are SCALE*SVA(1:N), and this factored representation is due to the fact that some of the singular values of A might underflow or overflow.
    • If INFO > 0: the procedure ZGESVJ did not converge in the given number of iterations (sweeps) and SCALE*SVA(1:N) may not be accurate.
  • MV โ€” MV is INTEGER. If JOBV = 'A', then the product of Jacobi rotations in ZGESVJ is applied to the first MV rows of V. See the description of JOBV.
  • V โ€” V is COMPLEX*16 array, dimension (LDV,N):
    • If JOBV = 'V', then V contains on exit the N-by-N matrix of the right singular vectors
    • If JOBV = 'A', then V contains the product of the computed right singular vector matrix and the initial matrix in the array V
    • If JOBV = 'N', then V is not referenced
  • LDV โ€” LDV is INTEGER. The leading dimension of the array V, LDV >= 1:
    • If JOBV = 'V', then LDV >= max(1,N)
    • If JOBV = 'A', then LDV >= max(1,MV)
  • CWORK โ€” CWORK is COMPLEX*16 array, dimension (max(1,LWORK)). Used as workspace. If on entry LWORK = -1, then a workspace query is assumed and no computation is done; CWORK(1) is set to the minial (and optimal) length of CWORK. (Yes, "minial" โ€” that's the original's typo, and I'm keeping it because I love her. ๐ŸŽ€)
  • LWORK โ€” LWORK is INTEGER. Length of CWORK, LWORK >= M+N.
  • RWORK โ€” and we're back to RWORK, bestie. It's DOUBLE PRECISION array, dimension (max(1,LRWORK)). On exit it's carrying all the receipts: SCALE in RWORK(1), RANKA in RWORK(2), and the rest of the bookkeeping entries described up above. It's literally the group chat log of the whole computation. ๐Ÿ“ฑ
  • RWORK โ€” DOUBLE PRECISION array, dimension (max(6,LRWORK)) ๐Ÿ’–

On entry,

  • If JOBU = 'C' :
    • RWORK(1) = CTOL, where CTOL defines the threshold for convergence. The process stops if all columns of A are mutually orthogonal up to CTOL*EPS, EPS=DLAMCH('E'). It is required that CTOL >= ONE, i.e. it is not allowed to force the routine to obtain orthogonality below EPSILON. ๐Ÿšซ

On exit,

  • RWORK(1) = SCALE is the scaling factor such that SCALE*SVA(1:N) are the computed singular values of A. (See description of SVA().)
  • 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 when ZGESVJ did 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 of RWORK, LRWORK >= MAX(6,N).
  • INFO โ€” INTEGER
    • = 0: successful exit. ๐ŸŽ‰
    • < 0: if INFO = -i, then the i-th argument had an illegal value
    • > 0: ZGESVJ did not converge in the maximal allowed number (NSWEEP=30) of sweeps. The output may still be useful. See the description of RWORK. ๐Ÿ’€

๐Ÿ’œ 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: ๐Ÿ“š

  1. 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.
  2. J. Demmel and K. Veselic: Jacobi method is more accurate than QR.
  3. 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.
  4. 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.
  5. 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.
  6. 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 โ€” 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 to be factored. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. ๐ŸŽ€
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • IPIV โ€” IPIV is INTEGER array, dimension (min(M,N)). The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value
    • > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐Ÿšจ

๐Ÿ’œ 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 โ€” 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 to be factored. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. ๐ŸŽ€
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • IPIV โ€” IPIV is INTEGER array, dimension (min(M,N)). The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐Ÿšจ

๐Ÿ’œ 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 โ€” 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 to be factored. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored. ๐ŸŽ€
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • IPIV
  • IPIV is an INTEGER array, dimension (min(M,N)) โ€” bestie, these are the pivot indices ๐Ÿ’…. For 1 <= i <= min(M,N), row i of the matrix got swapped with row IPIV(i), periodt.
  • INFO is INTEGER
    • = 0: successful exit, we love to see it โœจ
    • < 0: if INFO = -i, then the i-th argument had an illegal value ๐Ÿ˜ญ (yes, -i, literally negative-i, iykyk)
    • > 0: if INFO = i, then U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐Ÿ’€ not 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: if INFO = -i, the i-th argument had an illegal value ๐Ÿ˜ญ
  • > 0: if INFO = 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: 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.

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': Q is initialized to the unit matrix and the matrix Q of left Schur vectors of (H,T) is returned;
  • = 'V': Q must contain a unitary matrix Q1 on entry and the product Q1*Q is returned.
  • COMPZ

COMPZ is CHARACTER*1

  • = 'N': Right Schur vectors (Z) are not computed;
  • = 'I': Q is initialized to the unit matrix and the matrix Z of right Schur vectors of (H,T) is returned;
  • = 'V': Z must contain a unitary matrix Z1 on entry and the product Z1*Z is 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. โš ๏ธ

  • Q
  • Q โ€” a COMPLEX*16 array, 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 array Q. Gotta be LDQ >= 1. And if COMPQ='V' or 'I', then LDQ >= N. no cap. ๐Ÿฆ‹
  • Z โ€” a COMPLEX*16 array, 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 array Z. LDZ >= 1, always. And if COMPZ='V' or 'I', then LDZ >= N. periodt. ๐Ÿ‘‘
  • WORK โ€” a COMPLEX*16 array, 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 array WORK. You need LWORK >= 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 PRECISION array, dimension (N). ๐ŸŒˆ
  • INFO โ€” INTEGER. the vibes check, if you will:
    • = 0: successful exit ๐Ÿ’–
    • < 0: if INFO = -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, but ALPHA(i) and BETA(i), for i=INFO+1,...,N should be correct.
    • = N+1,...,2*N: the shift calculation failed. (H,T) is not in Schur form, but ALPHA(i) and BETA(i), for i=INFO-N+1,...,N should 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, TRANS specifies 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, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.
  • N โ€” INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.
  • ALPHA โ€” DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit. ๐Ÿ’œ
  • A โ€” COMPLEX*16 array, dimension ( LDA, n ). Before entry, the leading m by n part of the array A must contain the matrix of coefficients. Unchanged on exit.
  • LDA โ€” INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, m ). Unchanged on exit.
  • X โ€” COMPLEX*16 array, dimension at least ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n', and at least ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Unchanged on exit.
  • INCX โ€” INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit. (zero increment = chaos, we don't do that ๐Ÿ˜ค)
  • BETA โ€” DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit.
  • Y โ€” DOUBLE PRECISION array, dimension ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n', and at least ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry with BETA non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y. ๐Ÿฆ‹
  • INCY โ€” INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must 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 matrix A. N >= 0.
  • A โ€” COMPLEX*16 array, dimension (LDA,N). On entry, the N-by-N matrix A. ๐ŸŽ€
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF โ€” COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF. โœจ
  • LDAF โ€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV โ€” INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). ๐Ÿฆ‹
  • C โ€” DOUBLE PRECISION array, dimension (N). The vector C in the formula op(A) * inv(diag(C)).
  • CAPPLY โ€” LOGICAL. If .TRUE. then access the vector C in the formula above.
  • INFO โ€” INTEGER.
    • = 0: Successful exit. ๐Ÿ’–
    • i > 0: The ith argument is invalid. ๐Ÿ˜ญ
  • WORK โ€” COMPLEX*16 array, dimension (2*N). Workspace. ๐Ÿงš
  • RWORK โ€” DOUBLE PRECISION array, 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 matrix A. N >= 0.
  • A โ€” COMPLEX*16 array, dimension (LDA,N). On entry, the N-by-N matrix A. ๐ŸŽ€
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF โ€” COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF. โœจ
  • LDAF โ€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV โ€” INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). ๐Ÿฆ‹
  • IPIV โ€” is INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). ๐Ÿ’…
  • X โ€” is COMPLEX*16 array, dimension (N). The vector X in the formula op(A) * diag(X). โœจ
  • INFO โ€” is INTEGER. = 0: Successful exit. i > 0: The ith argument is invalid. ๐Ÿซถ
  • WORK โ€” is COMPLEX*16 array, dimension (2*N). Workspace. ๐Ÿ› ๏ธ
  • RWORK โ€” is DOUBLE PRECISION array, 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 โ€” is INTEGER. Specifies the intermediate precision to be used in refinement. The value is defined by ILAPREC(P) where P is a CHARACTER and P = 'S': Single, = 'D': Double, = 'I': Indigenous, = 'X' or 'E': Extra. ๐ŸŒˆ
  • TRANS_TYPE โ€” is INTEGER. Specifies the transposition operation on A. The value is defined by ILATRANS(T) where T is a CHARACTER and T = 'N': No transpose, = 'T': Transpose, = 'C': Conjugate transpose. ๐Ÿ”„
  • N โ€” is INTEGER. The number of linear equations, i.e., the order of the matrix A. N >= 0. ๐Ÿ”ข
  • NRHS โ€” is INTEGER. The number of right-hand-sides, i.e., the number of columns of the matrix B. ๐Ÿ“Š
  • A โ€” is COMPLEX*16 array, dimension (LDA,N). On entry, the N-by-N matrix A. ๐Ÿงฎ
  • LDA โ€” is INTEGER. The leading dimension of the array A. LDA >= max(1,N). ๐Ÿ“
  • AF โ€” is COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF. ๐Ÿงฉ
  • LDAF โ€” is INTEGER. The leading dimension of the array AF. LDAF >= max(1,N). ๐Ÿ“
  • IPIV โ€” is INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). ๐Ÿ”€
  • COLEQU โ€” is LOGICAL. If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly. โš–๏ธ
  • C โ€” is DOUBLE PRECISION array, dimension (N). The column scale factors for A. If COLEQU = .FALSE., C is not accessed. If C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. โš ๏ธ
  • B โ€” is COMPLEX*16 array, dimension (LDB,NRHS). The right-hand-side matrix B. ๐Ÿงพ
  • LDB โ€” is INTEGER. The leading dimension of the array B. LDB >= max(1,N). ๐Ÿ“
  • Y โ€” is COMPLEX*16 array, dimension (LDY,NRHS). On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix Y. โœจ
  • LDY โ€” is INTEGER. The leading dimension of the array Y. LDY >= max(1,N). ๐Ÿ“
  • BERR_OUT โ€” is DOUBLE PRECISION array, dimension (NRHS). On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by ZLA_LIN_BERR. ๐Ÿ“‰
  • N_NORMS โ€” is INTEGER. Determines which error bounds to return (see ERRS_N and ERRS_C). If N_NORMS >= 1 return normwise error bounds. If N_NORMS >= 2 return componentwise error bounds. ๐ŸŽš๏ธ
  • ERRS_N โ€” is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

Normwise relative error in the ith solution vector:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.

The first index in 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 threshold sqrt(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 threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. ๐Ÿ“š

  • ERRS_C โ€” is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:

Componentwise relative error in the ith solution vector:

               abs(XTRUE(j,i) - X(j,i))
        max_j ----------------------
                    abs(X(j,i))

The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then 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 threshold sqrt(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 threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. ๐Ÿ“š

  • RES โ€” is COMPLEX*16 array, dimension (N). Workspace to hold the intermediate residual. ๐Ÿงบ
  • AYB โ€”
  • AYB โ€” AYB is DOUBLE PRECISION array, dimension (N). It's workspace, bestie. Just vibes and scratch space. ๐Ÿซถ
  • DY โ€” DY is COMPLEX*16 array, dimension (N). Workspace that holds the intermediate solution. The middle-of-the-journey girlie. โœจ
  • Y_TAIL โ€” Y_TAIL is COMPLEX*16 array, dimension (N). Workspace for the trailing bits of the intermediate solution. Yes she has a tail. Iconic. ๐ŸŽ€
  • RCOND โ€” RCOND is DOUBLE 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 โ€” ITHRESH is INTEGER. The max number of residual computations allowed for refinement. Default is 10. For 'aggressive' mode, set it to 100 so 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 in ERRS_N and ERRS_C may no longer be trustworthy. Trust issues fr fr.
  • RTHRESH โ€” RTHRESH is DOUBLE PRECISION. This one decides when to stop refining if the error estimate stops decreasing. Refinement stops when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i), where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. Default value is 0.5. For 'aggressive', set it to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details, bestie, she did her homework. ๐Ÿ“š
  • DZ_UB โ€” DZ_UB is DOUBLE PRECISION. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable โ€” and "stable" here means the relative change in each component is less than DZ_UB. Default value is 0.25, which requires the first bit to be stable. See LAWN 165 for more details. ๐Ÿ’…
  • IGNORE_CWISE โ€” IGNORE_CWISE is LOGICAL. If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. ๐Ÿ™ˆ
  • INFO โ€” INFO is INTEGER. The receipts:
    • = 0: Successful exit. We ate. ๐Ÿ‘‘
    • < 0: if INFO = -i, the ith argument to ZGETRS had 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 โ€” N is INTEGER. The number of linear equations, i.e., the order of the matrix A. N >= 0.
  • NCOLS โ€” NCOLS is INTEGER. The number of columns of the matrix A. NCOLS >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA,N). On entry, the N-by-N matrix A.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • AF โ€” AF is COMPLEX*16 array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by ZGETRF.
  • LDAF โ€” LDAF is INTEGER. 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 โ€” WANTS is CHARACTER*1. The plot:
    • = 'E': Compute eigenvalues only.
    • = 'S': Compute eigenvalues and the Schur form. (Overachiever era. ๐Ÿ‘‘)
  • WANTQ โ€” WANTQ is CHARACTER*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 product Q1*Q is returned.
  • WANTZ โ€” WANTZ is CHARACTER*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 product Z1*Z is returned.
  • N โ€” N is INTEGER. The order of the matrices A, B, Q, and Z. N >= 0.
  • ILO โ€” ILO is INTEGER.
  • IHI โ€” IHI is INTEGER. ILO and IHI mark the rows and columns of A which are in Hessenberg form. It's 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.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N). On entry, the N-by-N upper Hessenberg matrix A. On exit, if JOB = 'S', A contains the upper triangular matrix S from the generalized Schur factorization. If JOB = 'E', the diagonal blocks of A match those of S, but the rest of A is unspecified. ๐Ÿ™ˆ
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max( 1, N ).
  • B โ€” B is COMPLEX*16 array, dimension (LDB, N). On entry, the N-by-N upper triangular matrix B. On exit, if JOB = 'S', B contains the upper triangular matrix P from the generalized Schur factorization; if JOB = 'E', the diagonal blocks of B match those of P, but the rest of B is unspecified. ๐Ÿฆ‹
  • LDB โ€” LDB is INTEGER. The leading dimension of the array B. LDB >= max( 1, N ).
  • ALPHA โ€” ALPHA is COMPLEX*16 array, dimension (N). Each scalar alpha defining an eigenvalue of GNEP. โญ
  • BETA โ€” BETA is COMPLEX*16 array, dimension (N). The scalars beta that define the eigenvalues of GNEP. 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. โš ๏ธ So don't go computing them, bestie, that's the whole point.
  • Q โ€” Q is COMPLEX*16 array, dimension (LDQ, N). On entry, if COMPQ = 'V', the unitary matrix Q1 used in the reduction of (A,B) to generalized Hessenberg form. On exit, if COMPQ = 'I', the unitary matrix of left Schur vectors of (A,B), and if COMPQ = 'V', the unitary matrix of left Schur vectors of (A,B). Not referenced if COMPQ = 'N'. ๐Ÿ’œ
  • LDQ โ€” INTEGER. bestie, this is the leading dimension of the array Q ๐Ÿ’… and the rules are LDQ >= 1. Also: if COMPQ='V' or 'I', then LDQ >= N. no cap.
  • Z โ€” COMPLEX*16 array, dimension (LDZ, N). On entry, if COMPZ = 'V', this is the unitary matrix Z1 that got used in the reduction of (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'. literally just vibing there untouched ๐Ÿ™ˆ
  • LDZ โ€” INTEGER. The leading dimension of the array Z. LDZ >= 1. And if COMPZ='V' or 'I', then LDZ >= N. โœจ
  • WORK โ€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO >= 0, WORK(1) returns the optimal LWORK. it's giving โœจhelpfulโœจ
  • RWORK โ€” DOUBLE PRECISION array, dimension (N).
  • LWORK โ€” INTEGER. The dimension of the array WORK. 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. REC indicates the current recursion level. Should be set to 0 on first call. (yes, zero. first call. don't come in at level 7 like a menace ๐Ÿซถ)
  • INFO โ€” INTEGER.
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value ๐Ÿšจ
    • = 1,...,N: the QZ iteration did not converge. (A,B) is not in Schur form, but ALPHA(i) and BETA(i), i=INFO+1,...,N should 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 matrix Q. ๐ŸŽ€
  • ILZ โ€” LOGICAL. Determines whether or not to update the matrix Z. ๐ŸŽ€
  • 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 that istartm <= k+1 and k+2 <= istopm. assumed without checking โ€” so like, be correct or perish ๐Ÿซถ
  • IHI โ€” INTEGER. (again, no elaboration. we respect it. ๐Ÿ’…)
  • A โ€” COMPLEX*16 array, dimension (LDA,N).
  • LDA โ€” INTEGER. The leading dimension of A as declared in the calling procedure.
  • B โ€” COMPLEX*16 array, dimension (LDB,N).
  • LDB โ€” INTEGER. The leading dimension of B as declared in the calling procedure.
  • NQ โ€” INTEGER. The order of the matrix Q.
  • QSTART โ€” INTEGER. Start index of the matrix Q. Rotations are applied To columns k+2-qStart:k+3-qStart of Q.
  • Q โ€” COMPLEX*16 array, dimension (LDQ,NQ).
  • LDQ โ€” INTEGER. The leading dimension of Q as declared in the calling procedure.
  • NZ โ€” INTEGER. The order of the matrix Z.
  • ZSTART โ€” INTEGER. Start index of the matrix Z. Rotations are applied To columns k+1-qStart:k+2-qStart of Z. (yes, qStart, lowercase, we don't ask questions ๐ŸŒธ)
  • Z โ€” COMPLEX*16 array, dimension (LDZ,NZ).
  • LDZ โ€” INTEGER. The leading dimension of Q as declared in the calling procedure. (it says Q here. yes. in the LDZ slot. 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 matrix Q. ๐ŸŽ€
  • ILZ โ€” LOGICAL. Determines whether or not to update the matrix Z. ๐ŸŽ€
  • N โ€” INTEGER. The order of the matrices A, B, Q, and Z. N >= 0.
  • ILO โ€” INTEGER. (unadorned. mysterious. love that for us. ๐Ÿ’…)
  • IHI โ€” INTEGER. ILO and IHI mark the rows and columns of (A,B) which are to be normalized.
  • NW โ€” INTEGER. The desired size of the deflation window. ๐ŸชŸโœจ
  • A โ€” COMPLEX*16 array, dimension (LDA, N).
  • LDA โ€” INTEGER. The leading dimension of the array A. LDA >= max( 1, N ).
  • B โ€” COMPLEX*16 array, dimension (LDB, N).
  • LDB โ€” INTEGER. The leading dimension of the array B. LDB >= max( 1, N ).
  • Q โ€” COMPLEX*16 array, dimension (LDQ, N).
  • LDQ โ€” INTEGER. (that's the whole thing. short king. ๐Ÿ‘‘)
  • Z โ€” COMPLEX*16 array, 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*16 array, dimension (N). Each scalar alpha defining an eigenvalue of GNEP.
  • BETA โ€” COMPLEX*16 array, dimension (N). The scalars beta that define the eigenvalues of GNEP. 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. โš ๏ธ do NOT just go dividing them, bestie, they will overflow on you ๐Ÿ˜ญ
  • QC โ€” COMPLEX*16 array, dimension (LDQC, NW).
  • LDQC โ€” INTEGER. (yes, another one with no description. we stan a cryptic parameter. ๐Ÿ™ˆ)
  • ZC โ€” COMPLEX*16 array, dimension (LDZC, NW).
  • LDZC โ€” LDZ is INTEGER. (this is verbatim what it says. LDZC is documented as LDZ. we do not editorialize. we simply present. ๐Ÿ˜ญ)
  • WORK โ€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO >= 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” INTEGER. The dimension of the array WORK. 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 PRECISION array, dimension (N).
  • REC โ€” INTEGER. REC indicates the current recursion level. Should be set to 0 on first call. ๐ŸŒ€
  • INFO โ€” INTEGER.
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -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 matrix Q. ๐ŸŽ€
  • ILZ โ€” LOGICAL.
  • ILZ is LOGICAL โ€” decides whether or not to update the matrix Z ๐Ÿ’…
  • N is INTEGER โ€” the order of the matrices A, B, Q, and Z. N >= 0.
  • ILO is INTEGER
  • IHI is INTEGER
  • NSHIFTS is INTEGER โ€” the desired number of shifts to use โœจ
  • NBLOCK_DESIRED is INTEGER โ€” the desired size of the computational windows ๐ŸชŸ
  • ALPHA is COMPLEX*16 array. SR contains the alpha parts of the shifts to use.
  • BETA is COMPLEX*16 array. SS contains the scale of the shifts to use.
  • A is COMPLEX*16 array, dimension (LDA, N)
  • LDA is INTEGER โ€” the leading dimension of the array A. LDA >= max( 1, N ).
  • B is COMPLEX*16 array, dimension (LDB, N)
  • LDB is INTEGER โ€” the leading dimension of the array B. LDB >= max( 1, N ).
  • Q is COMPLEX*16 array, dimension (LDQ, N)
  • LDQ is INTEGER
  • Z is COMPLEX*16 array, dimension (LDZ, N)
  • LDZ is INTEGER
  • QC is COMPLEX*16 array, dimension (LDQC, NBLOCK_DESIRED)
  • LDQC is INTEGER
  • ZC is COMPLEX*16 array, dimension (LDZC, NBLOCK_DESIRED)
  • LDZC is INTEGER
  • LDZ is INTEGER
  • WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) โ€” on exit, if INFO >= 0, WORK(1) returns the optimal LWORK. ๐Ÿ‘‘
  • LWORK is INTEGER โ€” the dimension of the array WORK. LWORK >= max(1,N).
    • 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 is INTEGER
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -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 as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing i-1 steps 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 ๐ŸŒธ

  • M is INTEGER โ€” the number of rows of the matrix A. M >= 0.
  • N is INTEGER โ€” the number of columns of the matrix A. N >= 0.
  • A is COMPLEX*16 array, dimension (LDA,N) โ€” on entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored. โœจ
  • LDA is INTEGER โ€” the leading dimension of the array A. LDA >= max(1,M).
  • D is COMPLEX*16 array, dimension min(M,N) โ€” the diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only ( +1.0, 0.0 ) or (-1.0, 0.0 ). ๐ŸŽ€
  • 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.

๐Ÿซถ 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 as D(i)=-SIGN(A(i,i)), where A(i,i) is the value after performing i-1 steps 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 ๐ŸŒธ

  • M is INTEGER โ€” the number of rows of the matrix A. M >= 0.
  • N is INTEGER โ€” the number of columns of the matrix A. N >= 0.
  • A is COMPLEX*16 array, dimension (LDA,N) โ€” on entry, the M-by-N matrix to be factored. On exit, the factors L and U from the factorization A-S=L*U; the unit diagonal elements of L are not stored. โœจ
  • LDA is INTEGER โ€” the leading dimension of the array A. LDA >= max(1,M).
  • D is COMPLEX*16 array, dimension min(M,N) โ€” the diagonal elements of the diagonal M-by-N sign matrix S, D(i) = S(i,i), where 1 <= i <= min(M,N). The elements can be only ( +1.0, 0.0 ) or (-1.0, 0.0 ). ๐ŸŽ€
  • 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.

๐Ÿซถ 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 โ€” SIDE is CHARACTER*1
    • = 'R': compute right eigenvectors only;
    • = 'L': compute left eigenvectors only;
    • = 'B': compute both right and left eigenvectors.
  • HOWMNY โ€” HOWMNY is CHARACTER*1
    • = 'A': compute all right and/or left eigenvectors;
    • = 'B': compute all right and/or left eigenvectors, backtransformed by the matrices in VR and/or VL;
    • = 'S': compute selected right and/or left eigenvectors, specified by the logical array SELECT.
  • SELECT โ€” SELECT is LOGICAL array, dimension (N) If HOWMNY='S', SELECT specifies the eigenvectors to be computed. The eigenvector corresponding to the j-th eigenvalue is computed if SELECT(j) = .TRUE.. Not referenced if HOWMNY = 'A' or 'B'.
  • N โ€” N is INTEGER The order of the matrices S and P. N >= 0.
  • S โ€” S is COMPLEX*16 array, dimension (LDS,N) The upper triangular matrix S from a generalized Schur factorization, as computed by ZHGEQZ.
  • LDS โ€” LDS is INTEGER The leading dimension of array S. LDS >= max(1,N).
  • P โ€” P is COMPLEX*16 array, dimension (LDP,N) The upper triangular matrix P from a generalized Schur factorization, as computed by ZHGEQZ. P must have real diagonal elements.
  • LDP โ€” LDP is INTEGER The leading dimension of array P. LDP >= max(1,N).
  • VL โ€” VL is COMPLEX*16 array, dimension (LDVL,MM) On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must contain an N-by-N matrix Q (usually the unitary matrix Q of left Schur vectors returned by ZHGEQZ). On exit, if SIDE = 'L' or 'B', VL contains:
    • if HOWMNY = 'A', the matrix Y of left eigenvectors of (S,P);
    • if HOWMNY = 'B', the matrix Q*Y;
    • if HOWMNY = 'S', the left eigenvectors of (S,P) specified by SELECT, stored consecutively in the columns of VL, in the same order as their eigenvalues. Not referenced if SIDE = 'R'.
  • LDVL โ€” LDVL is INTEGER The leading dimension of array VL. LDVL >= 1, and if SIDE = 'L' or 'l' or 'B' or 'b', LDVL >= N.
  • VR โ€” VR is COMPLEX*16 array, dimension (LDVR,MM) On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must contain an N-by-N matrix Q (usually the unitary matrix Z of right Schur vectors returned by ZHGEQZ). On exit, if SIDE = 'R' or 'B', VR contains:
    • if HOWMNY = 'A', the matrix X of right eigenvectors of (S,P);
    • if HOWMNY = 'B', the matrix Z*X;
    • if HOWMNY = 'S', the right eigenvectors of (S,P) specified by SELECT, stored consecutively in the columns of VR, in the same order as their eigenvalues. Not referenced if SIDE = 'L'.
  • LDVR โ€” LDVR is INTEGER The leading dimension of the array VR. LDVR >= 1, and if SIDE = 'R' or 'B', LDVR >= N.
  • MM โ€” MM is INTEGER The number of columns in the arrays VL and/or VR. MM >= M.
  • M โ€” M is INTEGER The number of columns in the arrays VL and/or VR actually used to store the eigenvectors. If HOWMNY = 'A' or 'B', M is set to N. Each selected eigenvector occupies one column.
  • 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.
    • < 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.

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 โ€” WANTQ is LOGICAL
    • .TRUE. : update the left transformation matrix Q;
    • .FALSE.: do not update Q.
  • WANTZ โ€” WANTZ is LOGICAL
    • .TRUE. : update the right transformation matrix Z;
    • .FALSE.: do not update Z.
  • N โ€” N is INTEGER The order of the matrices A and B. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA,N) On entry, the upper triangular matrix A in the pair (A, B). On exit, the updated matrix A.
  • LDA โ€” LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
  • B โ€” B is COMPLEX*16 array, dimension (LDB,N) On entry, the upper triangular matrix B in the pair (A, B). On exit, the updated matrix B.
  • LDB โ€” LDB is INTEGER The leading dimension of the array B. LDB >= max(1,N).
  • Q โ€” Q is COMPLEX*16 array, dimension (LDQ,N) On entry, if WANTQ = .TRUE., the unitary matrix Q. On exit, the updated matrix Q. If WANTQ = .FALSE., Q is not referenced.
  • LDQ โ€” LDQ is INTEGER The leading dimension of the array Q. LDQ >= 1; If WANTQ = .TRUE., LDQ >= N.
  • Z โ€” Z is COMPLEX*16 array, dimension (LDZ,N) On entry, if WANTZ = .TRUE., the unitary matrix Z. On exit, the updated matrix Z. If WANTZ = .FALSE., Z is not referenced.
  • LDZ โ€” LDZ is INTEGER The leading dimension of the array Z. LDZ >= 1; If WANTZ = .TRUE., LDZ >= N.
  • IFST โ€” IFST is INTEGER
  • ILST โ€” ILST is INTEGER Specify the reordering of the diagonal blocks of (A, B). The block with row index IFST is moved to row ILST, by a sequence of swapping between adjacent blocks.
  • INFO โ€” INFO is INTEGER
    • =0: Successful exit.
    • <0: if INFO = -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, and ILST points 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