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);
}
}
}
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 U