# DSPF_sp_svd_cmplx [Matrix]

Collaboration diagram for DSPF_sp_svd_cmplx:

## Detailed Description

 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)

## Function Documentation

 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]

Parameters:
 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)]
Algorithm:
DSPF_sp_svd_cmplx_cn.c is the natural C equivalent of the optimized intrinsic C code without restrictions. Note that the intrinsic C code is optimized and restrictions may apply.
Assumptions:
1. The arrays A,U,D,V,U1,diag,and superdiag are stored in distinct arrays. In-place processing of A is not allowed.
2. The arrays consist of complex number entries with alternating real and imaginary parts: real0,imag0,real1,imag1,...
Implementation Notes:
Interruptibility : The code is interruptible.
Endian support : supports both Little and Big endian modes.