Class VisualNumerics.math.ComplexSVD
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class VisualNumerics.math.ComplexSVD

java.lang.Object
   |
   +----VisualNumerics.math.ComplexSVD

public class ComplexSVD
extends Object
Singular Value Decomposition (SVD) of a Complex rectangular matrix. We denote this orthogonal factorization by A = U S VH.

Constructor Index

 o ComplexSVD(Complex[][])
Create the ComplexSVD of a rectangular matrix with default tolerance.
 o ComplexSVD(Complex[][], double)
Create the ComplexSVD of a rectangular matrix with a given tolerance.

Method Index

 o info()
Return convergence information about S, U, and V.
 o inverse()
Compute the generalized inverse of a Complex matrix.
 o rank()
Return the rank of the matrix used to construct this instance.
 o S()
Return the singular values of the matrix used to construct this instance in decreasing order of magnitude.
 o U()
Return the left singular vectors resulting from the singular value decomposition of the matrix used to construct this instance.
 o V()
Return the right singular vectors resulting from the singular value decomposition of the matrix used to construct this instance.

Constructors

 o ComplexSVD
  public ComplexSVD(Complex aa[][],
                    double tol) throws IllegalArgumentException
Create the ComplexSVD of a rectangular matrix with a given tolerance. This tolerance is used to determine rank. If the ComplexSVD constructor is called without the tol argument, the tolerance is chosen as 2.2204460492503e-14. 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 tol * the infinity norm 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:
aa - Input Complex matrix for which the singular value decomposition is to be computed.
tol - Input scalar of type double containing the tolerance used to determine when a singular value is negligible.
Throws: IllegalArgumentException
This exception is issued when the row lengths of input matrix a are not equal (i.e. the matrix edges are "jagged".)
Algorithm:
This constructor is based on the LINPACK routine ZSVDC. Let n represent the number of rows of matrix aa and let p represent the number of columns of matrix aa. For any n x p matrix aa there exists an n x n orthogonal matrix U and a p x p orthogonal matrix V such that UHAV = [S0] if n is greater than or equal to p and UHAV = [S 0] if n is less than or equal to p where S = diag(s1,...,sm), and m=min(n,p). The scalars s1, s2, ...sm are called the singular
values of matrix aa. The columns of U are called the left singular vectors of matrix aa. The columns of V are called the right singular vectors of aa.
Example:
 import VisualNumerics.math.*;
 import java.io.*;
 class testCSVD {
    public static void main(String args[]) {
       int      i, j, n=3, rnk, inf;
       Complex s[], v[][], u[][], ainv[][];
       Complex a[][] = new Complex[n][n];
       for(i=0; i < n; i++){
          for(j=0; j < n; j++){
             a[i][j] = new Complex((double)(i+1), (double)(i*j+2));
          }
       }
       try {
         ComplexSVD svd = new ComplexSVD(a);
         u = svd.U();
         v = svd.V();
         s = svd.S();
         inf = svd.info();
         rnk = svd.rank();
         ainv = svd.inverse();
           ... print output ...
       } catch (IllegalArgumentException e) {
         System.err.println("From testCSVD "+e);
       } catch (MathException e) {
         System.err.println("From testCSVD "+e);
       }
    }
 }
	
 o ComplexSVD
  public ComplexSVD(Complex aa[][])
Create the ComplexSVD of a rectangular matrix with default tolerance. The tolerance used is 2.2204460492503e-14. 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:
aa - Complex matrix for which the singular value decomposition is to be computed.
Throws: IllegalArgumentException
This exception is issued when the row lengths of input matrix a are not equal (i.e. the matrix edges are "jagged".)
Algorithm:
This constructor is based on the LINPACK routine ZSVDC. Let n represent the number of rows of matrix aa and let p represent the number of columns of matrix aa. For any n x p matrix aa there exists an n x n orthogonal matrix U and a p x p orthogonal matrix V such that UHAV = [S0] if n is greater than or equal to p and UHAV = [S 0] if n is less than or equal to p where S = diag(s1,...,sm), and m=min(n,p). The scalars s1, s2, ...sm are called the singular values of matrix aa. The columns of U are called the left singular vectors of matrix aa. The columns of V are called the right singular vectors of aa.

Methods

 o rank
  public int rank() throws MathException
Return 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.
Throws: MathException
This exception is issued when the rank cannot be determined because convergence was not obtained for all singular values.
Algorithm:
The ComplexSVD constructor computes the singular value decomposition of the input matrix. The estimated rank of the input matrix is the number of singular values which are larger than a tolerance t. If the tol used by the constructor is greater than zero, then t = tol. If the tol used by the constructor is less than zero, then t = (the infinity norm of input matrix aa) * |tol|.
 o U
  public Complex[][] U()
Return the left singular vectors resulting from the singular value decomposition of the matrix used to construct this instance.
Returns:
A Complex matrix containing the left singular vectors of the matrix used to construct this instance.
 o V
  public Complex[][] V()
Return the right singular vectors resulting from the singular value decomposition of the matrix used to construct this instance.
Returns:
A Complex matrix containing the right singular vectors of the matrix used to construct this instance.
 o S
  public Complex[] S()
Return the singular values of the matrix used to construct this instance in decreasing order of magnitude.
Returns:
A Complex vector containing the singular values of the matrix used to construct this instance in decreasing order of magnitude.
 o info
  public int info()
Return convergence information about S, U, and V.
Returns:
A scalar of type int containing information which indicates which singular values and corresponding singular vectors reached convergence. Convergence was obtained for the info, info+1, ..., min(nra,nca) singular values and their corresponding vectors. Here, nra and nca represent the number of rows and columns of the input matrix respectively.
 o inverse
  public Complex[][] inverse()
Compute the generalized inverse of a Complex matrix.
Returns:
A Complex matrix containing the generalized inverse of the matrix used to construct this instance.
Algorithm:
This method computes the Moore-Penrose generalized inverse. The ComplexSVD constructor is used to compute the singular value decomposition of the input matrix. The resulting U and V matrices can be partitioned as U = (U1,U2) and V = (V1,V2) where both
U
1 and V1 are k x k matrices. Let S1 = diag(s1,...,sm). The Moore-Penrose generalized inverse of input matrix aa = V1S1-1U1H.

All Packages  Class Hierarchy  This Package  Previous  Next  Index