![]() |
![]() |
Collaboration diagram for DSPF_sp_svd_cmplx:
|
| int | DSPF_sp_svd_cmplx (const int Nrows, const int Ncols, float *restrict A, float *restrict U, float *restrict V, float *restrict U1, float *restrict diag, float *restrict superdiag) |
| int DSPF_sp_svd_cmplx | ( | const int | Nrows, | |
| const int | Ncols, | |||
| float *restrict | A, | |||
| float *restrict | U, | |||
| float *restrict | V, | |||
| float *restrict | U1, | |||
| float *restrict | diag, | |||
| float *restrict | superdiag | |||
| ) |
This routine decomposes a complex matrix A into a product of three matrices: A = U * D * V' where U and V are orthogonal matrices, V' is the Hermitian of V, and D is a diagonal matrix. If the define constant ENABLE_REDUCED_FORM is defined then the reduced form is generated else the full form is generated as shown below for the case Nrows>=Ncols. Note that the symbol ' is the Hermitian or complex conjugate transpose.
full form
U [Nrows x 2*Nrows]
D [Nrows x 2*Ncols]
V'[Ncols x 2*Ncols]
reduced form
U [Nrows x 2*Ncols]
D [Ncols x 2*Ncols]
V'[Ncols x2*Ncols]
The singular values are the diagonal elements of D and correspond to the positive square roots of the eigenvalues of the matrix A' * A. This code is suitable for dense matrices. No optimizations are made for sparse matrices. This routine calls the following routines.
1. DSPF_sp_convert_to_bidiag: converts A to bidiagonal matrix using Householder transformations.
2. DSPF_sp_bidiag_to_diag: converts bidiagonal matrix to diagonal using Givens transformations (works only for Nrows>=Ncols).
3. DSPF_sp_sort_singular_values: sorts singular values in descending order and modifies U and V matrices accordingly.
If Nrows<Ncols then the transpose of the input is generated A'=V*D'*U' and input to steps 1,2, and 3. Then the U and V matrices are switched and the D matrix is generated based on the list on singular values. The table shown below illustrates the processing for the case Nrows<Ncols.
full form V [Ncols x 2*Ncols] D'[Ncols x 2*Nrows] U'[Nrows x 2*Nrows] reduced form V [Ncols x 2*Nrows] D'[Nrows x 2*Nrows] U'[Nrows x 2*Nrows]
| Nrows | = Number of rows in A matrix | |
| Ncols | = Number of columns in A matrix | |
| A | = Pointer of matrix A | |
| U | = Pointer to matrix U | |
| V | = Pointer to matrix V | |
| U1 | = Pointer to scratch pad matrix U1[max(Nrows,Ncols)^2] | |
| diag | = Pointer to vector of diagonal elements diag[max(Nrows,Ncols)] | |
| superdiag | = Pointer to vector of superdiagonal elements superdiag[max(Nrows,Ncols)] |