@CodeReview(reviewer="Jonathan McClain", date="2006-05-16", changesNeeded=false, comments={"Made very minor changes.","Otherwise, looks fine."}) public abstract class AbstractSingularValueDecomposition extends java.lang.Object implements SingularValueDecomposition
| Constructor and Description |
|---|
AbstractSingularValueDecomposition()
Default constructor that nulls out all matrices
|
AbstractSingularValueDecomposition(Matrix U,
Matrix S,
Matrix Vtranspose)
Creates a new instance of AbstractSingularValueDecomposition where
U*S*Vtranspose = original_matrix
|
| Modifier and Type | Method and Description |
|---|---|
double |
conditionNumber()
Returns the condition number of the underlying matrix, which is simply
the ratio of the largest to smallest singular value
|
int |
effectiveRank(double effectiveZero)
Returns the effective rank of the underlying matrix by counting the
number of singular values whose values are larger than effectiveZero
|
Matrix |
getS()
Gets the PSD diagonal matrix containing the sorted singular values
|
Matrix |
getU()
Gets the orthonormal matrix containing the left singular vectors of the
underlying matrix
|
Matrix |
getVtranspose()
Gets the transpose of the orthonormal matrix containing the right
singular vectors of the underlying matrix
|
double |
norm2()
Returns the associated 2-norm (spectral norm) of the underlying matrix,
which is simply the largest singular value
|
Matrix |
pseudoInverse()
Computes the Least Squares pseudoinverse of the underlying matrix
|
Matrix |
pseudoInverse(double effectiveZero)
Computes the Least Squares pseudoinverse of the underlying matrix,
while clipping the singular values at effectiveZero
|
int |
rank()
Returns the rank of the underlying matrix by calling this.effectiveRank
with an effectiveZero = 0.0
|
protected void |
setS(Matrix S)
setter for the singular values matrix
|
protected void |
setU(Matrix U)
setter for left singular vectors
|
protected void |
setVtranspose(Matrix Vtranspose)
sets the transpose of the right singular vectors matrix
|
public AbstractSingularValueDecomposition()
public AbstractSingularValueDecomposition(Matrix U, Matrix S, Matrix Vtranspose)
U - orthonormal matrix of left singular vectorsS - PSD diagonal matrix of singular values, sorted in descending orderVtranspose - transpose of the orthonormal matrix of the right singular vectorspublic Matrix getU()
SingularValueDecompositiongetU in interface SingularValueDecompositionprotected void setU(Matrix U)
U - left singular vectorspublic Matrix getS()
SingularValueDecompositiongetS in interface SingularValueDecompositionprotected void setS(Matrix S)
S - singular values matrixpublic Matrix getVtranspose()
SingularValueDecompositiongetVtranspose in interface SingularValueDecompositionprotected void setVtranspose(Matrix Vtranspose)
Vtranspose - transpose of the right singular vectors matrixpublic double norm2()
SingularValueDecompositionnorm2 in interface SingularValueDecompositionpublic double conditionNumber()
SingularValueDecompositionconditionNumber in interface SingularValueDecompositionpublic int rank()
SingularValueDecompositionrank in interface SingularValueDecompositionpublic int effectiveRank(double effectiveZero)
SingularValueDecompositioneffectiveRank in interface SingularValueDecompositioneffectiveZero - threshold for considering a singular value to be zeropublic Matrix pseudoInverse()
SingularValueDecompositionpseudoInverse in interface SingularValueDecompositionpublic Matrix pseudoInverse(double effectiveZero)
SingularValueDecompositionpseudoInverse in interface SingularValueDecompositioneffectiveZero - value below which to consider the singular values zero