function SVDGen(B: TMtx; C: TVec; S: TVec; U: TMtx; V: TMtx; Q: TMtx): Integer;
Computes generalized singular value decomposition.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | B | TMtx | source TMtx |
| 2 | C | TVec | source TVec |
| 3 | S | TVec | source TVec |
| 4 | U | TMtx | source TMtx |
| 5 | V | TMtx | source TMtx |
| 6 | Q | TMtx | source TMtx |
Returns: Int32
Computes the generalized singular value decomposition (GSVD) of an M-by-N real matrix A and P-by-N real matrix B:
U'*A*Q = D1*( 0 R ), V'*B*Q = D2*( 0 R )
where U, V and Q are orthogonal matrices, and Z' is the transpose of Z. The routine computes optionally the orthogonal transformation matrices U, V and Q. D1 and D2 are diagonal matrices, which on their diagonals contain C and S.
K L
D1 = K [ I 0 ]
L [ 0 C ]
M-K-L [ 0 0 ]
K L
D2 = L [ 0 S ]
P-L [ 0 0 ]
The generalized singular values, stored in C and S on exit, have the property:
sqr(C) + sqr(S) = I
The generalized singular value pairs of A and B in case of rank deficiency are stored like this:
c(0:k-1) = 1, s(0:k-1) = 0, and if m-k-l = 0, c(k:k+l-1) = C, s(k:k+l-1) = S, or if m-k-l < 0, c(k:m-1)= C, c(m:k+l-1)=0 s(k:m-1) = S, s(m:k+l-1) = 1 and c(k+l:n-1) = 0 s(k+l:n-1) = 0
Effective rank is k + l.
If B is an N-by-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'
If ( A',B')' 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:
A'*A X := lambda* B'*B X
In some literature, the GSVD of A and B is presented in the form
U'*A*X := ( 0 D1 ), V'*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:
X := Q*( I 0 )
( 0 inv(R) )
The function returns the effective numerical rank of (A', B') = K + L.
Reference: Lapack v3.4 source code
A*inv(B] := U*(D1*inv(D2))*V'