@Test public void testCalDistanceMatrixMatrix() { FastDistanceMatrixData matrixData = initMatrixData(); DenseMatrix res = distance.calc(matrixData, matrixData); double[] expect = new double[] {0.0, 12.0, 12.0, 0.0}; double[] predict = res.getData(); for (int i = 0; i < expect.length; i++) { Assert.assertEquals(expect[i], predict[i], 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);  }