public class SingularOps extends Object
| Constructor and Description |
|---|
SingularOps() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkSvdMatrixSize(DenseMatrix64F U,
boolean tranU,
DenseMatrix64F W,
DenseMatrix64F V,
boolean tranV)
Checks to see if all the provided matrices are the expected size for an SVD.
|
static void |
descendingOrder(DenseMatrix64F U,
boolean tranU,
DenseMatrix64F W,
DenseMatrix64F V,
boolean tranV)
Adjusts the matrices so that the singular values are in descending order.
|
static void |
descendingOrder(DenseMatrix64F U,
boolean tranU,
double[] singularValues,
int numSingularValues,
DenseMatrix64F V,
boolean tranV)
Similar to
descendingOrder(org.ejml.data.DenseMatrix64F, boolean, org.ejml.data.DenseMatrix64F, org.ejml.data.DenseMatrix64F, boolean)
but takes in an array of singular values instead. |
static int |
nullity(SingularValueDecomposition svd,
double threshold)
Extracts the nullity of a matrix using a preexisting decomposition.
|
static DenseMatrix64F |
nullSpace(SingularValueDecomposition<DenseMatrix64F> svd,
DenseMatrix64F nullSpace,
double tol)
Returns the null-space from the singular value decomposition.
|
static DenseMatrix64F |
nullVector(SingularValueDecomposition<DenseMatrix64F> svd,
boolean isRight,
DenseMatrix64F nullVector)
The vector associated will the smallest singular value is returned as the null space
of the decomposed system.
|
static int |
rank(SingularValueDecomposition svd,
double threshold)
Extracts the rank of a matrix using a preexisting decomposition.
|
public static void descendingOrder(DenseMatrix64F U, boolean tranU, DenseMatrix64F W, DenseMatrix64F V, boolean tranV)
Adjusts the matrices so that the singular values are in descending order.
In most implementations of SVD the singular values are automatically arranged in in descending order. In EJML this is not the case since it is often not needed and some computations can be saved by not doing that.
U - Matrix. Modified.tranU - is U transposed or not.W - Diagonal matrix with singular values. Modified.V - Matrix. Modified.tranV - is V transposed or not.public static void descendingOrder(DenseMatrix64F U, boolean tranU, double[] singularValues, int numSingularValues, DenseMatrix64F V, boolean tranV)
Similar to descendingOrder(org.ejml.data.DenseMatrix64F, boolean, org.ejml.data.DenseMatrix64F, org.ejml.data.DenseMatrix64F, boolean)
but takes in an array of singular values instead.
U - Matrix. Modified.tranU - is U transposed or not.singularValues - Array of singular values. Modified.numSingularValues - Number of elements in singularValues arrayV - Matrix. Modified.tranV - is V transposed or not.public static void checkSvdMatrixSize(DenseMatrix64F U, boolean tranU, DenseMatrix64F W, DenseMatrix64F V, boolean tranV)
public static DenseMatrix64F nullSpace(SingularValueDecomposition<DenseMatrix64F> svd, DenseMatrix64F nullSpace, double tol)
Returns the null-space from the singular value decomposition. The null space is a set of non-zero vectors that when multiplied by the original matrix return zero.
The null space is found by extracting the columns in V that are associated singular values less than or equal to the threshold. In some situations a non-compact SVD is required.
svd - A precomputed decomposition. Not modified.nullSpace - Storage for null space. Will be reshaped as needed. Modified.tol - Threshold for selecting singular values. Try UtilEjml.EPS.public static DenseMatrix64F nullVector(SingularValueDecomposition<DenseMatrix64F> svd, boolean isRight, DenseMatrix64F nullVector)
The vector associated will the smallest singular value is returned as the null space of the decomposed system. A right null space is returned if 'isRight' is set to true, and a left null space if false.
svd - A precomputed decomposition. Not modified.isRight - true for right null space and false for left null space. Right is more commonly used.nullVector - Optional storage for a vector for the null space. Modified.public static int rank(SingularValueDecomposition svd, double threshold)
svd - A precomputed decomposition. Not modified.threshold - Tolerance used to determine of a singular value is singular.public static int nullity(SingularValueDecomposition svd, double threshold)
svd - A precomputed decomposition. Not modified.threshold - Tolerance used to determine of a singular value is singular.Copyright © 2013. All Rights Reserved.