3737#include " svs/concepts/distance.h"
3838#include " svs/core/distance.h"
3939#include " svs/core/distance/euclidean.h"
40+ #include " svs/index/vamana/extensions.h"
4041
4142#include " catch2/catch_approx.hpp"
4243#include " catch2/matchers/catch_matchers_templated.hpp"
@@ -282,7 +283,7 @@ struct GetDistanceTester {
282283
283284 // Convert distance_type to a distance function
284285 svs::DistanceDispatcher dispatcher (distance_type);
285- dispatcher ([&](auto distance ) {
286+ dispatcher ([&](auto dist ) {
286287 constexpr double TOLERANCE = 1e-5 ;
287288
288289 // Use a query vector for testing
@@ -298,14 +299,12 @@ struct GetDistanceTester {
298299 auto indexed_span = dataset.get_datum (id);
299300
300301 // Compute expected distance
301- auto dist_copy = distance;
302+ auto dist_copy = svs::index::vamana::extensions::single_search_setup (dataset, dist);
303+
302304 svs::distance::maybe_fix_argument (dist_copy, query_span);
303305 double expected_distance =
304306 svs::distance::compute (dist_copy, query_span, indexed_span);
305307
306- fmt::print (" index_distance: {}\n " , index_distance);
307- fmt::print (" expected_distance: {}\n " , expected_distance);
308-
309308 // Test the distance calculation
310309 CATCH_REQUIRE (std::abs (index_distance - expected_distance) < TOLERANCE);
311310 }
0 commit comments