code: protected DoubleDBIDList computeDistanceVector(NumberVector refPoint, Relation<? extends NumberVector> database, PrimitiveDistanceQuery<? super NumberVector> distFunc) {
      ModifiableDoubleDBIDList referenceDists = DBIDUtil.newDistanceDBIDList(database.size());
      for(DBIDIter iditer = database.iterDBIDs(); iditer.valid(); iditer.advance()) {
        referenceDists.add(distFunc.distance(iditer, refPoint), iditer);
      }
      referenceDists.sort();
      return referenceDists;
    }
docs: Computes for each object the distance to one reference point. (one
  dimensional representation of the data set)
  
  @param refPoint Reference Point Feature Vector
  @param database database to work on
  @param distFunc Distance function to use
  @return array containing the distance to one reference point for each
  database object and the object id