pgvector.git / summary / log / commit / refs
commit bace0891bd89e76e7fea701476a4b38468876867
Author: Andrew Kane <andrew@ankane.org>
Date: Tue Aug 22 05:51:24 2023 +0000
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 07b5b08d..728d5dc0 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 d3a55f98..ea340449 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)
[parent: 46009795043a]