public static Matrix createSubMatrix(Matrix matrix, int excluding_row, int excluding_column) {
        int rows = matrix.getRowDimension();
        int columns = matrix.getColumnDimension();
        Matrix subMatrix = new Matrix(rows - 1, columns - 1);
        int r = -1;
        for (int i = 0; i < rows; ++i) {
            if (i == excluding_row)
                continue;
            ++r;
            int c = -1;
            for (int j = 0; j < columns; ++j) {
                if (j == excluding_column)
                    continue;
                subMatrix.set(r, ++c, matrix.get(i, j));
            }
        }
        return subMatrix;
    }