/** * Transforms the matrix to tridiagonal form. * * @param matrix Matrix to transform. */ private void transformToTridiagonal(RealMatrix matrix) { // transform the matrix to tridiagonal transformer = new TriDiagonalTransformer(matrix); main = transformer.getMainDiagonalRef(); secondary = transformer.getSecondaryDiagonalRef(); }
/** * Calculates the eigen decomposition of the symmetric tridiagonal * matrix. The Householder matrix is assumed to be the identity matrix. * * @param main Main diagonal of the symmetric tridiagonal form. * @param secondary Secondary of the tridiagonal form. * @throws MaxCountExceededException if the algorithm fails to converge. * @since 3.1 */ public EigenDecomposition(double[] main, double[] secondary) { isSymmetric = true; this.main = main.Clone() as double[]; this.secondary = secondary.Clone() as double[]; transformer = null; int size = main.Length; var z = Java.CreateArray <double[][]>(size, size);// new double[size][size]; for (int i = 0; i < size; i++) { z[i][i] = 1.0; } findEigenVectors(z); }