From 8f12b790247d39b4dc83312cf3d72dd7f47f0fa7 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 23 Sep 2024 18:05:52 -0700 Subject: [PATCH] Added normalize [skip ci] --- src/hnswutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hnswutils.c b/src/hnswutils.c index 7311f17..0b465ee 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -1327,6 +1327,7 @@ HnswFindElementNeighbors(char *base, HnswElement element, HnswElement entryPoint PGDLLEXPORT Datum l2_normalize(PG_FUNCTION_ARGS); PGDLLEXPORT Datum halfvec_l2_normalize(PG_FUNCTION_ARGS); +PGDLLEXPORT Datum minivec_l2_normalize(PG_FUNCTION_ARGS); PGDLLEXPORT Datum sparsevec_l2_normalize(PG_FUNCTION_ARGS); static void @@ -1381,8 +1382,7 @@ hnsw_minivec_support(PG_FUNCTION_ARGS) { static const HnswTypeInfo typeInfo = { .maxDimensions = HNSW_MAX_DIM * 4, - /* TODO */ - .normalize = NULL, + .normalize = minivec_l2_normalize, .checkValue = NULL };