diff --git a/src/site/xdoc/userguide/linear.xml b/src/site/xdoc/userguide/linear.xml index c44e1b245..3bbe8055c 100644 --- a/src/site/xdoc/userguide/linear.xml +++ b/src/site/xdoc/userguide/linear.xml @@ -68,7 +68,7 @@ System.out.println(p.getRowDimension()); // 2 System.out.println(p.getRowDimension()); // 2 // Invert p -RealMatrix pInverse = p.inverse(); +RealMatrix pInverse = new LUDecompositionImpl(p).inverse();

@@ -109,10 +109,11 @@ double[][] coefficientsData = {{2, 3, -2}, {-1, 7, 6}, {4, -3, -5}}; RealMatrix coefficients = new RealMatrixImpl(coefficientsData); Next create a double[] array to represent the constant - vector and use solve(double[]) to solve the system + vector and use solve(double[]) from the default implementation + of LUDecomposition to solve the system double[] constants = {1, -2, 1}; -double[] solution = coefficients.solve(constants); +double[] solution = new LUDecompositionImpl(coefficients).solve(constants); The solution array will contain values for x (solution[0]), y (solution[1]),