|
|
◆ WDggsvd3()
| Function WDggsvd3 |
( |
Jobu As |
String, |
|
|
Jobv As |
String, |
|
|
Jobq As |
String, |
|
|
M As |
Long, |
|
|
N As |
Long, |
|
|
P As |
Long, |
|
|
A As |
Variant, |
|
|
B As |
Variant |
|
) |
| |
Generalized singular value decomposition (GSVD)
- Purpose
- WDggsvd3 computes the generalized singular value decomposition (GSVD) of an M x N real matrix A and P x N real matrix B:
U^T*A*Q = D1*(0 R), V^T*B*Q = D2*(0 R)
where, U, V and Q are orthogonal matrices.
Let K+L = the effective numerical rank of the matrix (A^T, B^T)^T, then R is a K+L x K+L nonsingular upper triangular matrix, D1 and D2 are M x K+L and P x K+L "diagonal" matrices and of the following structures, respectively:
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)
L ( 0 0 R22)
where
C = diag(Alpha(K), ... , Alpha(K+L-1)),
S = diag(Beta(K)), ... , Beta(K+L-1)),
C^2 + S^2 = I.
R is stored in A(0 to K+L-1, N-K-L to N-1) 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), ... , Alpha(M-1)),
S = diag(Beta(K), ... , Beta(M-1)),
C^2 + S^2 = I.
(R11 R12 R13) is stored in A(0 to M-1, N-K-L to N-1), and R33 is stored
( 0 R22 R23)
in B(M-K to L-1, N+M-K-L to N-1) on exit.
The routine computes C, S, R, and optionally the orthogonal transformation matrices U, V and Q.
Alpha() and Beta() contain the generalized singular value pairs of A and B.
Alpha(0 to K-1) = 1,
Beta(0 to K-1) = 0,
and if M-K-L >= 0,
Alpha(K to K+L-1) = C,
Beta(K to K+L-1) = S,
or if M-K-L < 0,
Alpha(K to M-1)= C, Alpha(M to K+L-1) = 0,
Beta(K to M-1) = S, Beta(M to K+L-1) = 1,
and
Alpha(K+L to N-1) = 0,
Beta(K+L to N-1) = 0.
In particular, if B is an N x N nonsingular matrix, then the GSVD of A and B implicitly gives the SVD of A*inv(B). A*inv(B) = U*(D1*inv(D2))*V^T
If (A^T, B^T)^T has orthonormal columns, then the GSVD of A and B is also equal to the CS decomposition of A and B. Furthermore, the GSVD can be used to derive the solution of the eigenvalue problem: In some literature, the GSVD of A and B is presented in the form U^T*A*X = (0 D1), V^T*B*X = (0 D2)
where U and V are orthogonal and X is nonsingular, D1 and D2 are "diagonal". The former GSVD form can be converted to the latter form by taking the nonsingular matrix X as
- Returns
- N+1×K+L+2 (Jobu = "N", Jobv = "N", Jobq = "N")
| Column 1 | Column 2 | Columns 3 to K+L+2 |
| Rows 1 to N | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R |
| Row N+1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) |
max(M,N)+1×K+L+M+2 (Jobu = "U", Jobv = "N", Jobq = "N")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+M+2 |
| Rows 1 to max(M, N) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | M x M orthogonal matrix U |
| Row max(M, N) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 |
max(N,P)+1×K+L+P+2 (Jobu = "N", Jobv = "V", Jobq = "N")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+P+2 |
| Rows 1 to max(N, P) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | P x P orthogonal matrix V |
| Row max(N, P) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 |
N+1×K+L+N+2 (Jobu = "N", Jobv = "N", Jobq = "Q")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+N+2 |
| Rows 1 to N | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | N x N orthogonal matrix Q |
| Row N+1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 |
max(M,N,P)+1×K+L+M+P+2 (Jobu = "U", Jobv = "V", Jobq = "N")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+M+2 | Columns K+L+M+3 to K+L+M+P+2 |
| Rows 1 to max(M, N, P) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | M x M orthogonal matrix U | P x P orthogonal matrix V |
| Row max(M, N, P) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 | 0 |
max(M,N)+1×K+L+M+N+2 (Jobu = "U", Jobv = "N", Jobq = "Q")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+M+2 | Columns K+L+M+3 to K+L+M+N+2 |
| Rows 1 to max(M, N) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | M x M orthogonal matrix U | N x N orthogonal matrix Q |
| Row max(M, N) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 | 0 |
max(N,P)+1×K+L+N+P+2 (Jobu = "N", Jobv = "V", Jobq = "N")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+P+2 | Columns K+L+P+3 to K+L+N+P+2 |
| Rows 1 to max(N, P) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | P x P orthogonal matrix V | N x N orthogonal matrix Q |
| Row max(N, P) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 | 0 |
max(M,N,P)+1×K+L+M+N+P+2 (Jobu = "U", Jobv = "V", Jobq = "Q")
| Column 1 | Column 2 | Columns 3 to K+L+2 | Columns K+L+3 to K+L+M+2 | Columns K+L+M+3 to K+L+M+P+2 | Columns K+L+M+P+3 to K+L+M+N+P+2 |
| Rows 1 to max(M, N, P) | Alpha(j) (j = 1 to N) | Beta(j) (j = 1 to N) | K+L x K+L upper triangular matrix R | M x M orthogonal matrix U | P x P orthogonal matrix V | N x N orthogonal matrix Q |
| Row max(M, N, P) + 1 | Return code | Dimension of the subblocks K | Dimension of the subblocks L (Column 3) | 0 | 0 | 0 |
Return code.
= 0: Successful exit.
= 1: The Jacobi-type procedure failed to converge.
- Parameters
-
| [in] | Jobu | = "U": Orthogonal matrix U is computed.
= "N": U is not computed. |
| [in] | Jobv | = "V": Orthogonal matrix V is computed.
= "N": V is not computed. |
| [in] | Jobq | = "Q": Orthogonal matrix Q is computed.
= "N": Q is not computed. |
| [in] | M | Number of rows of the matrix A. (M >= 1) |
| [in] | N | Number of columns of the matrices A and B. (N >= 1) |
| [in] | P | Number of rows of the matrix B. (P >= 1) |
| [in] | A | (M x N) M x N matrix A. |
| [in] | B | (P x N) P x N matrix B. |
- Reference
- LAPACK
- Example
- Compute generalized singular value decomposition (GSVD) of matrix A and B, where
( 1 6 11 ) ( 1 5 9 )
( 2 7 12 ) ( 2 6 10 )
A = ( 3 8 13 ), B = ( 3 7 11 )
( 4 9 14 ) ( 4 8 12 )
( 5 10 15 )
|