public Matrix.LU lu() {
        return lu(false);
    }
@Test
    public void testLU() {
        System.out.println("LU");
        float[][] A = {
                {0.9000f, 0.4000f, 0.7000f},
                {0.4000f, 0.5000f, 0.3000f},
                {0.7000f, 0.3000f, 0.8000f}
        };

        float[] b = {0.5f, 0.5f, 0.5f};
        float[] x = {-0.2027027f, 0.8783784f, 0.4729730f};

        Matrix a = Matrix.of(A);
        Matrix.LU lu = a.lu();
        float[] x2 = lu.solve(b);
        assertEquals(x.length, x2.length);
        for (int i = 0; i < x.length; i++) {
            assertEquals(x[i], x2[i], 1E-6f);
        }

        float[][] B = {
                {0.5f, 0.2f},
                {0.5f, 0.8f},
                {0.5f, 0.3f}
        };
        float[][] X = {
                {-0.2027027f, -1.2837838f},
                { 0.8783784f,  2.2297297f},
                { 0.4729730f,  0.6621622f}
        };

        Matrix X2 = Matrix.of(B);
        lu.solve(X2);
        assertEquals(X.length, X2.nrow());
        assertEquals(X[0].length, X2.ncol());
        for (int i = 0; i < X.length; i++) {
            for (int j = 0; j < X[i].length; j++) {
                assertEquals(X[i][j], X2.get(i, j), 1E-6f);
            }
        }
    }