@Test public void testCalDistanceVecVec() { DenseMatrix denseResult = distance.calc(distance.prepareVectorData(Tuple2.of(denseVector1, null)), (FastDistanceData)distance.prepareVectorData(Tuple2.of(denseVector2, null))); Assert.assertEquals(denseResult.get(0, 0), 12.0, 0.01); DenseMatrix sparseResult = distance.calc(distance.prepareVectorData(Tuple2.of(sparseVector1, null)), (FastDistanceData)distance.prepareVectorData(Tuple2.of( sparseVector2, null))); Assert.assertEquals(sparseResult.get(0, 0), 0.8, 0.01); }
@Override public double calc(double[] vec1, double[] vec2) { return calc(vec1, 0, vec2, 0, vec1.length); }
ManHattanDistance extends FastDistance { @Override public double calc(double[] vec1, double[] vec2) { return calc(vec1, 0, vec2, 0, vec1.length); } }
ManHattanDistance extends FastDistance { @Override public double calc(double[] vec1, double[] vec2) { return calc(vec1, 0, vec2, 0, vec1.length); }  }
ManHattanDistance extends FastDistance { @Override public double calc(double[] vec1, double[] vec2) { return calc(vec1, 0, vec2, 0, vec1.length); }  @Override double calc(double[] vec1, double[] vec2); @Override double calc(Vector vec1, Vector vec2); @Override void updateLabel(FastDistanceData data); }
ManHattanDistance extends FastDistance { @Override public double calc(double[] vec1, double[] vec2) { return calc(vec1, 0, vec2, 0, vec1.length); }  @Override double calc(double[] vec1, double[] vec2); @Override double calc(Vector vec1, Vector vec2); @Override void updateLabel(FastDistanceData data);  }