From bace0891bd89e76e7fea701476a4b38468876867 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 21 Aug 2023 22:51:24 -0700 Subject: [PATCH] Updated comments [skip ci] --- src/hnsw.h | 3 +++ src/hnswutils.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hnsw.h b/src/hnsw.h index 07b5b08..728d5dc 100644 --- a/src/hnsw.h +++ b/src/hnsw.h @@ -75,7 +75,10 @@ #define HnswIsElementTuple(tup) ((tup)->type == HNSW_ELEMENT_TUPLE_TYPE) #define HnswIsNeighborTuple(tup) ((tup)->type == HNSW_NEIGHBOR_TUPLE_TYPE) +/* 2 * M connections for ground layer */ #define HnswGetLayerM(m, layer) (layer == 0 ? m * 2 : m) + +/* Optimal ML from paper */ #define HnswGetMl(m) (1 / log(m)) /* Ensure fits in uint8 */ diff --git a/src/hnswutils.c b/src/hnswutils.c index d3a55f9..ea34044 100644 --- a/src/hnswutils.c +++ b/src/hnswutils.c @@ -7,7 +7,7 @@ #include "vector.h" /* - * Get the number of connection in the index + * Get the max number of connections in an upper layer for each element in the index */ int HnswGetM(Relation index)