XVector
xvec_knn_exact_index.hpp File Reference

C++ RAII wrapper for the XVECTOR exact KNN index. More...

#include <string>
#include "xvector/xvec_types.h"
#include "xvector_cpp/xvec_error.hpp"
Include dependency graph for xvec_knn_exact_index.hpp:

Go to the source code of this file.

Classes

class  xvec::KnnExactIndex
 RAII wrapper for xvecKnnExactIndexTag. More...
 

Namespaces

 xvec
 

Detailed Description

C++ RAII wrapper for the XVECTOR exact KNN index.

// Load from raw vectors (RAII)
auto index = xvec::KnnExactIndex::fromRawVectors(ctx.handle(), vectors, count, dim, XVEC_DISTANCE_L2);
// Use raw handle for C API interop
xvecKnnExactSearch(ctx.handle(), index.handle(), &query, resultBuf, &timing);
// Index is automatically destroyed when out of scope
static KnnExactIndex fromRawVectors(xvecExecutionContextTag *context, const xvecFloat32 *vectors, xvecVectorIdType vectorCount, xvecDimensionType dimension, xvecDistanceType distanceType)
Load a KNN index from raw float32 vectors.
xvecStatus xvecKnnExactSearch(xvecExecutionContextTag *context, xvecKnnExactIndexTag *indexHandle, xvecKnnExactSearchQueryFloat32 *searchQuery, xvecBufferTag *resultsBufferHandle, xvecKnnExactSearchTiming *outTiming)
Performs a brute-force K-nearest neighbors search.
C++ RAII wrapper for the XVECTOR exact KNN index.
@ XVEC_DISTANCE_L2
Squared Euclidean (L2) distance.
Definition: xvec_types.h:174

Definition in file xvec_knn_exact_index.hpp.