public class SVD
extends java.lang.Object
Constructor and Description |
---|
SVD(int m,
int n)
Creates an empty SVD which will compute all singular values and vectors
|
SVD(int m,
int n,
boolean vectors)
Creates an empty SVD
|
Modifier and Type | Method and Description |
---|---|
SVD |
factor(DenseMatrix A)
Computes an SVD
|
static SVD |
factorize(Matrix A)
Convenience method for computing a full SVD
|
double[] |
getS()
Returns the singular values (stored in descending order)
|
DenseMatrix |
getU()
Returns the left singular vectors, column-wise.
|
DenseMatrix |
getVt()
Returns the right singular vectors, row-wise.
|
boolean |
hasSingularVectors()
True if singular vectors are stored
|
public SVD(int m, int n)
m
- Number of rowsn
- Number of columnspublic SVD(int m, int n, boolean vectors)
m
- Number of rowsn
- Number of columnsvectors
- True to compute the singular vectors, false for just the
singular valuespublic static SVD factorize(Matrix A) throws NotConvergedException
A
- Matrix to decompose, not modifiedNotConvergedException
public SVD factor(DenseMatrix A) throws NotConvergedException
A
- Matrix to decompose. Size must conform, and it will be
overwritten on return. Pass a copy to avoid thisNotConvergedException
public boolean hasSingularVectors()
public DenseMatrix getU()
public DenseMatrix getVt()
public double[] getS()