protected double[][] computeDistanceMatrix(final List<I> col){
  final int size=col.size();
  double[][] imat=new double[size][size];
  boolean squared=dist instanceof SquaredEuclideanDistanceFunction;
  FiniteProgress dprog=LOG.isVerbose() ? new FiniteProgress("Computing distance matrix",(size * (size - 1)) >>> 1,LOG) : null;
  for (int x=0; x < size; x++) {
    final I ox=col.get(x);
    for (int y=x + 1; y < size; y++) {
      final I oy=col.get(y);
      double distance=dist.distance(ox,oy);
      distance*=(squared ? -.5 : (-.5 * distance));
      imat[x][y]=distance;
      imat[y][x]=distance;
    }
    if (dprog != null) {
      dprog.setProcessed(dprog.getProcessed() + size - x - 1,LOG);
    }
  }
  LOG.ensureCompleted(dprog);
  return imat;
}

protected double [ ] [ ] computeDistanceMatrix ( final List < I > col ) { final int size = col . size ( ) ; double [ ] [ ] imat = new double [ size ] [ size ] ; boolean squared = dist instanceof SquaredEuclideanDistanceFunction ; FiniteProgress dprog = LOG . isVerbose ( ) ? new FiniteProgress ( "Computing distance matrix" , ( size * ( size - 1 ) ) > > > 1 , LOG ) : null ; for ( int x = 0 ; x < size ; x ++ ) { final I ox = col . get ( x ) ; for ( int y = x + 1 ; y < size ; y ++ ) { final I oy = col . get ( y ) ; double distance = dist . distance ( ox , oy ) ; distance *= ( squared ? - .5 : ( - .5 * distance ) ) ; imat [ x ] [ y ] = distance ; imat [ y ] [ x ] = distance ; } if ( dprog != null ) { dprog . setProcessed ( dprog . getProcessed ( ) + size - x - 1 , LOG ) ; } } LOG . ensureCompleted ( dprog ) ; return imat ; }
compute the distance matrix of a vector column .
