@Test
public void testCalDistanceVecMatrix() {

    FastDistanceMatrixData matrixData = initMatrixData();
    FastDistanceVectorData vectorData = distance.prepareVectorData(Row.of(0, denseVector1), 1);
    double[] predict = distance.calc(matrixData, vectorData).getData();
    double[] expect = new double[] {0.0, 5160.251};
    for (int i = 0; i < expect.length; i++) {
        Assert.assertEquals(expect[i], predict[i], 0.01);
    }
    predict = distance.calc(vectorData, matrixData).getData();
    for (int i = 0; i < expect.length; i++) {
        Assert.assertEquals(expect[i], predict[i], 0.01);
    }
}