Struct faiss::index::flat::FlatIndexImpl

source ·
pub struct FlatIndexImpl { /* private fields */ }
Expand description

Native implementation of a flat index.

Implementations§

Create a new flat index.

Create a new flat index with L2 as the metric type.

Create a new flat index with IP (inner product) as the metric type.

Obtain a reference to the indexed data.

Compute distance with a subset of vectors. x is a sequence of query vectors, size n * d, where n is inferred from the length of x. labels is a sequence of indexed vector ID’s that should be compared for each query vector, size n * k, where k is inferred from the length of labels. Returns the corresponding output distances, size n * k.

Create an independent clone of this index.

Errors

May result in a native error if the clone operation is not supported for the internal type of index.

Build a GPU in from the given CPU native index, yielding two independent indices. The operation fails if the index does not provide GPU support.

Build a GPU in from the given CPU native index, discarding the CPU-backed index. The operation fails if the index does not provide GPU support.

Trait Implementations§

Similar to search, but only provides the labels.
Perform a search for the k closest vectors to the given query vectors.
Perform a ranged search for the vectors closest to the given query vectors by the given radius. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Create an index using the given pointer to a native object. Read more
Retrieve a pointer to the native index object.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.