233234235236237238239
double c2 = (mbr2.getMin(d) + mbr2.getMax(d)) / 2; double manhattanI = c1 - c2; sqrDist += manhattanI * manhattanI; } return new DoubleDistance(Math.sqrt(sqrDist)); }
114115116117118119120
distance = cache.getRecordBuffer(id1.getIntegerID(), id2.getIntegerID()).getDouble(); } catch(IOException e) { throw new RuntimeException("Read error when loading distance " + id1 + "," + id2 + " from cache file.", e); } return new DoubleDistance(distance); }
63646566676869
this.dimensions = dimensions; } @Override public DoubleDistance distance(V o1, V o2) { return new DoubleDistance(doubleDistance(o1, o2)); }
107108109110111112113
return Math.abs(manhattan); } @Override public DoubleDistance distance(NumberVector<?, ?> o1, NumberVector<?, ?> o2) { return new DoubleDistance(doubleDistance(o1, o2)); }
112113114115116117118
return new DoubleDistance(doubleDistance(o1, o2)); } @Override public DoubleDistance minDist(SpatialComparable mbr1, SpatialComparable mbr2) { return new DoubleDistance(doubleMinDist(mbr1, mbr2)); }
149150151152153154155
return Math.pow(sqrDist, 1. / p); } @Override public DoubleDistance minDist(SpatialComparable mbr1, SpatialComparable mbr2) { return new DoubleDistance(doubleMinDist(mbr1, mbr2)); }
154155156157158159160
return new DoubleDistance(doubleMinDist(mbr1, mbr2)); } @Override public DoubleDistance norm(NumberVector<?, ?> obj) { return new DoubleDistance(doubleNorm(obj)); }
64656667686970
super(); } @Override public DoubleDistance minDist(SpatialComparable mbr1, SpatialComparable mbr2) { return new DoubleDistance(doubleMinDist(mbr1, mbr2)); }
148149150151152153154
public abstract double transform(double similarity); @Override public DoubleDistance distance(DBID id1, DBID id2) { final NumberDistance<?, ?> sim = similarityQuery.similarity(id1, id2); return new DoubleDistance(transform(sim.doubleValue())); }