docs: public int splitRandomly(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
      final int nele = end - begin;
      DBIDArrayIter it = ind.iter();
      // pick random splitting element based on position
      double rs = tpro.doubleValue(it.seek(begin + rand.nextInt(nele)));
      int minInd = begin, maxInd = end - 1;
      // permute elements such that all points smaller than the splitting
      // element are on the right and the others on the left in the array
      while(minInd < maxInd) {
        double currEle = tpro.doubleValue(it.seek(minInd));
        if(currEle > rs) {
          while(minInd < maxInd && tpro.doubleValue(it.seek(maxInd)) > rs) {
            maxInd--;
          }
          if(minInd == maxInd) {
            break;
          }
          ind.swap(minInd, maxInd);
          maxInd--;
        }
        minInd++;
      }
      // if all elements are the same split in the middle
      if(minInd == end - 1) {
        minInd = (begin + end) >>> 1;
      }
      return minInd;
    }