### Question:
LinearAlgebraUtils { public static void chol_inplace(double[][] inMatrix) { final int N = inMatrix.length; double sum; for (int i = 0; i < N; ++i) { for (int j = i; j < N; ++j) { sum = inMatrix[i][j]; for (int k = i - 1; k >= 0; --k) { sum -= inMatrix[i][k] * inMatrix[j][k]; } if (i == j) { if (sum <= 0.) { logger.error("choles: internal: inMatrix not pos. def."); } inMatrix[i][i] = Math.sqrt(sum); } else { inMatrix[j][i] = sum / inMatrix[i][i]; } } } }  static double[] solve22(double[][] A, double[] y); static double[] solve33(double[][] A, double[] rhs); static DoubleMatrix absMatrix(DoubleMatrix inMatrix); static double[][] absMatrix(double[][] inMatrix); static DoubleMatrix matrixPower(DoubleMatrix data, double scalar); static double[][] matrixPower(double[][] inMatrix, double scalar); static void invertChol_inplace(double[][] inMatrix); static double[][] invertChol(double[][] inMatrix); static void invertChol_inplace(DoubleMatrix inMatrix); static DoubleMatrix invertChol(DoubleMatrix inMatrix); static ComplexDoubleMatrix dotmult(ComplexDoubleMatrix A, ComplexDoubleMatrix B); static void dotmult_inplace(ComplexDoubleMatrix A, ComplexDoubleMatrix B); static void fliplr_inplace(DoubleMatrix A); static DoubleMatrix matTxmat(DoubleMatrix matrix1, DoubleMatrix matrix2); static ComplexDoubleMatrix matTxmat(ComplexDoubleMatrix matrix1, ComplexDoubleMatrix matrix2); static void wshift_inplace(DoubleMatrix inVector, int n); static DoubleMatrix wshift(DoubleMatrix inMatrix, int n); static void setdata(DoubleMatrix outMatrix, Window outWin, DoubleMatrix inMatrix, Window inWin); static void setdata(ComplexDoubleMatrix outMatrix, Window outWin, ComplexDoubleMatrix inMatrix, Window inWin); static void setdata(ComplexDoubleMatrix outMatrix, ComplexDoubleMatrix inMatrix, Window inWin); static void setdata(DoubleMatrix outMatrix, DoubleMatrix inMatrix, Window inWin); static void chol_inplace(double[][] inMatrix); static void chol_inplace(DoubleMatrix inMatrix); static void invert_inplace(double[][] inMatrix); static double[][] invert(double[][] inMatrix); static void invert_inplace(DoubleMatrix inMatrix); static DoubleMatrix invert(DoubleMatrix inMatrix); static void arrangeCholesky_inplace(DoubleMatrix inMatrix); static void arrangeCholesky_inplace(double[][] inArray);  }### Answer:
@Test public void testCholesky_inplace_Arrays() throws Exception { double[][] A_PASCAL_33_CHOL_ARRAY_ACTUAL = A_PASCAL_33.toArray2(); LinearAlgebraUtils.chol_inplace(A_PASCAL_33_CHOL_ARRAY_ACTUAL); Assert.assertEquals(A_PASCAL_33_CHOL_EXPECTED.toArray2(), A_PASCAL_33_CHOL_ARRAY_ACTUAL); }
@Test public void testCholesky_inplace_JBLAS() throws Exception { DoubleMatrix A_PASCAL_33_CHOL_MATRIX_ACTUAL = A_PASCAL_33.dup(); LinearAlgebraUtils.chol_inplace(A_PASCAL_33_CHOL_MATRIX_ACTUAL); Assert.assertEquals(A_PASCAL_33_CHOL_EXPECTED, A_PASCAL_33_CHOL_MATRIX_ACTUAL); }