compare new GeoGcd with implementation as tensor distance
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/eval/eval/typed_cells.h>
+#include <vespa/searchlib/common/geo_gcd.h>
#include <vespa/searchlib/tensor/distance_functions.h>
#include <vespa/searchlib/tensor/distance_function_factory.h>
#include <vespa/vespalib/gtest/gtest.h>
@@ -33,6 +34,10 @@ void verify_geo_miles(const DistanceFunction *dist_fun,
EXPECT_LE(d_miles, exp_miles*1.01);
double threshold = dist_fun->convert_threshold(km);
EXPECT_DOUBLE_EQ(threshold, abstract_distance);
+ // compare with common Great Circle Distance implementation:
+ search::common::GeoGcd gp1{p1[0], p1[1]};
+ double km_gcd = gp1.km_great_circle_distance(p2[0], p2[1]);
+ EXPECT_DOUBLE_EQ(km, km_gcd);
} else {
EXPECT_LE(d_miles, 7e-13);
EXPECT_LE(abstract_distance, 6e-33);
