I am attempting to use the getEigenPair(int Index) function from the ojAlgo libraries however keep on getting an ArrayIndexOutOfBoundsException for index values greater than 0. The code is shown below:
ComplexDenseStore storeA;
Eigenvalue<ComplexNumber> E;
Eigenpair P1, P2, P3, P4;
storeA = Some_4_by_4_SquareMatrix;
E = Eigenvalue.COMPLEX.make(storeA, true);
E.decompose(storeA);
P1 = E.getEigenPair(0); // This works.
P2 = E.getEigenPair(1); // This throws an exception
P3 = E.getEigenPair(2); // The code doesn't make it to here.
P4 = E.getEigenPair(3); // The code doesn't make it to here either.
I can successfully get the eigenvalues and eigenvectors using these function calls:
Array1D<ComplexNumber> values = E.getEigenvalues();
MatrixStore<ComplexNumber> vectors = E.getEigenvectors();
but getEigenPair(...) only works for an index of 0. Where am I going wrong?
I have assumed that the index parameter to getEigenPair is zero based where 0 gets the first eigen-pair, 1 gets the second, 2 gets the third and so on...