cern.colt.matrix.tfloat.algo.decomposition
Class DenseFloatSingularValueDecomposition
- java.lang.Object
-
- cern.colt.matrix.tfloat.algo.decomposition.DenseFloatSingularValueDecomposition
-
public class DenseFloatSingularValueDecomposition extends java.lang.ObjectFor an m x n matrix A, the singular value decomposition is an m x m orthogonal matrix U, an m x n diagonal matrix S, and an n x n orthogonal matrix V so that A = U*S*V'.The singular values, sigma[k] = S[k][k], are ordered so that sigma[0] >= sigma[1] >= ... >= sigma[min(m-1,n-1)].
This implementation uses the divide-and-conquer algorithm (dgesdd) from LAPACK.
-
-
Constructor Summary
Constructors Constructor and Description DenseFloatSingularValueDecomposition(FloatMatrix2D A, boolean wantUV, boolean wantWholeUV)Constructs and returns a new singular value decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description floatcond()Returns the two norm condition number, which is max(S) / min(S).org.netlib.util.intWgetInfo()Returns the output flagFloatMatrix2DgetS()Returns the diagonal matrix of singular values.float[]getSingularValues()Returns the diagonal of S, which is a one-dimensional array of singular valuesFloatMatrix2DgetU()Returns the left singular vectors U.FloatMatrix2DgetV()Returns the right singular vectors V.floatnorm2()Returns the two norm, which is max(S).intrank()Returns the effective numerical matrix rank, which is the number of nonnegligible singular values.java.lang.StringtoString()Returns a String with (propertyName, propertyValue) pairs.
-
-
-
Constructor Detail
-
DenseFloatSingularValueDecomposition
public DenseFloatSingularValueDecomposition(FloatMatrix2D A, boolean wantUV, boolean wantWholeUV)
Constructs and returns a new singular value decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.- Parameters:
A- rectangular matrixwantUV- if true then all matrices (U, S, V') are computed; otherwise only S is computedwantWholeUV- if true then all m columns of U and all n rows of V' are computed; otherwise only the first min(m,n) columns of U and the first min(m,n) rows of V' are computed
-
-
Method Detail
-
cond
public float cond()
Returns the two norm condition number, which is max(S) / min(S).
-
getS
public FloatMatrix2D getS()
Returns the diagonal matrix of singular values.- Returns:
- S
-
getSingularValues
public float[] getSingularValues()
Returns the diagonal of S, which is a one-dimensional array of singular values- Returns:
- diagonal of S.
-
getU
public FloatMatrix2D getU()
Returns the left singular vectors U.- Returns:
- U
-
getV
public FloatMatrix2D getV()
Returns the right singular vectors V.- Returns:
- V
-
getInfo
public org.netlib.util.intW getInfo()
Returns the output flag- Returns:
- 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: process did not converge.
-
norm2
public float norm2()
Returns the two norm, which is max(S).
-
rank
public int rank()
Returns the effective numerical matrix rank, which is the number of nonnegligible singular values.
-
toString
public java.lang.String toString()
Returns a String with (propertyName, propertyValue) pairs. Useful for debugging or to quickly get the rough picture. For example,rank : 3 trace : 0- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG