Iterative eigenvalue solvers. Solves

    A x = eig x

for both the eigenvector `x` and the eigenvalue `eig`. However, since JMP works only on double-precision numbers, only real eigenvalues will be revealed. If complex eigenvalues are needed, use {@link jmp.decomp.EigenvalueDecomposition EigenvalueDecomposition}.

### Iterative eigenvalue solvers

The following example illustrates the basic usage:

    double[] eigenvalueSolver(Matrix A, int n) {
      EigenvalueSolver solver = new PowerIteration();

      Vector[] x = new Vector[n];
      double[] eig = new double[n];
      for (int i = 0; i < n; ++i)
        x[i] = new DenseVector(A.numRows());

      try {
        solver.solve(A, eig, x);
      } catch (NotConvergedException e) {
        System.err.println("Eigenvalue solver did not converge");
        System.err.println("Number of iterations = " + e.getIterations());
        System.err.print("Reason = ");
        if (e.getReason() == NotConvergedException.BREAKDOWN)
          System.err.println("breakdown");
        else if (e.getReason() == NotConvergedException.DIVERGENCE)
          System.err.println("divergence");
        else if (e.getReason() == NotConvergedException.ITERATIONS)
          System.err.println("too many iterations");
      }
      return eig;
    }

Note that the arrays holding the eigenvectors and the eigenvalues must be allocated. There are two solvers

- {@link jmp.iter.eig.PowerIteration PowerIteration}
- {@link jmp.iter.eig.Lanczos Lanczos}

Like the linear solvers, an iteration object can be attached. The main difference is that there are multiple states to monitor, that is, many eigenvalue/eigenvector pairs. Consequently, the iteration monitors are slightly different.

### Eigenvalue transformations

JMP uses eigenvalue transformations to generate methods such as the inverse iteration or Rayleigh quotient iteration. Use {@link jmp.iter.eig.EigenvalueSolver#setEigenvalueTransformation(jmp.iter.eig.EigenvalueTransformation) EigenvalueSolver.setEigenvalueTransformation} to set a new transformation. Transformations present include

- {@link jmp.iter.eig.NormalEigenvalueTransformation NormalEigenvalueTransformation} - the default. No spectral transformation performed
- {@link jmp.iter.eig.ShiftEigenvalueTransformation ShiftEigenvalueTransformation} - shifts the spectrum continuously, using the latest eigenvalue estimate
  - {@link jmp.iter.eig.LockedShiftEigenvalueTransformation LockedShiftEigenvalueTransformation} - uses a fixed shift
- {@link jmp.iter.eig.ShiftInvertEigenvalueTransformation ShiftInvertEigenvalueTransformation} - shifts the spectrum continuously, and applies the inverse matrix operator
  - {@link jmp.iter.eig.LockedShiftInvertEigenvalueTransformation LockedShiftInvertEigenvalueTransformation} - uses a fixed shift, and thus the same inverted matrix

As an example, using `LockedShiftInvertEigenvalueTransformation` with `PowerIteration` gives the inverse iteration, while using `ShiftInvertEigenvalueTransformation` gives the Rayleigh quotient iteration. Also, note that `ShiftInvertEigenvalueTransformation` does not work properly with `Lanczos`.