code: private List<Matrix<Double>> generateMatrixSplits(final int nRows, final int nColumns, final int nSplits) {
      final List<Matrix<Double>> splits = new ArrayList<>(nSplits);
  
      int remainingNumSplits = nSplits;
      int remainingNumRows = nRows;
      for (int i = 0; i < nSplits; i++) {
        final int splitNumRows = (remainingNumRows + remainingNumSplits - 1) / remainingNumSplits;
        splits.add(generateRandomMatrix(splitNumRows, nColumns));
  
        remainingNumRows -= splitNumRows;
        remainingNumSplits--;
      }
      return splits;
    }
docs: Generate sub-matrices which splits a matrix as many as {@param nSplits}.
  Note that the matrix is split in row-wise, so the number of columns remain same while
  the number of rows is divided by {@param nSplits}.
  @param nRows Number of rows of the original Matrix.
  @param nColumns Number of columns of the original Matrix.
  @param nSplits Number of partitions to split the matrix into.
  @return List of matrices divided into multiple sub-matrices.