edu.mines.jtk.lapack
Class DMatrixSvd

java.lang.Object
  extended by edu.mines.jtk.lapack.DMatrixSvd

public class DMatrixSvd
extends java.lang.Object

Singular value decomposition of a matrix A. For an m-by-n matrix A, let mn = min(m,n). Then the singular value decomposition is A = U*S*V', where U is an m-by-mn orthogonal matrix, S is an mn-by-mn diagonal matrix of singular values, and V' is an mn-by-n orthogonal matrix. The columns of U are the left singular vectors and the rows of V' (V transpose) are the right singular vectors.

The singular values s[k] = S(k,k) are in decreasing order, such that s[0] >= s[1] >= ... >= s[mn-1].

Version:
2005.12.15
Author:
Dave Hale, Colorado School of Mines

Constructor Summary
DMatrixSvd(DMatrix a)
          Constructs a singular value decomposition for the specified matrix A.
 
Method Summary
 double cond()
          Returns the condition number of the matrix A.
 DMatrix getS()
          Gets the diagonal matrix S of singular values.
 double[] getSingularValues()
          Gets the array s of singular values.
 DMatrix getU()
          Gets the matrix U of left singular vectors.
 DMatrix getV()
          Gets the matrix V of right singular vectors.
 DMatrix getVTranspose()
          Gets the matrix V' (V transposed) of right singular vectors.
 double norm2()
          Returns the two-norm of the matrix A.
 int rank()
          Returns the effective numerical rank of the matrix A.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DMatrixSvd

public DMatrixSvd(DMatrix a)
Constructs a singular value decomposition for the specified matrix A.

Parameters:
a - the matrix A.
Method Detail

getU

public DMatrix getU()
Gets the matrix U of left singular vectors.

Returns:
the matrix U.

getS

public DMatrix getS()
Gets the diagonal matrix S of singular values.

Returns:
the matrix S.

getSingularValues

public double[] getSingularValues()
Gets the array s of singular values.

Returns:
the array s.

getV

public DMatrix getV()
Gets the matrix V of right singular vectors. The right singular vectors are in the columns of V.

Returns:
the matrix V.

getVTranspose

public DMatrix getVTranspose()
Gets the matrix V' (V transposed) of right singular vectors. The right singular vectors are in the rows of V'.

Returns:
the matrix V'.

norm2

public double norm2()
Returns the two-norm of the matrix A.

Returns:
the two-norm.

cond

public double cond()
Returns the condition number of the matrix A.

Returns:
the condition number.

rank

public int rank()
Returns the effective numerical rank of the matrix A. The effective numerical rank is the number of significant singular values.

Returns:
the rank.