public static class Matrix.SVD
extends java.lang.Object
implements java.io.Serializable
For an mbyn matrix A with m ≥ n, the singular value decomposition is an mbyn orthogonal matrix U, an nbyn diagonal matrix Σ, and an nbyn orthogonal matrix V so that A = U*Σ*V'.
For m < n, only the first m columns of V are computed and Σ is mbym.
The singular values, σ_{k} = Σ_{kk}, are ordered so that σ_{0} ≥ σ_{1} ≥ ... ≥ σ_{n1}.
The singular value decomposition always exists. The matrix condition number and the effective numerical rank can be computed from this decomposition.
SVD is a very powerful technique for dealing with sets of equations or matrices that are either singular or else numerically very close to singular. In many cases where Gaussian elimination and LU decomposition fail to give satisfactory results, SVD will diagnose precisely what the problem is. SVD is also the method of choice for solving most linear least squares problems.
Applications which employ the SVD include computing the pseudoinverse, least squares fitting of data, matrix approximation, and determining the rank, range and null space of a matrix. The SVD is also applied extensively to the study of linear inverse problems, and is useful in the analysis of regularization methods such as that of Tikhonov. It is widely used in statistics where it is related to principal component analysis. Yet another usage is latent semantic indexing in natural language text processing.
Modifier and Type  Field and Description 

int 
m
The number of rows of matrix.

int 
n
The number of columns of matrix.

double[] 
s
The singular values in descending order.

Matrix 
U
The left singular vectors U.

Matrix 
V
The right singular vectors V.

Constructor and Description 

SVD(double[] s,
Matrix U,
Matrix V)
Constructor.

SVD(int m,
int n,
double[] s)
Constructor.

Modifier and Type  Method and Description 

double 
condition()
Returns the L_{2} norm condition number, which is max(S) / min(S).

Matrix 
diag()
Returns the diagonal matrix of singular values.

double 
norm()
Returns the L2 matrix norm.

int 
nullity()
Returns the dimension of null space.

Matrix 
nullspace()
Returns the matrix which columns are the orthonormal basis for the null space.

Matrix 
pinv()
Returns the pseudo inverse.

Matrix 
range()
Returns the matrix which columns are the orthonormal basis for the range space.

int 
rank()
Returns the effective numerical matrix rank.

double[] 
solve(double[] b)
Solves the least squares min  B  A*X .

public final int m
public final int n
public final double[] s
public final Matrix U
public final Matrix V
public Matrix diag()
public double norm()
public int rank()
public int nullity()
public double condition()
public Matrix range()
public Matrix nullspace()
public Matrix pinv()
public double[] solve(double[] b)
b
 the right hand side of overdetermined linear system.java.lang.RuntimeException
 if matrix is rank deficient.