public class EigenOps_FDRM
extends java.lang.Object
| Constructor and Description |
|---|
EigenOps_FDRM() |
| Modifier and Type | Method and Description |
|---|---|
static float[] |
boundLargestEigenValue(org.ejml.data.FMatrixRMaj A,
float[] bound)
Generates a bound for the largest eigen value of the provided matrix using Perron-Frobenius
theorem.
|
static float |
computeEigenValue(org.ejml.data.FMatrixRMaj A,
org.ejml.data.FMatrixRMaj eigenVector)
Given matrix A and an eigen vector of A, compute the corresponding eigen value.
|
static org.ejml.data.FEigenpair |
computeEigenVector(org.ejml.data.FMatrixRMaj A,
float eigenvalue)
Given an eigenvalue it computes an eigenvector using inverse iteration:
for i=1:MAX { (A - μI)z(i) = q(i-1) q(i) = z(i) / ||z(i)|| λ(i) = q(i)T A q(i) } |
static org.ejml.data.FMatrixRMaj |
createMatrixD(org.ejml.interfaces.decomposition.EigenDecomposition_F32 eig)
A diagonal matrix where real diagonal element contains a real eigenvalue.
|
static org.ejml.data.FMatrixRMaj |
createMatrixV(org.ejml.interfaces.decomposition.EigenDecomposition_F32<org.ejml.data.FMatrixRMaj> eig)
Puts all the real eigenvectors into the columns of a matrix.
|
static org.ejml.data.FEigenpair |
dominantEigenpair(org.ejml.data.FMatrixRMaj A)
Computes the dominant eigen vector for a matrix.
|
public static float computeEigenValue(org.ejml.data.FMatrixRMaj A,
org.ejml.data.FMatrixRMaj eigenVector)
Given matrix A and an eigen vector of A, compute the corresponding eigen value. This is
the Rayleigh quotient.
xTAx / xTx
A - Matrix. Not modified.eigenVector - An eigen vector of A. Not modified.public static org.ejml.data.FEigenpair computeEigenVector(org.ejml.data.FMatrixRMaj A,
float eigenvalue)
Given an eigenvalue it computes an eigenvector using inverse iteration:
for i=1:MAX {
(A - μI)z(i) = q(i-1)
q(i) = z(i) / ||z(i)||
λ(i) = q(i)T A q(i)
}
NOTE: If there is another eigenvalue that is very similar to the provided one then there is a chance of it converging towards that one instead. The larger a matrix is the more likely this is to happen.
A - Matrix whose eigenvector is being computed. Not modified.eigenvalue - The eigenvalue in the eigen pair.public static org.ejml.data.FEigenpair dominantEigenpair(org.ejml.data.FMatrixRMaj A)
Computes the dominant eigen vector for a matrix. The dominant eigen vector is an eigen vector associated with the largest eigen value.
WARNING: This function uses the power method. There are known cases where it will not converge. It also seems to converge to non-dominant eigen vectors some times. Use at your own risk.
A - A matrix. Not modified.public static float[] boundLargestEigenValue(org.ejml.data.FMatrixRMaj A,
float[] bound)
Generates a bound for the largest eigen value of the provided matrix using Perron-Frobenius theorem. This function only applies to non-negative real matrices.
For "stochastic" matrices (Markov process) this should return one for the upper and lower bound.
A - Square matrix with positive elements. Not modified.bound - Where the results are stored. If null then a matrix will be declared. Modified.public static org.ejml.data.FMatrixRMaj createMatrixD(org.ejml.interfaces.decomposition.EigenDecomposition_F32 eig)
A diagonal matrix where real diagonal element contains a real eigenvalue. If an eigenvalue is imaginary then zero is stored in its place.
eig - An eigenvalue decomposition which has already decomposed a matrix.public static org.ejml.data.FMatrixRMaj createMatrixV(org.ejml.interfaces.decomposition.EigenDecomposition_F32<org.ejml.data.FMatrixRMaj> eig)
Puts all the real eigenvectors into the columns of a matrix. If an eigenvalue is imaginary then the corresponding eigenvector will have zeros in its column.
eig - An eigenvalue decomposition which has already decomposed a matrix.