docs: protected static void initializeDistanceMatrix(MatrixParadigm mat, DistanceQuery<?> dq, Linkage linkage) {
      final DBIDArrayIter ix = mat.ix, iy = mat.iy;
      final double[] matrix = mat.matrix;
      final boolean issquare = dq.getDistanceFunction().isSquared();
      FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Distance matrix computation", matrix.length, LOG) : null;
      int pos = 0;
      for(ix.seek(0); ix.valid(); ix.advance()) {
        final int x = ix.getOffset();
        assert (pos == MatrixParadigm.triangleSize(x));
        for(iy.seek(0); iy.getOffset() < x; iy.advance()) {
          matrix[pos++] = linkage.initial(dq.distance(ix, iy), issquare);
        }
        if(prog != null) {
          prog.setProcessed(pos, LOG);
        }
      }
      // Avoid logging errors in case scratch space was too large:
      if(prog != null) {
        prog.setProcessed(matrix.length, LOG);
      }
      LOG.ensureCompleted(prog);
    }