XVector
xvec::KnnExactIndex Class Reference

RAII wrapper for xvecKnnExactIndexTag. More...

#include <xvec_knn_exact_index.hpp>

Public Member Functions

virtual ~KnnExactIndex ()
 
 KnnExactIndex (KnnExactIndex &&other) noexcept
 
KnnExactIndex & operator= (KnnExactIndex &&other) noexcept
 
 KnnExactIndex (const KnnExactIndex &)=delete
 
KnnExactIndex & operator= (const KnnExactIndex &)=delete
 
xvecKnnExactIndexTag * handle () const noexcept
 Get the underlying C API handle. More...
 

Static Public Member Functions

static KnnExactIndex fromRawVectors (xvecExecutionContextTag *context, const xvecFloat32 *vectors, xvecVectorIdType vectorCount, xvecDimensionType dimension, xvecDistanceType distanceType)
 Load a KNN index from raw float32 vectors. More...
 
static KnnExactIndex fromFaissFile (xvecExecutionContextTag *context, const std::string &path)
 Load a KNN index from a Faiss file. More...
 

Detailed Description

RAII wrapper for xvecKnnExactIndexTag.

Manages the lifetime of a KNN index. The index is loaded via named factory methods and destroyed in the destructor. Supports move semantics but not copying.

Note
Destroy this wrapper before its execution context. Index device memory remains allocated until context destruction; see Index resource lifetime.

Definition at line 57 of file xvec_knn_exact_index.hpp.

Constructor & Destructor Documentation

◆ ~KnnExactIndex()

virtual xvec::KnnExactIndex::~KnnExactIndex ( )
virtual

◆ KnnExactIndex() [1/2]

xvec::KnnExactIndex::KnnExactIndex ( KnnExactIndex &&  other)
noexcept

◆ KnnExactIndex() [2/2]

xvec::KnnExactIndex::KnnExactIndex ( const KnnExactIndex &  )
delete

Member Function Documentation

◆ fromFaissFile()

static KnnExactIndex xvec::KnnExactIndex::fromFaissFile ( xvecExecutionContextTag *  context,
const std::string &  path 
)
static

Load a KNN index from a Faiss file.

Parameters
contextExecution context handle (not owned).
pathPath to the Faiss index file (.faiss).
Exceptions
xvec::Errorif loading fails.

◆ fromRawVectors()

static KnnExactIndex xvec::KnnExactIndex::fromRawVectors ( xvecExecutionContextTag *  context,
const xvecFloat32 *  vectors,
xvecVectorIdType  vectorCount,
xvecDimensionType  dimension,
xvecDistanceType  distanceType 
)
static

Load a KNN index from raw float32 vectors.

Parameters
contextExecution context handle (not owned).
vectorsPointer to row-major float32 vectors.
vectorCountNumber of vectors.
dimensionDimension of each vector.
distanceTypeDistance metric.
Exceptions
xvec::Errorif loading fails.

◆ handle()

xvecKnnExactIndexTag* xvec::KnnExactIndex::handle ( ) const
noexcept

Get the underlying C API handle.

◆ operator=() [1/2]

KnnExactIndex& xvec::KnnExactIndex::operator= ( const KnnExactIndex &  )
delete

◆ operator=() [2/2]

KnnExactIndex& xvec::KnnExactIndex::operator= ( KnnExactIndex &&  other)
noexcept

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