TriDiagonalTransformer { public RealMatrix getT() { if (cachedT == null) { final int m = main.length; double[][] ta = new double[m][m]; for (int i = 0; i < m; ++i) { ta[i][i] = main[i]; if (i > 0) { ta[i][i - 1] = secondary[i - 1]; } if (i < main.length - 1) { ta[i][i + 1] = secondary[i]; } } cachedT = MatrixUtils.createRealMatrix(ta); } return cachedT; } TriDiagonalTransformer(RealMatrix matrix); RealMatrix getQ(); RealMatrix getQT(); RealMatrix getT();  }
@Test public void testTTriDiagonal() { checkTriDiagonal(new TriDiagonalTransformer(MatrixUtils.createRealMatrix(testSquare5)).getT()); checkTriDiagonal(new TriDiagonalTransformer(MatrixUtils.createRealMatrix(testSquare3)).getT()); }