XVector
xvecHnswFlatDescriptor Struct Reference

FAISS-free description of an HNSW-Flat index. More...

#include <xvec_hnsw_flat.h>

Public Attributes

xvecDimensionType dimension
 Dimension of each vector (d). More...
 
xvecVectorIdType numVectors
 Total number of graph nodes / vectors. More...
 
xvecDistanceType distanceType
 Distance metric the graph was built under. More...
 
uint32_t M
 Max neighbors per node at levels >= 1. More...
 
uint32_t M0
 Max neighbors per node at level 0 (usually 2*M). More...
 
uint32_t maxLevel
 Highest level in the hierarchy. More...
 
xvecVectorIdType entryPointId
 Graph entry-point node id; must be < numVectors. More...
 
const xvecFloat32 * vectors
 Vectors, row-major by node id [numVectors * dimension]. More...
 
const uint32_t * nodeLevels
 Top level (0-based) of each node [numVectors]. More...
 
const uint64_t * neighborOffsets
 Per-node start offset into neighbors [numVectors + 1]. More...
 
const xvecVectorIdType * neighbors
 Flat neighbor ids; per node level 0 (M0 slots) then each higher level (M slots); empty slots are -1. More...
 

Detailed Description

FAISS-free description of an HNSW-Flat index.

Fully describes the hierarchical graph so an index can be built with no FAISS dependency. The neighbor layout mirrors FAISS's HNSW storage: per node, a contiguous slice of neighbors holds all of that node's levels – level 0 first (M0 slots) then each higher level (M slots) – with empty slots set to -1. neighborOffsets gives each node's start into that flat array, so node i occupies [neighborOffsets[i], neighborOffsets[i + 1]), which must equal M0 + nodeLevels[i] * M.

Definition at line 119 of file xvec_hnsw_flat.h.

Member Data Documentation

◆ dimension

xvecDimensionType xvecHnswFlatDescriptor::dimension

Dimension of each vector (d).

Definition at line 121 of file xvec_hnsw_flat.h.

◆ distanceType

xvecDistanceType xvecHnswFlatDescriptor::distanceType

Distance metric the graph was built under.

Definition at line 123 of file xvec_hnsw_flat.h.

◆ entryPointId

xvecVectorIdType xvecHnswFlatDescriptor::entryPointId

Graph entry-point node id; must be < numVectors.

Definition at line 127 of file xvec_hnsw_flat.h.

◆ M

uint32_t xvecHnswFlatDescriptor::M

Max neighbors per node at levels >= 1.

Definition at line 124 of file xvec_hnsw_flat.h.

◆ M0

uint32_t xvecHnswFlatDescriptor::M0

Max neighbors per node at level 0 (usually 2*M).

Definition at line 125 of file xvec_hnsw_flat.h.

◆ maxLevel

uint32_t xvecHnswFlatDescriptor::maxLevel

Highest level in the hierarchy.

Definition at line 126 of file xvec_hnsw_flat.h.

◆ neighborOffsets

const uint64_t* xvecHnswFlatDescriptor::neighborOffsets

Per-node start offset into neighbors [numVectors + 1].

Definition at line 130 of file xvec_hnsw_flat.h.

◆ neighbors

const xvecVectorIdType* xvecHnswFlatDescriptor::neighbors

Flat neighbor ids; per node level 0 (M0 slots) then each higher level (M slots); empty slots are -1.

Definition at line 131 of file xvec_hnsw_flat.h.

◆ nodeLevels

const uint32_t* xvecHnswFlatDescriptor::nodeLevels

Top level (0-based) of each node [numVectors].

Definition at line 129 of file xvec_hnsw_flat.h.

◆ numVectors

xvecVectorIdType xvecHnswFlatDescriptor::numVectors

Total number of graph nodes / vectors.

Definition at line 122 of file xvec_hnsw_flat.h.

◆ vectors

const xvecFloat32* xvecHnswFlatDescriptor::vectors

Vectors, row-major by node id [numVectors * dimension].

Definition at line 128 of file xvec_hnsw_flat.h.


The documentation for this struct was generated from the following file: