public class SingularOps_FDRM
extends java.lang.Object
Constructor and Description |
---|
SingularOps_FDRM() |
Modifier and Type | Method and Description |
---|---|
static void |
checkSvdMatrixSize(org.ejml.data.FMatrixRMaj U,
boolean tranU,
org.ejml.data.FMatrixRMaj W,
org.ejml.data.FMatrixRMaj V,
boolean tranV)
Checks to see if all the provided matrices are the expected size for an SVD.
|
static void |
descendingOrder(org.ejml.data.FMatrixRMaj U,
boolean tranU,
float[] singularValues,
int singularLength,
org.ejml.data.FMatrixRMaj V,
boolean tranV)
Similar to
descendingOrder(FMatrixRMaj, boolean, FMatrixRMaj, FMatrixRMaj, boolean)
but takes in an array of singular values instead. |
static void |
descendingOrder(org.ejml.data.FMatrixRMaj U,
boolean tranU,
org.ejml.data.FMatrixRMaj W,
org.ejml.data.FMatrixRMaj V,
boolean tranV)
Adjusts the matrices so that the singular values are in descending order.
|
static int |
nullity(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
Extracts the nullity of a matrix using a preexisting decomposition and default threshold.
|
static int |
nullity(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd,
float threshold)
Extracts the nullity of a matrix using a preexisting decomposition.
|
static org.ejml.data.FMatrixRMaj |
nullSpace(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32<org.ejml.data.FMatrixRMaj> svd,
org.ejml.data.FMatrixRMaj nullSpace,
float tol)
Returns the null-space from the singular value decomposition.
|
static org.ejml.data.FMatrixRMaj |
nullspaceQR(org.ejml.data.FMatrixRMaj A,
int totalSingular)
Computes the null space using QR decomposition.
|
static org.ejml.data.FMatrixRMaj |
nullspaceQRP(org.ejml.data.FMatrixRMaj A,
int totalSingular)
Computes the null space using QRP decomposition.
|
static org.ejml.data.FMatrixRMaj |
nullspaceSVD(org.ejml.data.FMatrixRMaj A,
int totalSingular)
Computes the null space using SVD.
|
static org.ejml.data.FMatrixRMaj |
nullVector(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32<org.ejml.data.FMatrixRMaj> svd,
boolean isRight,
org.ejml.data.FMatrixRMaj nullVector)
The vector associated will the smallest singular value is returned as the null space
of the decomposed system.
|
static int |
rank(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
Extracts the rank of a matrix using a preexisting decomposition and default threshold.
|
static int |
rank(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd,
float threshold)
Extracts the rank of a matrix using a preexisting decomposition.
|
static float |
singularThreshold(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
Returns a reasonable threshold for singular values.
tol = max (size (A)) * largest sigma * eps; |
public static void descendingOrder(org.ejml.data.FMatrixRMaj U, boolean tranU, org.ejml.data.FMatrixRMaj W, org.ejml.data.FMatrixRMaj 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(org.ejml.data.FMatrixRMaj U, boolean tranU, float[] singularValues, int singularLength, org.ejml.data.FMatrixRMaj V, boolean tranV)
Similar to descendingOrder(FMatrixRMaj, boolean, FMatrixRMaj, FMatrixRMaj, 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.singularLength
- Number of elements in singularValues arrayV
- Matrix. Modified.tranV
- is V transposed or not.public static void checkSvdMatrixSize(org.ejml.data.FMatrixRMaj U, boolean tranU, org.ejml.data.FMatrixRMaj W, org.ejml.data.FMatrixRMaj V, boolean tranV)
public static org.ejml.data.FMatrixRMaj nullSpace(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32<org.ejml.data.FMatrixRMaj> svd, org.ejml.data.FMatrixRMaj nullSpace, float 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.F_EPS.public static org.ejml.data.FMatrixRMaj nullspaceQR(org.ejml.data.FMatrixRMaj A, int totalSingular)
A
- (Input) MatrixtotalSingular
- Number of singular valuespublic static org.ejml.data.FMatrixRMaj nullspaceQRP(org.ejml.data.FMatrixRMaj A, int totalSingular)
A
- (Input) MatrixtotalSingular
- Number of singular valuespublic static org.ejml.data.FMatrixRMaj nullspaceSVD(org.ejml.data.FMatrixRMaj A, int totalSingular)
A
- (Input) MatrixtotalSingular
- Number of singular valuespublic static org.ejml.data.FMatrixRMaj nullVector(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32<org.ejml.data.FMatrixRMaj> svd, boolean isRight, org.ejml.data.FMatrixRMaj 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 float singularThreshold(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
svd
- A precomputed decomposition. Not modified.public static int rank(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
svd
- A precomputed decomposition. Not modified.singularThreshold(SingularValueDecomposition_F32)
public static int rank(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd, float threshold)
svd
- A precomputed decomposition. Not modified.threshold
- Tolerance used to determine of a singular value is singular.singularThreshold(SingularValueDecomposition_F32)
public static int nullity(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd)
svd
- A precomputed decomposition. Not modified.singularThreshold(SingularValueDecomposition_F32)
public static int nullity(org.ejml.interfaces.decomposition.SingularValueDecomposition_F32 svd, float threshold)
svd
- A precomputed decomposition. Not modified.threshold
- Tolerance used to determine of a singular value is singular.singularThreshold(SingularValueDecomposition_F32)