Package com.imsl.math

Class ComplexSVD

java.lang.Object
com.imsl.math.ComplexSVD
All Implemented Interfaces:
Serializable

public class ComplexSVD extends Object implements Serializable
Singular Value Decomposition (SVD) of a rectangular matrix of type Complex.

ComplexSVD is based on the LAPACK routines ZGEBRD and ZBDSQR; see the LAPACK User's Guide by Anderson et al. (1999).

Let n be the number of rows in A and let p be the number of columns in A. For any n x p matrix A, there exists an n x n unitary matrix U and a p x p unitary matrix V such that

$$U^H A V = \left\{ \begin{array}{cl} \left[ \begin{array}{l} \Sigma \\ 0 \end{array} \right] & \mbox{if $n \ge p$} \\ \left[ \Sigma \,\, 0 \right] & \mbox{if $n \le p$} \end{array} \right.$$

where \(\Sigma = {\rm diag}(\sigma_1, \ldots, \sigma_m)\), and \(m = \min(n, p)\). The scalars \(\sigma_1 \geq \sigma_2 \geq \ldots \geq \sigma_m \geq 0\) are called the singular values of A. The columns of U are called the left singular vectors of A. The columns of V are called the right singular vectors of A.

The estimated rank k of A is the number of singular values that are larger than a tolerance \(\eta\). If \(\tau\) is the parameter tol in the program, then

$$\eta = \left\{ \begin{array}{cl} \tau \hfill & \mbox {if $\tau \ge 0$} \\ {\left| \tau \right|\left\| A \right\|_2 } \hfill & \mbox {if $\tau \lt 0$} \end{array} \right.$$

The Moore-Penrose generalized inverse of the matrix is computed by partitioning the matrices U, V and \(\Sigma\) as \(U = (U_1,U_2)\), \(V = (V_1,V_2)\) and \(\Sigma_1 = {\rm diag}(\sigma_1,\ldots,\sigma_k)\) where the "1" matrices are k by k. The Moore-Penrose generalized inverse is \(V_1 \Sigma_1^{-1} U_1^H\).

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The iteration did not converge
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct the singular value decomposition of a rectangular matrix with default tolerance.
    ComplexSVD(Complex[][] a, double tol)
    Construct the singular value decomposition of a rectangular matrix with a given tolerance.
    ComplexSVD(ComplexSVD svdProblem)
    Copy constructor for the computation of the singular value decomposition of a complex matrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns convergence information about the singular values.
    Compute the Moore-Penrose generalized inverse.
    int
    Returns the rank of the matrix used to construct this instance.
    double[]
    Returns the singular values.
    Returns the left singular vectors.
    Returns the right singular vectors.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ComplexSVD

      public ComplexSVD(Complex[][] a, double tol) throws ComplexSVD.DidNotConvergeException
      Construct the singular value decomposition of a rectangular matrix with a given tolerance. If tol is positive, then a singular value is considered negligible if the singular value is less than or equal to tol. If tol is negative, then a singular value is considered negligible if the singular value is less than or equal to the absolute value of the product of tol and the approximate maximum singular value of the input matrix. In the latter case, the absolute value of tol generally contains an estimate of the level of the relative error in the data.
      Parameters:
      a - a double matrix for which the singular value decomposition is to be computed.
      tol - a double scalar containing the tolerance used to determine when a singular value is negligible.
      Throws:
      IllegalArgumentException - is thrown if the row lengths of input matrix a are not equal (for example, the matrix edges are "jagged") or if input matrix a is null or empty.
      ComplexSVD.DidNotConvergeException - is thrown if the rank cannot be determined because convergence was not obtained for all singular values.
    • ComplexSVD

      public ComplexSVD(Complex[][] a) throws ComplexSVD.DidNotConvergeException
      Construct the singular value decomposition of a rectangular matrix with default tolerance. The tolerance used is eps * StrictMath.pow(eps, -0.125), where eps = 2.2204460492503e-16. This tolerance is used to determine rank. A singular value is considered negligible if the singular value is less than or equal to this tolerance.
      Parameters:
      a - a Complex matrix whose singular value decomposition is to be computed.
      Throws:
      IllegalArgumentException - is thrown if the row lengths of input matrix a are not equal (i.e. the matrix edges are "jagged") or if input matrix a is null or empty.
      ComplexSVD.DidNotConvergeException - is thrown when the rank cannot be determined because convergence was not obtained for all singular values.
    • ComplexSVD

      public ComplexSVD(ComplexSVD svdProblem)
      Copy constructor for the computation of the singular value decomposition of a complex matrix.
      Parameters:
      svdProblem - the ComplexSVD object to be copied
  • Method Details

    • getRank

      public int getRank()
      Returns the rank of the matrix used to construct this instance.
      Returns:
      an int scalar containing the rank of the matrix used to construct this instance. The estimated rank of the input matrix is the number of singular values which are larger than a tolerance.
    • getU

      public Complex[][] getU()
      Returns the left singular vectors.
      Returns:
      a Complex matrix containing the left singular vectors.
    • getV

      public Complex[][] getV()
      Returns the right singular vectors.
      Returns:
      a Complex matrix containing the right singular vectors.
    • getS

      public double[] getS()
      Returns the singular values.
      Returns:
      a double array containing the singular values of the matrix.
    • getInfo

      public int getInfo()
      Returns convergence information about the singular values.
      Returns:
      an int indicating if the SVD algorithm applied to the bidiagonally reduced input matrix a has converged. If the returned value is zero, the algorithm has converged to a diagonal matrix. If the returned value i is greater than zero, then i elements on the superdiagonal of the bidiagonal matrix have not converged to zero.
    • getInverse

      public Complex[][] getInverse()
      Compute the Moore-Penrose generalized inverse.
      Returns:
      a Complex matrix containing the generalized inverse of the matrix used to construct this instance.