## org.apache.mahout.math
Class SingularValueDecomposition

    java.lang.Object
      org.apache.mahout.math.SingularValueDecomposition

All Implemented Interfaces:
  Serializable

    public class SingularValueDecomposition

extends Object
implements Serializable

See Also:
  Serialized Form

Constructor Summary
`SingularValueDecomposition(Matrix arg)` 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
`double` `cond()` Returns the two norm condition number, which is `max(S) / min(S)`.
`Matrix` `getS()`
`double[]` `getSingularValues()` Returns the diagonal of `S`, which is a one-dimensional array of singular values
`Matrix` `getU()` Returns the left singular vectors `U`.
`Matrix` `getV()` Returns the right singular vectors `V`.
`double` `norm2()` Returns the two norm, which is `max(S)`.
`int` `rank()` Returns the effective numerical matrix rank, which is the number of nonnegligible singular values.
`String` `toString()` Returns a String with (propertyName, propertyValue) pairs.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SingularValueDecomposition

    public SingularValueDecomposition(Matrix arg)

  Constructs and returns a new singular value decomposition object; The decomposed matrices can be retrieved via instance methods of the returned decomposition object.

  Parameters:
    `arg` - A rectangular matrix.

Method Detail

### cond

    public double cond()

  Returns the two norm condition number, which is `max(S) / min(S)`.

### getS

    public Matrix getS()

  Returns:
    the diagonal matrix of singular values.

### getSingularValues

    public double[] getSingularValues()

  Returns the diagonal of `S`, which is a one-dimensional array of singular values

  Returns:
    diagonal of `S`.

### getU

    public Matrix getU()

  Returns the left singular vectors `U`.

  Returns:
    `U`

### getV

    public Matrix getV()

  Returns the right singular vectors `V`.

  Returns:
    `V`

### norm2

    public double 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 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:
    `toString` in class `Object`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.