public class EigenPowerMethod_DDRM
extends java.lang.Object
The power method is an iterative method that can be used to find dominant eigen vector in a matrix. Computing Anq for larger and larger values of n, where q is a vector. Eventually the dominant (if there is any) eigen vector will "win".
Shift implementations find the eigen value of the matrix B=A-pI instead. This matrix has the same eigen vectors, but can converge much faster if p is chosen wisely.
See section 5.3 in "Fundamentals of Matrix Computations" Second Edition, David S. Watkins.
WARNING: These functions have well known conditions where they will not converge or converge very slowly and are only used in special situations in practice. I have also seen it converge to none dominant eigen vectors.
Constructor and Description |
---|
EigenPowerMethod_DDRM(int size) |
Modifier and Type | Method and Description |
---|---|
boolean |
computeDirect(org.ejml.data.DMatrixRMaj A)
This method computes the eigen vector with the largest eigen value by using the
direct power method.
|
boolean |
computeShiftDirect(org.ejml.data.DMatrixRMaj A,
double alpha)
Computes the most dominant eigen vector of A using a shifted matrix.
|
boolean |
computeShiftInvert(org.ejml.data.DMatrixRMaj A,
double alpha)
Computes the most dominant eigen vector of A using an inverted shifted matrix.
|
org.ejml.data.DMatrixRMaj |
getEigenVector() |
void |
setOptions(int maxIterations,
double tolerance) |
void |
setSeed(org.ejml.data.DMatrixRMaj seed)
Sets the value of the vector to use in the start of the iterations.
|
public EigenPowerMethod_DDRM(int size)
size
- The size of the matrix which can be processed.public void setSeed(org.ejml.data.DMatrixRMaj seed)
seed
- The initial seed vector in the iteration.public void setOptions(int maxIterations, double tolerance)
maxIterations
- tolerance
- public boolean computeDirect(org.ejml.data.DMatrixRMaj A)
A
- The matrix. Not modified.public boolean computeShiftDirect(org.ejml.data.DMatrixRMaj A, double alpha)
A
- The matrix.alpha
- Shifting factor.public boolean computeShiftInvert(org.ejml.data.DMatrixRMaj A, double alpha)
A
- An invertible square matrix matrix.alpha
- Shifting factor.public org.ejml.data.DMatrixRMaj getEigenVector()