tgsja(3)
๐ NAME ๐
okay bestie, welcome to tgsja(3) from the Library Functions Manual โ itโs literally tgsja: generalized SVD of trapezoidal matrices, step in ggsvd3. slay. ๐
๐ SYNOPSIS ๐
โจ Functions โจ
Four subroutines, all iconic, all here:
subroutine ctgsja (jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
CTGSJA
subroutine dtgsja (jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
DTGSJA
subroutine stgsja (jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
STGSJA
subroutine ztgsja (jobu, jobv, jobq, m, p, n, k, l, a, lda, b, ldb,
tola, tolb, alpha, beta, u, ldu, v, ldv, q, ldq, work, ncycle, info)
ZTGSJA
๐ธ DETAILED DESCRIPTION ๐ธ
This is the part where the page gets into it, bestie. The full function docs are below, and ctgsja is the main character of this chunk. ๐ซถ
๐ฅ FUNCTION DOCUMENTATION ๐ฅ
๐ฆ ctgsja ๐ฆ
Hereโs the signature exactly as it is, no cap:
subroutine ctgsja (character jobu, character jobv, character jobq, integer
m, integer p, integer n, integer k, integer l, complex, dimension( lda,
* ) a, integer lda, complex, dimension( ldb, * ) b, integer ldb, real
tola, real tolb, real, dimension( * ) alpha, real, dimension( * ) beta,
complex, dimension( ldu, * ) u, integer ldu, complex, dimension( ldv, *
) v, integer ldv, complex, dimension( ldq, * ) q, integer ldq, complex,
dimension( * ) work, integer ncycle, integer info)
CTGSJA
โจ Purpose โจ
CTGSJA computes the generalized singular value decomposition (GSVD) of two complex upper triangular (or trapezoidal) matrices A and B. obsessed, honestly.
On entry, it is assumed that matrices A and B have the following forms, which may be obtained by the preprocessing subroutine CGGSVP from a general M-by-N matrix A and P-by-N matrix B:
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L >= 0;
L ( 0 0 A23 )
M-K-L ( 0 0 0 )
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L < 0;
M-K ( 0 0 A23 )
N-K-L K L
B = L ( 0 0 B13 )
P-L ( 0 0 0 )
where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, otherwise A23 is (M-K)-by-L upper trapezoidal.
On exit,
U**H *A*Q = D1*( 0 R ), V**H *B*Q = D2*( 0 R ),
where U, V and Q are unitary matrices. R is a nonsingular upper triangular matrix, and D1 and D2 are โdiagonalโ matrices, which are of the following structures:
If M-K-L >= 0,
K L
D1 = K ( I 0 )
L ( 0 C )
M-K-L ( 0 0 )
K L
D2 = L ( 0 S )
P-L ( 0 0 )
N-K-L K L
( 0 R ) = K ( 0 R11 R12 ) K
L ( 0 0 R22 ) L
where
C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
S = diag( BETA(K+1), ... , BETA(K+L) ),
C**2 + S**2 = I.
R is stored in A(1:K+L,N-K-L+1:N) on exit. periodt.
If M-K-L < 0,
K M-K K+L-M
D1 = K ( I 0 0 )
M-K ( 0 C 0 )
K M-K K+L-M
D2 = M-K ( 0 S 0 )
K+L-M ( 0 0 I )
P-L ( 0 0 0 )
N-K-L K M-K K+L-M
( 0 R ) = K ( 0 R11 R12 R13 )
M-K ( 0 0 R22 R23 )
K+L-M ( 0 0 0 R33 )
where
C = diag( ALPHA(K+1), ... , ALPHA(M) ),
S = diag( BETA(K+1), ... , BETA(M) ),
C**2 + S**2 = I.
R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored
( 0 R22 R23 )
in B(M-K+1:L,N+M-K-L+1:N) on exit.
The computation of the unitary transformation matrices U, V or Q is optional. These matrices may either be formed explicitly, or they may be postmultiplied into input matrices U1, V1, or Q1. iykyk. ๐ฆ
๐ Parameters ๐
JOBUโJOBU is CHARACTER*1= 'U':Umust contain a unitary matrixU1on entry, and the productU1*Uis returned.= 'I':Uis initialized to the unit matrix, and the unitary matrixUis returned.= 'N':Uis not computed.
JOBVโJOBV is CHARACTER*1= 'V':Vmust contain a unitary matrixV1on entry, and the productV1*Vis returned.= 'I':Vis initialized to the unit matrix, and the unitary matrixVis returned.= 'N':Vis not computed.
JOBQโJOBQ is CHARACTER*1= 'Q':Qmust contain a unitary matrixQ1on entry, and the productQ1*Qis returned.= 'I':Qis initialized to the unit matrix, and the unitary matrixQis returned.= 'N':Qis not computed.
MโM is INTEGER- The number of rows of the matrix
A.M >= 0.
- The number of rows of the matrix
PโP is INTEGER- The number of rows of the matrix
B.P >= 0.
- The number of rows of the matrix
NโN is INTEGER- The number of columns of the matrices
AandB.N >= 0.
- The number of columns of the matrices
KโK is INTEGERLโL is INTEGERKandLspecify the subblocks in the input matricesAandB:A23 = A(K+1:MIN(K+L,M),N-L+1:N)andB13 = B(1:L,,N-L+1:N)ofAandB, whose GSVD is going to be computed byCTGSJA.- See Further Details.
AโA is COMPLEX array, dimension (LDA,N)- On entry, the
M-by-NmatrixA. - On exit,
A(N-K+1:N,1:MIN(K+L,M) )contains the triangular matrixRor part ofR. See Purpose for details.
- On entry, the
LDAโLDA is INTEGER- The leading dimension of the array
A.LDA >= max(1,M).
- The leading dimension of the array
BโB is COMPLEX array, dimension (LDB,N)- On entry, the
P-by-NmatrixB. - On exit, if necessary,
B(M-K+1:L,N+M-K-L+1:N)contains a part ofR. See Purpose for details.
- On entry, the
LDBโLDB is INTEGER- The leading dimension of the array
B.LDB >= max(1,P).
- The leading dimension of the array
TOLAโTOLA is REALTOLBโTOLB is REALTOLAandTOLBare the convergence criteria for the Jacobi-Kogbetliantz iteration procedure. Generally, they are the same as used in the preprocessing step, say
TOLA = MAX(M,N)*norm(A)*MACHEPS,
TOLB = MAX(P,N)*norm(B)*MACHEPS.
ALPHAโALPHA is REAL array, dimension (N)BETAโBETA is REAL array, dimension (N)- On exit,
ALPHAandBETAcontain the generalized singular value pairs ofAandB;
- On exit,
ALPHA(1:K) = 1,
BETA(1:K) = 0,
and if M-K-L >= 0,
ALPHA(K+1:K+L) = diag(C),
BETA(K+1:K+L) = diag(S),
or if M-K-L < 0,
ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0
BETA(K+1:M) = S, BETA(M+1:K+L) = 1.
Furthermore, if K+L < N,
ALPHA(K+L+1:N) = 0
BETA(K+L+1:N) = 0.
UโU is COMPLEX array, dimension (LDU,M)- On entry, if
JOBU = 'U',Umust contain a matrixU1(usually the unitary matrix returned byCGGSVP). - On exit, if
JOBU = 'I',Ucontains the unitary matrixU; ifJOBU = 'U',Ucontains the productU1*U. - If
JOBU = 'N',Uis not referenced.
- On entry, if
LDUโLDU is INTEGER- The leading dimension of the array
U.LDU >= max(1,M)ifJOBU = 'U';LDU >= 1otherwise.
- The leading dimension of the array
VโV is COMPLEX array, dimension (LDV,P)- On entry, if
JOBV = 'V',Vmust contain a matrixV1(usually the unitary matrix returned byCGGSVP). - On exit, if
JOBV = 'I',Vcontains the unitary matrixV; ifJOBV = 'V',Vcontains the productV1*V. - If
JOBV = 'N',Vis not referenced.
- On entry, if
LDVโLDV is INTEGER- The leading dimension of the array
V.LDV >= max(1,P)ifJOBV = 'V';LDV >= 1otherwise.
- The leading dimension of the array
QโQ is COMPLEX array, dimension (LDQ,N)- On entry, if
JOBQ = 'Q',Qmust contain a matrixQ1(usually the unitary matrix returned byCGGSVP). - On exit, if
JOBQ = 'I',Qcontains the unitary matrixQ; ifJOBQ = 'Q',Qcontains the productQ1*Q. - If
JOBQ = 'N',Qis not referenced.
- On entry, if
LDQโLDQ is INTEGER- The leading dimension of the array
Q.LDQ >= max(1,N)ifJOBQ = 'Q';LDQ >= 1otherwise.
- The leading dimension of the array
WORKโWORK is COMPLEX array, dimension (2*N)NCYCLEโNCYCLE is INTEGER- The number of cycles required for convergence.
INFOโINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.= 1: the procedure does not converge afterMAXITcycles.
๐ง Internal Parameters:
this is where part 1 stops, bestie โ the next part picks up right here and keeps the function-doc energy going. ๐
MAXITโ is anINTEGER. It says how many total loops the iterative procedure is allowed to take. If afterMAXITcycles the routine still hasnโt converged, bestie, we returnINFO = 1. ๐
โจ Author โจ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ธ Further Details ๐ธ
!>
!> CTGSJA essentially uses a variant of Kogbetliantz algorithm to reduce
!> min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L
!> matrix B13 to the form:
!>
!> U1**H *A13*Q1 = C1*R1; V1**H *B13*Q1 = S1*R1,
!>
!> where U1, V1 and Q1 are unitary matrix.
!> C1 and S1 are diagonal matrices satisfying
!>
!> C1**2 + S1**2 = I,
!>
!> and R1 is an L-by-L nonsingular upper triangular matrix.
!>
Definition at line 376 of file ctgsja.f.
๐งฎ subroutine dtgsja (character jobu, character jobv, character jobq, integer m, integer p, integer n, integer k, integer l, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision tola, double precision tolb, double precision, dimension( * ) alpha, double precision, dimension( * ) beta, double precision, dimension( ldu, * ) u, integer ldu, double precision, dimension( ldv, * ) v, integer ldv, double precision, dimension( ldq, * ) q, integer ldq, double precision, dimension( * ) work, integer ncycle, integer info)
๐ฆ DTGSJA
๐ Purpose
Okay so DTGSJA computes the generalized singular value decomposition (GSVD) of two real upper triangular (or trapezoidal) matrices A and B. Slay. โจ
On entry, it is assumed that matrices A and B have the following forms, which may be obtained by the preprocessing subroutine DGGSVP from a general M-by-N matrix A and P-by-N matrix B:
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L >= 0;
L ( 0 0 A23 )
M-K-L ( 0 0 0 )
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L < 0;
M-K ( 0 0 A23 )
N-K-L K L
B = L ( 0 0 B13 )
P-L ( 0 0 0 )
where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, otherwise A23 is (M-K)-by-L upper trapezoidal. ๐ซถ
On exit,
U**T *A*Q = D1*( 0 R ), V**T *B*Q = D2*( 0 R ),
where U, V and Q are orthogonal matrices. R is a nonsingular upper triangular matrix, and D1 and D2 are โdiagonalโ matrices, which are of the following structures:
If M-K-L >= 0,
K L
D1 = K ( I 0 )
L ( 0 C )
M-K-L ( 0 0 )
K L
D2 = L ( 0 S )
P-L ( 0 0 )
N-K-L K L
( 0 R ) = K ( 0 R11 R12 ) K
L ( 0 0 R22 ) L
where
C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
S = diag( BETA(K+1), ... , BETA(K+L) ),
C**2 + S**2 = I.
R is stored in A(1:K+L,N-K-L+1:N) on exit.
If M-K-L < 0,
K M-K K+L-M
D1 = K ( I 0 0 )
M-K ( 0 C 0 )
K M-K K+L-M
D2 = M-K ( 0 S 0 )
K+L-M ( 0 0 I )
P-L ( 0 0 0 )
N-K-L K M-K K+L-M
( 0 R ) = K ( 0 R11 R12 R13 )
M-K ( 0 0 R22 R23 )
K+L-M ( 0 0 0 R33 )
where
C = diag( ALPHA(K+1), ... , ALPHA(M) ),
S = diag( BETA(K+1), ... , BETA(M) ),
C**2 + S**2 = I.
R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored
( 0 R22 R23 )
in B(M-K+1:L,N+M-K-L+1:N) on exit.
The computation of the orthogonal transformation matrices U, V or Q is optional. These matrices may either be formed explicitly, or they may be postmultiplied into input matrices U1, V1, or Q1. ๐
๐ Parameters
JOBUโ isCHARACTER*1.= 'U':Umust contain an orthogonal matrixU1on entry, and the productU1*Uis returned;= 'I':Uis initialized to the unit matrix, and the orthogonal matrixUis returned;= 'N':Uis not computed.
JOBVโ isCHARACTER*1.= 'V':Vmust contain an orthogonal matrixV1on entry, and the productV1*Vis returned;= 'I':Vis initialized to the unit matrix, and the orthogonal matrixVis returned;= 'N':Vis not computed.
JOBQโ isCHARACTER*1.= 'Q':Qmust contain an orthogonal matrixQ1on entry, and the productQ1*Qis returned;= 'I':Qis initialized to the unit matrix, and the orthogonal matrixQis returned;= 'N':Qis not computed.
Mโ isINTEGER. The number of rows of the matrixA.M >= 0.Pโ isINTEGER. The number of rows of the matrixB.P >= 0.Nโ isINTEGER. The number of columns of the matricesAandB.N >= 0.Kโ isINTEGER.Lโ isINTEGER.KandLspecify the subblocks in the input matricesAandB:A23 = A(K+1:MIN(K+L,M),N-L+1:N)andB13 = B(1:L,N-L+1:N)ofAandB, whose GSVD is going to be computed byDTGSJA. See Further Details. ๐Aโ isDOUBLE PRECISIONarray, dimension(LDA,N). On entry, theM-by-NmatrixA. On exit,A(N-K+1:N,1:MIN(K+L,M) )contains the triangular matrixRor part ofR. See Purpose for details.LDAโ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bโ isDOUBLE PRECISIONarray, dimension(LDB,N). On entry, theP-by-NmatrixB. On exit, if necessary,B(M-K+1:L,N+M-K-L+1:N)contains a part ofR. See Purpose for details.LDBโ isINTEGER. The leading dimension of the arrayB.LDB >= max(1,P).TOLAโ isDOUBLE PRECISION.TOLBโ isDOUBLE PRECISION.TOLAandTOLBare the convergence criteria for the Jacobi-Kogbetliantz iteration procedure. Generally, they are the same as used in the preprocessing step, say
TOLA = max(M,N)*norm(A)*MAZHEPS,
TOLB = max(P,N)*norm(B)*MAZHEPS.
ALPHAโ isDOUBLE PRECISIONarray, dimension(N).BETAโ isDOUBLE PRECISIONarray, dimension(N). On exit,ALPHAandBETAcontain the generalized singular value pairs ofAandB;
ALPHA(1:K) = 1,
BETA(1:K) = 0,
and if M-K-L >= 0,
ALPHA(K+1:K+L) = diag(C),
BETA(K+1:K+L) = diag(S),
or if M-K-L < 0,
ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0
BETA(K+1:M) = S, BETA(M+1:K+L) = 1.
Furthermore, if K+L < N,
ALPHA(K+L+1:N) = 0 and
BETA(K+L+1:N) = 0.
Uโ isDOUBLE PRECISIONarray, dimension(LDU,M). On entry, ifJOBU = 'U',Umust contain a matrixU1(usually the orthogonal matrix returned byDGGSVP). On exit, ifJOBU = 'I',Ucontains the orthogonal matrixU; ifJOBU = 'U',Ucontains the productU1*U. IfJOBU = 'N',Uis not referenced.LDUโ isINTEGER. The leading dimension of the arrayU.LDU >= max(1,M)ifJOBU = 'U';LDU >= 1otherwise.Vโ isDOUBLE PRECISIONarray, dimension(LDV,P). On entry, ifJOBV = 'V',Vmust contain a matrixV1(usually the orthogonal matrix returned byDGGSVP). On exit, ifJOBV = 'I',Vcontains the orthogonal matrixV; ifJOBV = 'V',Vcontains the productV1*V. IfJOBV = 'N',Vis not referenced.LDVโ isINTEGER. The leading dimension of the arrayV.LDV >= max(1,P)ifJOBV = 'V';LDV >= 1otherwise.Qโ isDOUBLE PRECISIONarray, dimension(LDQ,N). On entry, ifJOBQ = 'Q',Qmust contain a matrixQ1(usually the orthogonal matrix returned byDGGSVP). On exit, ifJOBQ = 'I',Qcontains the orthogonal matrixQ; ifJOBQ = 'Q',Qcontains the productQ1*Q. IfJOBQ = 'N',Qis not referenced.LDQโ isINTEGER. The leading dimension of the arrayQ.LDQ >= max(1,N)ifJOBQ = 'Q';LDQ >= 1otherwise.WORKโ isDOUBLE PRECISIONarray, dimension(2*N).NCYCLEโ isINTEGER. The number of cycles required for convergence.INFOโ
INFO ๐
INFOโINFOisINTEGER, and hereโs the whole mood:
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value.
= 1: the procedure does not converge after MAXIT cycles.
Internal Parameters ๐ง
MAXITโMAXITisINTEGER, and it sets the whole loop budget:
MAXIT specifies the total loops that the iterative procedure
may take. If after MAXIT cycles, the routine fails to
converge, we return INFO = 1.
Author ๐ซถ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details โจ
Okay so DTGSJA is out here essentially using a variant of the Kogbetliantz algorithm to reduce the min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and the L-by-L matrix B13 to this form:
U1**T *A13*Q1 = C1*R1; V1**T *B13*Q1 = S1*R1,
where U1, V1 and Q1 are orthogonal matrix, and Z**T is the transpose of Z. C1 and S1 are diagonal matrices satisfying
C1**2 + S1**2 = I,
and R1 is an L-by-L nonsingular upper triangular matrix.
Definition at line 375 of file dtgsja.f.
subroutine stgsja ๐
subroutine stgsja (character jobu, character jobv, character jobq, integer
m, integer p, integer n, integer k, integer l, real, dimension( lda, * )
a, integer lda, real, dimension( ldb, * ) b, integer ldb, real tola,
real tolb, real, dimension( * ) alpha, real, dimension( * ) beta, real,
dimension( ldu, * ) u, integer ldu, real, dimension( ldv, * ) v, integer
ldv, real, dimension( ldq, * ) q, integer ldq, real, dimension( * )
work, integer ncycle, integer info)
STGSJA ๐
Purpose ๐
Bestie, listen: STGSJA computes the generalized singular value decomposition (GSVD) of two real upper triangular (or trapezoidal) matrices A and B.
On entry, it is assumed that matrices A and B have the following forms, which may be obtained by the preprocessing subroutine SGGSVP from a general M-by-N matrix A and P-by-N matrix B:
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L >= 0;
L ( 0 0 A23 )
M-K-L ( 0 0 0 )
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L < 0;
M-K ( 0 0 A23 )
N-K-L K L
B = L ( 0 0 B13 )
P-L ( 0 0 0 )
where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, otherwise A23 is (M-K)-by-L upper trapezoidal.
On exit,
U**T *A*Q = D1*( 0 R ), V**T *B*Q = D2*( 0 R ),
where U, V and Q are orthogonal matrices. R is a nonsingular upper triangular matrix, and D1 and D2 are ``diagonal'' matrices, which are of the following structures:
If M-K-L >= 0,
K L
D1 = K ( I 0 )
L ( 0 C )
M-K-L ( 0 0 )
K L
D2 = L ( 0 S )
P-L ( 0 0 )
N-K-L K L
( 0 R ) = K ( 0 R11 R12 ) K
L ( 0 0 R22 ) L
where
C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
S = diag( BETA(K+1), ... , BETA(K+L) ),
C**2 + S**2 = I.
R is stored in A(1:K+L,N-K-L+1:N) on exit.
If M-K-L < 0,
K M-K K+L-M
D1 = K ( I 0 0 )
M-K ( 0 C 0 )
K M-K K+L-M
D2 = M-K ( 0 S 0 )
K+L-M ( 0 0 I )
P-L ( 0 0 0 )
N-K-L K M-K K+L-M
( 0 R ) = K ( 0 R11 R12 R13 )
M-K ( 0 0 R22 R23 )
K+L-M ( 0 0 0 R33 )
where
C = diag( ALPHA(K+1), ... , ALPHA(M) ),
S = diag( BETA(K+1), ... , BETA(M) ),
C**2 + S**2 = I.
R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored
( 0 R22 R23 )
in B(M-K+1:L,N+M-K-L+1:N) on exit.
The computation of the orthogonal transformation matrices U, V or Q is optional. These matrices may either be formed explicitly, or they may be postmultiplied into input matrices U1, V1, or Q1.
Parameters ๐ฅ
JOBUโJOBUisCHARACTER*1, and it decides what happens withU:
= 'U': U must contain an orthogonal matrix U1 on entry, and
the product U1*U is returned;
= 'I': U is initialized to the unit matrix, and the
orthogonal matrix U is returned;
= 'N': U is not computed.
JOBVโJOBVisCHARACTER*1, same energy but forV:
= 'V': V must contain an orthogonal matrix V1 on entry, and
the product V1*V is returned;
= 'I': V is initialized to the unit matrix, and the
orthogonal matrix V is returned;
= 'N': V is not computed.
JOBQโJOBQisCHARACTER*1, and it runs theQsituation:
= 'Q': Q must contain an orthogonal matrix Q1 on entry, and
the product Q1*Q is returned;
= 'I': Q is initialized to the unit matrix, and the
orthogonal matrix Q is returned;
= 'N': Q is not computed.
MโMisINTEGER. Itโs the number of rows of the matrixA.M >= 0.PโPisINTEGER. Itโs the number of rows of the matrixB.P >= 0.NโNisINTEGER. Itโs the number of columns of the matricesAandB.N >= 0.KโKisINTEGER.LโLisINTEGER, and together withKit specifies the subblocks in the input matricesAandB:
K and L specify the subblocks in the input matrices A and B:
A23 = A(K+1:MIN(K+L,M),N-L+1:N) and B13 = B(1:L,N-L+1:N)
of A and B, whose GSVD is going to be computed by STGSJA.
See Further Details.
AโAisREALarray, dimension(LDA,N). On entry, theM-by-NmatrixA. On exit,A(N-K+1:N,1:MIN(K+L,M) )contains the triangular matrixRor part ofR. See Purpose for details.LDAโLDAisINTEGER. Itโs the leading dimension of the arrayA.LDA >= max(1,M).BโBisREALarray, dimension(LDB,N). On entry, theP-by-NmatrixB. On exit, if necessary,B(M-K+1:L,N+M-K-L+1:N)contains a part ofR. See Purpose for details.LDBโLDBisINTEGER. Itโs the leading dimension of the arrayB.LDB >= max(1,P).TOLAโTOLAisREAL.TOLBโTOLBisREAL.TOLAandTOLBare the convergence criteria for the Jacobi-Kogbetliantz iteration procedure. Generally, they are the same as used in the preprocessing step, say
TOLA = max(M,N)*norm(A)*MACHEPS,
TOLB = max(P,N)*norm(B)*MACHEPS.
ALPHAโALPHAisREALarray, dimension(N).BETAโBETAisREALarray, dimension(N). On exit,ALPHAandBETAcontain the generalized singular value pairs ofAandB;
ALPHA(1:K) = 1,
BETA(1:K) = 0,
and if M-K-L >= 0,
ALPHA(K+1:K+L) = diag(C),
BETA(K+1:K+L) = diag(S),
or if M-K-L < 0,
ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0
BETA(K+1:M) = S, BETA(M+1:K+L) = 1.
Furthermore, if K+L < N,
ALPHA(K+L+1:N) = 0 and
BETA(K+L+1:N) = 0.
UโUisREALarray, dimension(LDU,M). On entry, ifJOBU = 'U',Umust contain a matrixU1(usually the orthogonal matrix returned bySGGSVP). On exit, ifJOBU = 'I',Ucontains the orthogonal matrixU; ifJOBU = 'U',Ucontains the productU1*U. IfJOBU = 'N',Uis not referenced.LDUโLDUisINTEGER. Itโs the leading dimension of the arrayU.LDU >= max(1,M)ifJOBU = 'U';LDU >= 1otherwise.VโVisREALarray, dimension(LDV,P). On entry, ifJOBV = 'V',Vmust contain a matrixV1(usually the orthogonal matrix returned bySGGSVP). On exit, ifJOBV = 'I',Vcontains the orthogonal matrixV; ifJOBV = 'V',Vcontains the productV1*V. IfJOBV = 'N',Vis not referenced.LDVโLDVisINTEGER. Itโs the leading dimension of the arrayV.LDV >= max(1,P)ifJOBV = 'V';LDV >= 1otherwise.QโQisREALarray, dimension(LDQ,N). On entry, ifJOBQ = 'Q',Qmust contain a matrixQ1(usually the orthogonal matrix returned bySGGSVP). On exit, ifJOBQ = 'I',Qcontains the orthogonal matrixQ; ifJOBQ = 'Q',Qcontains the productQ1*Q. IfJOBQ = 'N',Qis not referenced.LDQโLDQisINTEGER. Itโs the leading dimension of the arrayQ.LDQ >= max(1,N)ifJOBQ = 'Q';LDQ >= 1otherwise.WORKโWORKisREALarray, dimension(2*N).NCYCLENCYCLEโINTEGER. Bestie, this is the number of cycles required for convergence. โจINFOโINTEGER. Exit report card, no cap:= 0: successful exit, we love to see it ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐= 1: the procedure does not converge afterMAXITcycles ๐
๐ง Internal Parameters ๐ง
MAXITโINTEGER.MAXITspecifies the total loops that the iterative procedure may take. If afterMAXITcycles the routine fails to converge, we returnINFO = 1. Like, it tried its best, but the vibe check said no. ๐ซถ
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ Further Details ๐
STGSJA essentially uses a variant of Kogbetliantz algorithm to reduce min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L matrix B13 to the form:
U1**T *A13*Q1 = C1*R1; V1**T *B13*Q1 = S1*R1,
where U1, V1 and Q1 are orthogonal matrix, and Z**T is the transpose of Z. C1 and S1 are diagonal matrices satisfying
C1**2 + S1**2 = I,
and R1 is an L-by-L nonsingular upper triangular matrix.
Definition at line 375 of file stgsja.f.
๐ง ztgsja โ the complex*16 GSVD sibling ๐ง
subroutine ztgsja (character jobu, character jobv, character jobq, integer
m, integer p, integer n, integer k, integer l, complex*16, dimension(
lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b, integer ldb,
double precision tola, double precision tolb, double precision,
dimension( * ) alpha, double precision, dimension( * ) beta, complex*16,
dimension( ldu, * ) u, integer ldu, complex*16, dimension( ldv, * ) v,
integer ldv, complex*16, dimension( ldq, * ) q, integer ldq, complex*16,
dimension( * ) work, integer ncycle, integer info)
ZTGSJA
๐ Purpose ๐
ZTGSJA computes the generalized singular value decomposition (GSVD) of two complex upper triangular (or trapezoidal) matrices A and B. Iconic behavior, honestly. ๐
On entry, it is assumed that matrices A and B have the following forms, which may be obtained by the preprocessing subroutine ZGGSVP from a general M-by-N matrix A and P-by-N matrix B:
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L >= 0;
L ( 0 0 A23 )
M-K-L ( 0 0 0 )
N-K-L K L
A = K ( 0 A12 A13 ) if M-K-L < 0;
M-K ( 0 0 A23 )
N-K-L K L
B = L ( 0 0 B13 )
P-L ( 0 0 0 )
where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, otherwise A23 is (M-K)-by-L upper trapezoidal.
On exit,
U**H *A*Q = D1*( 0 R ), V**H *B*Q = D2*( 0 R ),
where U, V and Q are unitary matrices. R is a nonsingular upper triangular matrix, and D1 and D2 are โdiagonalโ matrices, which are of the following structures:
If M-K-L >= 0,
K L
D1 = K ( I 0 )
L ( 0 C )
M-K-L ( 0 0 )
K L
D2 = L ( 0 S )
P-L ( 0 0 )
N-K-L K L
( 0 R ) = K ( 0 R11 R12 ) K
L ( 0 0 R22 ) L
where
C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),
S = diag( BETA(K+1), ... , BETA(K+L) ),
C**2 + S**2 = I.
R is stored in A(1:K+L,N-K-L+1:N) on exit.
If M-K-L < 0,
K M-K K+L-M
D1 = K ( I 0 0 )
M-K ( 0 C 0 )
K M-K K+L-M
D2 = M-K ( 0 S 0 )
K+L-M ( 0 0 I )
P-L ( 0 0 0 )
N-K-L K M-K K+L-M
( 0 R ) = K ( 0 R11 R12 R13 )
M-K ( 0 0 R22 R23 )
K+L-M ( 0 0 0 R33 )
where
C = diag( ALPHA(K+1), ... , ALPHA(M) ),
S = diag( BETA(K+1), ... , BETA(M) ),
C**2 + S**2 = I.
R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored
( 0 R22 R23 )
in B(M-K+1:L,N+M-K-L+1:N) on exit.
The computation of the unitary transformation matrices U, V or Q is optional. These matrices may either be formed explicitly, or they may be postmultiplied into input matrices U1, V1, or Q1. Choose your adventure, bestie. ๐
๐ Parameters ๐
JOBUโCHARACTER*1.= 'U':Umust contain a unitary matrixU1on entry, and the productU1*Uis returned.= 'I':Uis initialized to the unit matrix, and the unitary matrixUis returned.= 'N':Uis not computed. Not invited to the function, literally.
JOBVโCHARACTER*1.= 'V':Vmust contain a unitary matrixV1on entry, and the productV1*Vis returned.= 'I':Vis initialized to the unit matrix, and the unitary matrixVis returned.= 'N':Vis not computed.
JOBQโCHARACTER*1.= 'Q':Qmust contain a unitary matrixQ1on entry, and the productQ1*Qis returned.= 'I':Qis initialized to the unit matrix, and the unitary matrixQis returned.= 'N':Qis not computed.
MโINTEGER. The number of rows of the matrixA.M >= 0.PโINTEGER. The number of rows of the matrixB.P >= 0.NโINTEGER. The number of columns of the matricesAandB.N >= 0.KโINTEGER.LโINTEGER.KandLspecify the subblocks in the input matricesAandB:A23 = A(K+1:MIN(K+L,M),N-L+1:N)andB13 = B(1:L,,N-L+1:N)ofAandB, whose GSVD is going to be computed byZTGSJA. See Further Details. ๐ฆAโCOMPLEX*16 array, dimension (LDA,N). On entry, theM-by-NmatrixA. On exit,A(N-K+1:N,1:MIN(K+L,M) )contains the triangular matrixRor part ofR. See Purpose for details.LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโCOMPLEX*16 array, dimension (LDB,N). On entry, theP-by-NmatrixB. On exit, if necessary,B(M-K+1:L,N+M-K-L+1:N)contains a part ofR. See Purpose for details.LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,P).TOLAโDOUBLE PRECISION.TOLBโDOUBLE PRECISION.TOLAandTOLBare the convergence criteria for the Jacobi-Kogbetliantz iteration procedure. Generally, they are the same as used in the preprocessing step, say
TOLA = MAX(M,N)*norm(A)*MAZHEPS,
TOLB = MAX(P,N)*norm(B)*MAZHEPS.
ALPHAโDOUBLE PRECISION array, dimension (N).BETAโDOUBLE PRECISION array, dimension (N). On exit,ALPHAandBETAcontain the generalized singular value pairs ofAandB;
ALPHA(1:K) = 1,
BETA(1:K) = 0,
and if M-K-L >= 0,
ALPHA(K+1:K+L) = diag(C),
BETA(K+1:K+L) = diag(S),
or if M-K-L < 0,
ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0
BETA(K+1:M) = S, BETA(M+1:K+L) = 1.
Furthermore, if K+L < N,
ALPHA(K+L+1:N) = 0 and
BETA(K+L+1:N) = 0.
UโCOMPLEX*16 array, dimension (LDU,M). On entry, ifJOBU = 'U',Umust contain a matrixU1(usually the unitary matrix returned byZGGSVP). On exit, ifJOBU = 'I',Ucontains the unitary matrixU; ifJOBU = 'U',Ucontains the productU1*U. IfJOBU = 'N',Uis not referenced.LDUโINTEGER. The leading dimension of the arrayU.LDU >= max(1,M)ifJOBU = 'U';LDU >= 1otherwise.VโCOMPLEX*16 array, dimension (LDV,P). On entry, ifJOBV = 'V',Vmust contain a matrixV1(usually the unitary matrix returned byZGGSVP). On exit, ifJOBV = 'I',Vcontains the unitary matrixV; ifJOBV = 'V',Vcontains the productV1*V. IfJOBV = 'N',Vis not referenced.LDVโINTEGER. The leading dimension of the arrayV.LDV >= max(1,P)ifJOBV = 'V';LDV >= 1otherwise.QโCOMPLEX*16 array, dimension (LDQ,N). On entry, ifJOBQ = 'Q',Qmust contain a matrixQ1(usually the unitary matrix returned byZGGSVP). On exit, ifJOBQ = 'I',Qcontains the unitary matrixQ; ifJOBQ = 'Q',Qcontains the productQ1*Q. IfJOBQ = 'N',Qis not referenced.LDQโLDQโ is anINTEGER, and it's the leading dimension of the arrayQ. The rule isLDQ >= max(1,N)ifJOBQ = 'Q'; otherwiseLDQ >= 1. Slay. ๐WORKโWORKis aCOMPLEX*16array with dimension(2*N). That's it, that's the whole vibe. โจNCYCLEโ is anINTEGER, and it tells you the number of cycles required for convergence. Lowkey important. ๐INFOโ is anINTEGER, and its whole personality is:= 0: successful exit, we love a happy ending ๐ซถ< 0: ifINFO = -i, the i-th argument had an illegal value โ not iconic, fix your args ๐ญ= 1: the procedure does not converge afterMAXITcycles โ it just did not slay ๐
๐งฎ Internal Parameters ๐งฎ
MAXITโ is anINTEGER. It specifies the total loops that the iterative procedure may take. If afterMAXITcycles the routine fails to converge, we returnINFO = 1. So yeah, it's the patience meter, bestie. โณ
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
These are the legends behind it, periodt. ๐
๐ Further Details ๐
ZTGSJA essentially uses a variant of Kogbetliantz algorithm to reduce min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L matrix B13 to the form:
U1**H *A13*Q1 = C1*R1; V1**H *B13*Q1 = S1*R1,
where U1, V1 and Q1 are unitary matrix. C1 and S1 are diagonal matrices satisfying
C1**2 + S1**2 = I,
and R1 is an L-by-L nonsingular upper triangular matrix. Math girlie ate that. ๐ฅ
Definition at line 376 of file ztgsja.f.
๐ค Author ๐ค
Generated automatically by Doxygen for LAPACK from the source code.
And that's the footer, bestie: source LAPACK, Version 3.12.0, page tgsja(3) โ that's the sign-off, no cap. ๐โจ๐ฆ
๐ฆ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms