1

我正在尝试使用 ojAlgo 库中的 getEigenPair(int Index) 函数,但是对于大于 0 的索引值继续获取 ArrayIndexOutOfBoundsException。代码如下所示:

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.

我可以使用这些函数调用成功地获取特征值和特征向量:

Array1D<ComplexNumber> values = E.getEigenvalues();
MatrixStore<ComplexNumber> vectors = E.getEigenvectors();        

但 getEigenPair(...) 仅适用于 0 的索引。我哪里出错了?

我假设 getEigenPair 的索引参数为零,其中 0 获得第一个特征对,1 获得第二个,2 获得第三个,依此类推......

4

0 回答 0