static Matrix> matrixToMNGrid(Matrix m, int cols, int rows) { if (m == null) null; LL rects = gridOfRects3(m.getWidth(), m.getHeight(), cols, rows); LL> matrices = mapLevelTwo(r -> new SubMatrix(m, r), rects); ret listOfListsToMatrix(matrices); }