public class PowerIteration
extends java.lang.Object
Constructor and Description |
---|
PowerIteration() |
Modifier and Type | Method and Description |
---|---|
static double |
eigen(DMatrix A,
double[] v)
Returns the largest eigen pair of matrix with the power iteration
under the assumptions A has an eigenvalue that is strictly greater
in magnitude than its other eigenvalues and the starting
vector has a nonzero component in the direction of an eigenvector
associated with the dominant eigenvalue.
|
static double |
eigen(DMatrix A,
double[] v,
double p,
double tol,
int maxIter)
Returns the largest eigen pair of matrix with the power iteration
under the assumptions A has an eigenvalue that is strictly greater
in magnitude than its other eigenvalues and the starting
vector has a nonzero component in the direction of an eigenvector
associated with the dominant eigenvalue.
|
public static double eigen(DMatrix A, double[] v)
A
- the matrix supporting matrix vector multiplication operation.v
- on input, it is the non-zero initial guess of the eigen vector.
On output, it is the eigen vector corresponding largest eigen value.public static double eigen(DMatrix A, double[] v, double p, double tol, int maxIter)
A
- the matrix supporting matrix vector multiplication operation.v
- on input, it is the non-zero initial guess of the eigen vector.
On output, it is the eigen vector corresponding largest eigen value.p
- the origin in the shifting power method. A - pI will be
used in the iteration to accelerate the method. p should be such that
|(λ2 - p) / (λ1 - p)| < |λ2 / λ1|,
where λ2 is the second largest eigenvalue in magnitude.
If we known the eigenvalue spectrum of A, (λ2 + λn)/2
is the optimal choice of p, where λn is the smallest eigenvalue
in magnitude. Good estimates of λ2 are more difficult
to compute. However, if μ is an approximation to largest eigenvector,
then using any x0 such that x0*μ = 0 as the initial
vector for a few iterations may yield a reasonable estimate of λ2.tol
- the desired convergence tolerance.maxIter
- the maximum number of iterations in case that the algorithm
does not converge.