Expand description
§faiss-next-sys
faiss-next-sys
wrap c_api
of faiss
into rust
with bindgen
.
Currently supported faiss
version is v1.7.4
§Build faiss
from source
faiss-next-sys
requires faiss
compiled with FAISS_ENABLE_C_API=ON
and BUILD_SHARED_LIBS=ON
.
Some facebookresearch/faiss distributions, like of brew
on mac, does not provide faiss_c
library.
So, building faiss
from source is necessary time to time.
facebookresearch/faiss provides installation document officially to guide how to build faiss
from source.
But, on windows
, building faiss
will fail, because of msvc
c++ compiler’s implemention of C++17
syntax: issue.
So, a hecked v1.7.4
version is made: link to solve the issue.
If windows
is not the target platform, just clone faiss
and check v1.7.4
branch out, will just work fine.
- link: hecked version
- link offical version
Pick one of above, download, unzip, then start building:
§MacOS
xcode
and brew
needed, install in advance.
# install cmake openblas and llvm
brew install cmake openblas llvm
# configure
cmake -B build -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF
# compile
cmake --build build --config Release
# install
cmake --install build --prefix=$HOME/faiss
cp build/c_api/libfaiss_c.dylib $HOME/faiss/lib/
§Linux
gcc
, cmake
, intelmkl
, cuda
needed, install in advance.
# configure
cmake -B build -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=ON -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF
# compile
cmake --build build --config Release
# install
cmake --install build --prefix=$HOME/faiss
cp build/c_api/libfaiss_c.so $HOME/faiss/lib/
§Windows
Visual Studio 2022
, cmake
, intelmkl
, cuda
needed, install in advance.
# configure
cmake -B build -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=ON -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF
# compile
cmake --build build --config Release
# install
cmake --install build --prefix=%USERPROFILE%\faiss
copy build\c_api\Release\faiss_c.dll %USERPROFILE%\faiss\bin
copy build\c_api\Release\faiss_c.lib %USERPROFILE%\faiss\lib\
§Bindings
Bindings was generated by running the follow commands under faiss-next-sys
folder
cargo build --features bindgen
or, generate bindings with gpu
enabled
cargo build --features bindgen,gpu
Generated bindings looks like:
└── src
├── lib.rs
├── linux
│ ├── bindings.rs #linux cpu bindings
│ └── bindings_gpu.rs #linux gpu bindings
├── macos
│ └── bindings.rs #macos cpu bindings, gpu is not supported
└── windows
├── bindings.rs #windows cpu bindings
└── bindings_gpu.rs #windows gpu bindings
Structs§
- Faiss
Buffer - List of temporary buffers used to store results before they are copied to the RangeSearchResult object.
- Faiss
Buffer List_ H - Faiss
Clustering Iteration Stats_ H - Faiss
Clustering Parameters - Class for the clustering parameters. Can be passed to the constructor of the Clustering object.
- Faiss
Clustering_ H - Faiss
Distance Computer_ H - FaissID
Selector And_ H - FaissID
Selector Batch_ H - FaissID
Selector Not_ H - FaissID
Selector Or_ H - FaissID
Selector Range_ H - FaissID
SelectorX Or_ H - FaissID
Selector_ H - Faiss
Index Binary_ H - Faiss
IndexIVF Stats - Faiss
Index_ H - Faiss
Parameter Range_ H - Faiss
Parameter Space_ H - Faiss
Range Query Result_ H - Faiss
Range Search Partial Result_ H - Faiss
Range Search Result_ H - Faiss
Search Parameters_ H - Faiss
Vector Transform_ H
Enums§
- Faiss
Error Code - An error code which depends on the exception thrown from the previous
operation. See
faiss_get_last_error
to retrieve the error message. - Faiss
Metric Type - Some algorithms support both an inner product version and a L2 search version.
- Faiss
Quantizer Type
Functions§
- faiss_
Buffer ⚠List_ add - faiss_
Buffer ⚠List_ append_ buffer - faiss_
Buffer ⚠List_ buffer_ size - faiss_
Buffer ⚠List_ copy_ range - copy elemnts ofs:ofs+n-1 seen as linear data in the buffers to tables dest_ids, dest_dis
- faiss_
Buffer ⚠List_ free - faiss_
Buffer ⚠List_ new - faiss_
Buffer ⚠List_ wp - faiss_
Centering ⚠Transform_ free - faiss_
Centering ⚠Transform_ new_ with - faiss_
Clustering ⚠Iteration Stats_ imbalance_ factor - faiss_
Clustering ⚠Iteration Stats_ nsplit - faiss_
Clustering ⚠Iteration Stats_ obj - faiss_
Clustering ⚠Iteration Stats_ time - faiss_
Clustering ⚠Iteration Stats_ time_ search - faiss_
Clustering ⚠Parameters_ init - Sets the ClusteringParameters object with reasonable defaults
- faiss_
Clustering_ ⚠centroids - getter for centroids (size = k * d)
- faiss_
Clustering_ ⚠d - faiss_
Clustering_ ⚠decode_ block_ size - faiss_
Clustering_ ⚠free - faiss_
Clustering_ ⚠frozen_ centroids - faiss_
Clustering_ ⚠int_ centroids - faiss_
Clustering_ ⚠iteration_ stats - getter for iteration stats
- faiss_
Clustering_ ⚠k - faiss_
Clustering_ ⚠max_ points_ per_ centroid - faiss_
Clustering_ ⚠min_ points_ per_ centroid - faiss_
Clustering_ ⚠new - the only mandatory parameters are k and d
- faiss_
Clustering_ ⚠new_ with_ params - faiss_
Clustering_ ⚠niter - faiss_
Clustering_ ⚠nredo - faiss_
Clustering_ ⚠seed - faiss_
Clustering_ ⚠spherical - faiss_
Clustering_ ⚠train - faiss_
Clustering_ ⚠update_ index - faiss_
Clustering_ ⚠verbose - faiss_
Distance ⚠Computer_ free - faiss_
Distance ⚠Computer_ set_ query - called before computing distances
- faiss_
Distance ⚠Computer_ symmetric_ dis - compute distance between two stored vectors
- faiss_
Distance ⚠Computer_ vector_ to_ query_ dis - Compute distance of vector i to current query. This function corresponds to the function call operator: DistanceComputer::operator()
- faiss_
IDSelector ⚠And_ new - faiss_
IDSelector ⚠Batch_ mask - faiss_
IDSelector ⚠Batch_ nbits - faiss_
IDSelector ⚠Batch_ new - Remove ids from a set. Repetitions of ids in the indices set passed to the constructor does not hurt performance. The hash function used for the bloom filter and GCC’s implementation of unordered_set are just the least significant bits of the id. This works fine for random ids or ids in sequences but will produce many hash collisions if lsb’s are always the same
- faiss_
IDSelector ⚠Not_ new - faiss_
IDSelector ⚠Or_ new - faiss_
IDSelector ⚠Range_ free - faiss_
IDSelector ⚠Range_ imax - faiss_
IDSelector ⚠Range_ imin - faiss_
IDSelector ⚠Range_ new - remove ids between [imni, imax)
- faiss_
IDSelectorX ⚠Or_ new - faiss_
IDSelector_ ⚠free - faiss_
IDSelector_ ⚠is_ member - Encapsulates a set of ids to remove.
- faiss_
ITQMatrix_ ⚠free - faiss_
ITQMatrix_ ⚠new_ with - Getter for random_rotation
- faiss_
ITQTransform_ ⚠do_ pca - faiss_
ITQTransform_ ⚠free - faiss_
ITQTransform_ ⚠new_ with - faiss_
Index ⚠Binary_ add - Add n vectors of dimension d to the index.
- faiss_
Index ⚠Binary_ add_ with_ ids - Same as add, but stores xids instead of sequential ids.
- faiss_
Index ⚠Binary_ assign - return the indexes of the k vectors closest to the query x.
- faiss_
Index ⚠Binary_ d - faiss_
Index ⚠Binary_ free - faiss_
Index ⚠Binary_ is_ trained - faiss_
Index ⚠Binary_ metric_ type - faiss_
Index ⚠Binary_ ntotal - faiss_
Index ⚠Binary_ range_ search - query n vectors of dimension d to the index.
- faiss_
Index ⚠Binary_ reconstruct - Reconstruct a stored vector (or an approximation if lossy coding)
- faiss_
Index ⚠Binary_ reconstruct_ n - Reconstruct vectors i0 to i0 + ni - 1
- faiss_
Index ⚠Binary_ remove_ ids - removes IDs from the index. Not supported by all indexes @param index opaque pointer to index object @param nremove output for the number of IDs removed
- faiss_
Index ⚠Binary_ reset - removes all elements from the database. @param index opaque pointer to index object
- faiss_
Index ⚠Binary_ search - query n vectors of dimension d to the index.
- faiss_
Index ⚠Binary_ set_ verbose - faiss_
Index ⚠Binary_ train - Perform training on a representative set of vectors
- faiss_
Index ⚠Binary_ verbose - faiss_
Index ⚠Flat1D_ cast - faiss_
Index ⚠Flat1D_ free - faiss_
Index ⚠Flat1D_ new - Opaque type for IndexFlat1D
- faiss_
Index ⚠Flat1D_ new_ with - faiss_
Index ⚠Flat1D_ update_ permutation - faiss_
Index ⚠FlatIP_ cast - faiss_
Index ⚠FlatIP_ free - faiss_
Index ⚠FlatIP_ new - Opaque type for IndexFlatIP
- faiss_
Index ⚠FlatIP_ new_ with - faiss_
Index ⚠Flat L2_ cast - faiss_
Index ⚠Flat L2_ free - faiss_
Index ⚠Flat L2_ new - Opaque type for IndexFlatL2
- faiss_
Index ⚠Flat L2_ new_ with - faiss_
Index ⚠Flat_ cast - faiss_
Index ⚠Flat_ compute_ distance_ subset - compute distance with a subset of vectors
- faiss_
Index ⚠Flat_ free - faiss_
Index ⚠Flat_ new - Opaque type for IndexFlat
- faiss_
Index ⚠Flat_ new_ with - faiss_
Index ⚠Flat_ xb - get a pointer to the index’s internal data (the
xb
field). The outputs become invalid after any data addition or removal operation. - faiss_
IndexID ⚠Map2_ cast - faiss_
IndexID ⚠Map2_ construct_ rev_ map - make the rev_map from scratch
- faiss_
IndexID ⚠Map2_ id_ map - get a pointer to the index map’s internal ID vector (the
id_map
field). The outputs of this function become invalid after any operation that can modify the index. - faiss_
IndexID ⚠Map2_ new - same as IndexIDMap but also provides an efficient reconstruction implementation via a 2-way index
- faiss_
IndexID ⚠Map2_ own_ fields - faiss_
IndexID ⚠Map2_ set_ own_ fields - faiss_
IndexID ⚠Map2_ sub_ index - get a pointer to the sub-index (the
index
field). The outputs of this function become invalid after any operation that can modify the index. - faiss_
IndexID ⚠Map_ cast - faiss_
IndexID ⚠Map_ id_ map - get a pointer to the index map’s internal ID vector (the
id_map
field). The outputs of this function become invalid after any operation that can modify the index. - faiss_
IndexID ⚠Map_ new - Index that translates search results to ids
- faiss_
IndexID ⚠Map_ own_ fields - faiss_
IndexID ⚠Map_ set_ own_ fields - faiss_
IndexID ⚠Map_ sub_ index - get a pointer to the sub-index (the
index
field). The outputs of this function become invalid after any operation that can modify the index. - faiss_
IndexIVF ⚠Flat_ add_ core - faiss_
IndexIVF ⚠Flat_ cast - faiss_
IndexIVF ⚠Flat_ free - faiss_
IndexIVF ⚠Flat_ new - whether object owns the quantizer
- faiss_
IndexIVF ⚠Flat_ new_ with - faiss_
IndexIVF ⚠Flat_ new_ with_ metric - faiss_
IndexIVF ⚠Flat_ nlist - faiss_
IndexIVF ⚠Flat_ nprobe - faiss_
IndexIVF ⚠Flat_ own_ fields - faiss_
IndexIVF ⚠Flat_ quantizer - faiss_
IndexIVF ⚠Flat_ quantizer_ trains_ alone - faiss_
IndexIVF ⚠Flat_ set_ nprobe - faiss_
IndexIVF ⚠Flat_ set_ own_ fields - faiss_
IndexIVF ⚠Flat_ update_ vectors - Update a subset of vectors.
- faiss_
IndexIVF ⚠Scalar Quantizer_ add_ core - whether object owns the quantizer
- faiss_
IndexIVF ⚠Scalar Quantizer_ cast - faiss_
IndexIVF ⚠Scalar Quantizer_ free - faiss_
IndexIVF ⚠Scalar Quantizer_ new - Opaque type for IndexIVFScalarQuantizer
- faiss_
IndexIVF ⚠Scalar Quantizer_ new_ with - faiss_
IndexIVF ⚠Scalar Quantizer_ new_ with_ metric - faiss_
IndexIVF ⚠Scalar Quantizer_ nlist - faiss_
IndexIVF ⚠Scalar Quantizer_ nprobe - faiss_
IndexIVF ⚠Scalar Quantizer_ own_ fields - faiss_
IndexIVF ⚠Scalar Quantizer_ quantizer - faiss_
IndexIVF ⚠Scalar Quantizer_ set_ nprobe - faiss_
IndexIVF ⚠Scalar Quantizer_ set_ own_ fields - faiss_
IndexIVF ⚠Scalar Quantizer_ train_ residual - faiss_
IndexIVF ⚠Stats_ reset - faiss_
IndexIVF_ ⚠cast - faiss_
IndexIVF_ ⚠copy_ subset_ to - copy a subset of the entries index to the other index
- faiss_
IndexIVF_ ⚠free - faiss_
IndexIVF_ ⚠get_ list_ size - faiss_
IndexIVF_ ⚠imbalance_ factor - Check the inverted lists’ imbalance factor.
- faiss_
IndexIVF_ ⚠invlists_ get_ ids - Get the IDs in an inverted list. IDs are written to
invlist
, which must be large enough to accommodate the full list. - faiss_
IndexIVF_ ⚠make_ direct_ map - initialize a direct map
- faiss_
IndexIVF_ ⚠merge_ from - moves the entries from another dataset to self. On output, other is empty. add_id is added to all moved ids (for sequential ids, this would be this->ntotal
- faiss_
IndexIVF_ ⚠nlist - faiss_
IndexIVF_ ⚠nprobe - faiss_
IndexIVF_ ⚠own_ fields - faiss_
IndexIVF_ ⚠print_ stats - display some stats about the inverted lists of the index
- faiss_
IndexIVF_ ⚠quantizer - faiss_
IndexIVF_ ⚠quantizer_ trains_ alone - faiss_
IndexIVF_ ⚠search_ preassigned - search a set of vectors, that are pre-quantized by the IVF quantizer. Fill in the corresponding heaps with the query results. search() calls this.
- faiss_
IndexIVF_ ⚠set_ nprobe - faiss_
IndexIVF_ ⚠set_ own_ fields - faiss_
IndexLSH_ ⚠cast - faiss_
IndexLSH_ ⚠code_ size - faiss_
IndexLSH_ ⚠free - faiss_
IndexLSH_ ⚠nbits - faiss_
IndexLSH_ ⚠new - The sign of each vector component is put in a binary signature
- faiss_
IndexLSH_ ⚠new_ with_ options - faiss_
IndexLSH_ ⚠rotate_ data - faiss_
IndexLSH_ ⚠train_ thresholds - faiss_
Index ⚠PreTransform_ cast - faiss_
Index ⚠PreTransform_ free - faiss_
Index ⚠PreTransform_ index - faiss_
Index ⚠PreTransform_ new - Index that applies a LinearTransform transform on vectors before handing them over to a sub-index
- faiss_
Index ⚠PreTransform_ new_ with - faiss_
Index ⚠PreTransform_ new_ with_ transform - faiss_
Index ⚠PreTransform_ own_ fields - faiss_
Index ⚠PreTransform_ prepend_ transform - faiss_
Index ⚠PreTransform_ set_ own_ fields - faiss_
Index ⚠Refine Flat_ cast - faiss_
Index ⚠Refine Flat_ free - faiss_
Index ⚠Refine Flat_ k_ factor - faiss_
Index ⚠Refine Flat_ new - Opaque type for IndexRefineFlat
- faiss_
Index ⚠Refine Flat_ own_ fields - faiss_
Index ⚠Refine Flat_ set_ k_ factor - faiss_
Index ⚠Refine Flat_ set_ own_ fields - faiss_
Index ⚠Replicas_ add_ replica - faiss_
Index ⚠Replicas_ at - faiss_
Index ⚠Replicas_ free - faiss_
Index ⚠Replicas_ new - Index that concatenates the results from several sub-indexes
- faiss_
Index ⚠Replicas_ new_ with_ options - faiss_
Index ⚠Replicas_ own_ fields - faiss_
Index ⚠Replicas_ remove_ replica - faiss_
Index ⚠Replicas_ set_ own_ fields - faiss_
Index ⚠Scalar Quantizer_ cast - faiss_
Index ⚠Scalar Quantizer_ free - faiss_
Index ⚠Scalar Quantizer_ new - Opaque type for IndexScalarQuantizer
- faiss_
Index ⚠Scalar Quantizer_ new_ with - faiss_
Index ⚠Shards_ add_ shard - faiss_
Index ⚠Shards_ at - faiss_
Index ⚠Shards_ free - faiss_
Index ⚠Shards_ new - Index that concatenates the results from several sub-indexes
- faiss_
Index ⚠Shards_ new_ with_ options - faiss_
Index ⚠Shards_ own_ fields - faiss_
Index ⚠Shards_ remove_ shard - faiss_
Index ⚠Shards_ set_ own_ fields - faiss_
Index ⚠Shards_ set_ successive_ ids - faiss_
Index ⚠Shards_ successive_ ids - faiss_
Index_ ⚠add - Add n vectors of dimension d to the index.
- faiss_
Index_ ⚠add_ with_ ids - Same as add, but stores xids instead of sequential ids.
- faiss_
Index_ ⚠assign - return the indexes of the k vectors closest to the query x.
- faiss_
Index_ ⚠compute_ residual - Computes a residual vector after indexing encoding.
- faiss_
Index_ ⚠compute_ residual_ n - Computes a residual vector after indexing encoding.
- faiss_
Index_ ⚠d - faiss_
Index_ ⚠free - faiss_
Index_ ⚠is_ trained - faiss_
Index_ ⚠metric_ type - faiss_
Index_ ⚠ntotal - faiss_
Index_ ⚠range_ search - query n vectors of dimension d to the index.
- faiss_
Index_ ⚠reconstruct - Reconstruct a stored vector (or an approximation if lossy coding)
- faiss_
Index_ ⚠reconstruct_ n - Reconstruct vectors i0 to i0 + ni - 1
- faiss_
Index_ ⚠remove_ ids - removes IDs from the index. Not supported by all indexes @param index opaque pointer to index object @param nremove output for the number of IDs removed
- faiss_
Index_ ⚠reset - removes all elements from the database. @param index opaque pointer to index object
- faiss_
Index_ ⚠sa_ code_ size - The size of the produced codes in bytes.
- faiss_
Index_ ⚠sa_ decode - decode a set of vectors
- faiss_
Index_ ⚠sa_ encode - encode a set of vectors
- faiss_
Index_ ⚠search - query n vectors of dimension d to the index.
- faiss_
Index_ ⚠search_ with_ params - query n vectors of dimension d with seach parameters to the index.
- faiss_
Index_ ⚠set_ verbose - faiss_
Index_ ⚠train - Perform training on a representative set of vectors
- faiss_
Index_ ⚠verbose - faiss_
Linear ⚠Transform_ free - faiss_
Linear ⚠Transform_ have_ bias - faiss_
Linear ⚠Transform_ is_ orthonormal - faiss_
Linear ⚠Transform_ set_ is_ orthonormal - compute A^T * A to set the is_orthonormal flag
- faiss_
Linear ⚠Transform_ transform_ transpose - compute x = A^T * (x - b) is reverse transform if A has orthonormal lines
- faiss_
Normalization ⚠Transform_ free - faiss_
Normalization ⚠Transform_ new_ with - faiss_
Normalization ⚠Transform_ norm - faiss_
OPQMatrix_ ⚠free - faiss_
OPQMatrix_ ⚠new_ with - Getter for do_pca
- faiss_
OPQMatrix_ ⚠niter - faiss_
OPQMatrix_ ⚠niter_ pq - faiss_
OPQMatrix_ ⚠set_ niter - faiss_
OPQMatrix_ ⚠set_ niter_ pq - faiss_
OPQMatrix_ ⚠set_ verbose - faiss_
OPQMatrix_ ⚠verbose - faiss_
PCAMatrix_ ⚠eigen_ power - faiss_
PCAMatrix_ ⚠free - faiss_
PCAMatrix_ ⚠new_ with - faiss_
PCAMatrix_ ⚠random_ rotation - faiss_
Parameter ⚠Range_ name - faiss_
Parameter ⚠Range_ values - Getter for the values in the range. The output values are invalidated upon any other modification of the range.
- faiss_
Parameter ⚠Space_ add_ range - add a new parameter (or return it if it exists)
- faiss_
Parameter ⚠Space_ combination_ name - get string representation of the combination by writing it to the given character buffer. A buffer size of 1000 ensures that the full name is collected.
- faiss_
Parameter ⚠Space_ display - print a description on stdout
- faiss_
Parameter ⚠Space_ free - faiss_
Parameter ⚠Space_ n_ combinations - nb of combinations, = product of values sizes
- faiss_
Parameter ⚠Space_ new - Parameter space default constructor
- faiss_
Parameter ⚠Space_ set_ index_ parameter - set one of the parameters
- faiss_
Parameter ⚠Space_ set_ index_ parameters - set a combination of parameters described by a string
- faiss_
Parameter ⚠Space_ set_ index_ parameters_ cno - set a combination of parameters on an index
- faiss_
Random ⚠Rotation Matrix_ free - faiss_
Random ⚠Rotation Matrix_ new_ with - Getter for is_orthonormal
- faiss_
Range ⚠Query Result_ add - result structure for a single query
- faiss_
Range ⚠Query Result_ nres - faiss_
Range ⚠Query Result_ pres - faiss_
Range ⚠Query Result_ qno - faiss_
Range ⚠Search Partial Result_ finalize - faiss_
Range ⚠Search Partial Result_ new - faiss_
Range ⚠Search Partial Result_ new_ result - faiss_
Range ⚠Search Partial Result_ res - faiss_
Range ⚠Search Partial Result_ set_ lims - called by range_search before do_allocation
- faiss_
Range ⚠Search Result_ buffer_ size - faiss_
Range ⚠Search Result_ do_ allocation - called when lims contains the nb of elements result entries for each query
- faiss_
Range ⚠Search Result_ free - faiss_
Range ⚠Search Result_ labels - getter for labels and respective distances (not sorted): result for query i is labels[lims[i]:lims[i+1]]
- faiss_
Range ⚠Search Result_ lims - getter for lims: size (nq + 1)
- faiss_
Range ⚠Search Result_ new - faiss_
Range ⚠Search Result_ new_ with - faiss_
Range ⚠Search Result_ nq - faiss_
Remap ⚠Dimensions Transform_ free - faiss_
Remap ⚠Dimensions Transform_ new_ with - faiss_
Search ⚠ParametersIVF_ cast - faiss_
Search ⚠ParametersIVF_ free - faiss_
Search ⚠ParametersIVF_ max_ codes - faiss_
Search ⚠ParametersIVF_ new - faiss_
Search ⚠ParametersIVF_ new_ with - faiss_
Search ⚠ParametersIVF_ nprobe - faiss_
Search ⚠ParametersIVF_ sel - faiss_
Search ⚠ParametersIVF_ set_ max_ codes - faiss_
Search ⚠ParametersIVF_ set_ nprobe - faiss_
Search ⚠Parameters_ free - faiss_
Search ⚠Parameters_ new - faiss_
Vector ⚠Transform_ apply - apply the random rotation, return new allocated matrix @param x size n * d_in @return size n * d_out
- faiss_
Vector ⚠Transform_ apply_ noalloc - apply transformation and result is pre-allocated @param x size n * d_in @param xt size n * d_out
- faiss_
Vector ⚠Transform_ d_ in - faiss_
Vector ⚠Transform_ d_ out - faiss_
Vector ⚠Transform_ free - faiss_
Vector ⚠Transform_ is_ trained - faiss_
Vector ⚠Transform_ reverse_ transform - reverse transformation. May not be implemented or may return approximate result
- faiss_
Vector ⚠Transform_ train - Perform training on a representative set of vectors
- faiss_
clone_ ⚠index - Clone an index. This is equivalent to
faiss::clone_index
- faiss_
fvec_ ⚠L2sqr_ ny - compute ny square L2 distance between x and a set of contiguous y vectors
- faiss_
fvec_ ⚠inner_ products_ ny - compute the inner product between nx vectors x and one y
- faiss_
fvec_ ⚠norm_ L2sqr - squared norm of a vector
- faiss_
fvec_ ⚠norms_ L2 - compute the L2 norms for a set of vectors
- faiss_
fvec_ ⚠norms_ L2sqr - same as fvec_norms_L2, but computes squared norms
- faiss_
fvec_ ⚠renorm_ L2 - L2-renormalize a set of vector. Nothing done if the vector is 0-normed
- faiss_
get_ ⚠distance_ compute_ blas_ database_ bs - Getter of block sizes value for BLAS distance computations
- faiss_
get_ ⚠distance_ compute_ blas_ query_ bs - Getter of block sizes value for BLAS distance computations
- faiss_
get_ ⚠distance_ compute_ blas_ threshold - Getter of threshold value on nx above which we switch to BLAS to compute distances
- faiss_
get_ ⚠distance_ compute_ min_ k_ reservoir - Getter of number of results we switch to a reservoir to collect results rather than a heap
- faiss_
get_ ⚠indexIVF_ stats - global var that collects all statists
- faiss_
get_ ⚠last_ error - Get the error message of the last failed operation performed by Faiss. The given pointer is only invalid until another Faiss function is called.
- faiss_
index_ ⚠factory - Build and index with the sequence of processing steps described in the string.
- faiss_
kmeans_ ⚠clustering - simplified interface
- faiss_
pairwise_ ⚠L2sqr - Compute pairwise distances between sets of vectors
- faiss_
pairwise_ ⚠L2sqr_ with_ defaults - Compute pairwise distances between sets of vectors arguments from “faiss_pairwise_L2sqr” ldq equal -1 by default ldb equal -1 by default ldd equal -1 by default
- faiss_
read_ ⚠index - Read index from a file.
This is equivalent to
faiss:read_index
when a file descriptor is given. - faiss_
read_ ⚠index_ binary - Read index from a file.
This is equivalent to
faiss:read_index_binary
when a file descriptor is given. - faiss_
read_ ⚠index_ binary_ fname - Read index from a file.
This is equivalent to
faiss:read_index_binary
when a file path is given. - faiss_
read_ ⚠index_ fname - Read index from a file.
This is equivalent to
faiss:read_index
when a file path is given. - faiss_
set_ ⚠distance_ compute_ blas_ database_ bs - Setter of block sizes value for BLAS distance computations
- faiss_
set_ ⚠distance_ compute_ blas_ query_ bs - Setter of block sizes value for BLAS distance computations
- faiss_
set_ ⚠distance_ compute_ blas_ threshold - Setter of threshold value on nx above which we switch to BLAS to compute distances
- faiss_
set_ ⚠distance_ compute_ min_ k_ reservoir - Setter of number of results we switch to a reservoir to collect results rather than a heap
- faiss_
write_ ⚠index - Write index to a file.
This is equivalent to
faiss::write_index
when a file descriptor is provided. - faiss_
write_ ⚠index_ binary - Write index to a file.
This is equivalent to
faiss::write_index_binary
when a file descriptor is provided. - faiss_
write_ ⚠index_ binary_ fname - Write index to a file.
This is equivalent to
faiss::write_index_binary
when a file path is provided. - faiss_
write_ ⚠index_ fname - Write index to a file.
This is equivalent to
faiss::write_index
when a file path is provided.
Type Aliases§
- FILE
- Faiss
Buffer List - Faiss
Centering Transform - Faiss
Clustering - Faiss
Clustering Iteration Stats - Faiss
Distance Computer - FaissID
Selector - FaissID
Selector And - FaissID
Selector Batch - FaissID
Selector Not - FaissID
Selector Or - FaissID
Selector Range - FaissID
SelectorX Or - FaissITQ
Matrix - FaissITQ
Transform - Faiss
Index - Faiss
Index Binary - Faiss
Index Flat - Faiss
Index Flat1D - Faiss
Index FlatIP - Faiss
Index Flat L2 - Faiss
IndexID Map - Faiss
IndexID Map2 - Faiss
IndexIVF - Faiss
IndexIVF Flat - Faiss
IndexIVF Scalar Quantizer - Faiss
IndexLSH - Faiss
Index PreTransform - Faiss
Index Refine Flat - Faiss
Index Replicas - Faiss
Index Scalar Quantizer - Faiss
Index Shards - Faiss
Linear Transform - Faiss
Normalization Transform - FaissOPQ
Matrix - FaissPCA
Matrix - Faiss
Parameter Range - Faiss
Parameter Space - Faiss
Random Rotation Matrix - Faiss
Range Query Result - Faiss
Range Search Partial Result - Faiss
Range Search Result - Faiss
Remap Dimensions Transform - Faiss
Search Parameters - Faiss
Search ParametersIVF - Faiss
Vector Transform - faiss_
idx_ t - idx_t