Crate faiss_sys[][src]

Structs

FaissBuffer

List of temporary buffers used to store results before they are copied to the RangeSearchResult object.

FaissBufferList_H
FaissClusteringIterationStats_H
FaissClusteringParameters

Class for the clustering parameters. Can be passed to the constructor of the Clustering object.

FaissClustering_H
FaissDistanceComputer_H
FaissIDSelectorBatch_H
FaissIDSelectorRange_H
FaissIDSelector_H
FaissIndexIDMap_H
FaissIndexIVFStats
FaissIndex_H
FaissParameterRange_H
FaissParameterSpace_H
FaissRangeQueryResult_H
FaissRangeSearchPartialResult_H
FaissRangeSearchResult_H
FaissVectorTransform_H

Constants

FaissErrorCode_FAISS_EXCEPT

Faiss library exception

FaissErrorCode_OK

No error

FaissErrorCode_STD_EXCEPT

Standard C++ library exception

FaissErrorCode_UNKNOWN_EXCEPT

Any exception other than Faiss or standard C++ library exceptions

FaissMetricType_METRIC_BrayCurtis

some additional metrics defined in scipy.spatial.distance

FaissMetricType_METRIC_Canberra

some additional metrics defined in scipy.spatial.distance

FaissMetricType_METRIC_INNER_PRODUCT

< maximum inner product search

FaissMetricType_METRIC_JensenShannon

some additional metrics defined in scipy.spatial.distance

FaissMetricType_METRIC_L1

< L1 (aka cityblock)

FaissMetricType_METRIC_L2

< squared L2 search

FaissMetricType_METRIC_Linf

< infinity distance

FaissMetricType_METRIC_Lp

< L_p distance, p is given by metric_arg

FaissQuantizerType_QT_4bit

< 4 bits per component

FaissQuantizerType_QT_4bit_uniform
FaissQuantizerType_QT_6bit

< 6 bits per component

FaissQuantizerType_QT_8bit

< 8 bits per component

FaissQuantizerType_QT_8bit_direct

< fast indexing of uint8s

FaissQuantizerType_QT_8bit_uniform

< same, shared range for all dimensions

FaissQuantizerType_QT_fp16

Functions

faiss_BufferList_add
faiss_BufferList_append_buffer
faiss_BufferList_buffer_size
faiss_BufferList_copy_range

copy elemnts ofs:ofs+n-1 seen as linear data in the buffers to tables dest_ids, dest_dis

faiss_BufferList_free
faiss_BufferList_new
faiss_BufferList_wp
faiss_CenteringTransform_free
faiss_CenteringTransform_new_with
faiss_ClusteringIterationStats_imbalance_factor
faiss_ClusteringIterationStats_nsplit
faiss_ClusteringIterationStats_obj
faiss_ClusteringIterationStats_time
faiss_ClusteringIterationStats_time_search
faiss_ClusteringParameters_init

Sets the ClusteringParameters object with reasonable defaults

faiss_Clustering_centroids

getter for centroids (size = k * d)

faiss_Clustering_d
faiss_Clustering_free
faiss_Clustering_frozen_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_DistanceComputer_free
faiss_DistanceComputer_set_query

called before computing distances

faiss_DistanceComputer_symmetric_dis

compute distance between two stored vectors

faiss_DistanceComputer_vector_to_query_dis

Compute distance of vector i to current query. This function corresponds to the function call operator: DistanceComputer::operator()

faiss_IDSelectorBatch_mask
faiss_IDSelectorBatch_nbits
faiss_IDSelectorBatch_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_IDSelectorRange_free
faiss_IDSelectorRange_imax
faiss_IDSelectorRange_imin
faiss_IDSelectorRange_new

remove ids between [imni, imax)

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_IndexFlat1D_new

Opaque type for IndexFlat1D

faiss_IndexFlat1D_new_with
faiss_IndexFlat1D_update_permutation
faiss_IndexFlatIP_new

Opaque type for IndexFlatIP

faiss_IndexFlatIP_new_with
faiss_IndexFlatL2_new

Opaque type for IndexFlatL2

faiss_IndexFlatL2_new_with
faiss_IndexFlat_cast
faiss_IndexFlat_compute_distance_subset

compute distance with a subset of vectors

faiss_IndexFlat_free
faiss_IndexFlat_new

Opaque type for IndexFlat

faiss_IndexFlat_new_with
faiss_IndexFlat_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_IndexIDMap2_construct_rev_map

make the rev_map from scratch

faiss_IndexIDMap2_new

same as IndexIDMap but also provides an efficient reconstruction implementation via a 2-way index

faiss_IndexIDMap_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_IndexIDMap_new

Index that translates search results to ids

faiss_IndexIDMap_own_fields
faiss_IndexIDMap_set_own_fields
faiss_IndexIVFFlat_add_core
faiss_IndexIVFFlat_cast
faiss_IndexIVFFlat_free
faiss_IndexIVFFlat_new

whether object owns the quantizer

faiss_IndexIVFFlat_new_with
faiss_IndexIVFFlat_new_with_metric
faiss_IndexIVFFlat_nlist
faiss_IndexIVFFlat_nprobe
faiss_IndexIVFFlat_own_fields
faiss_IndexIVFFlat_quantizer
faiss_IndexIVFFlat_quantizer_trains_alone
faiss_IndexIVFFlat_set_nprobe
faiss_IndexIVFFlat_set_own_fields
faiss_IndexIVFFlat_update_vectors

Update a subset of vectors.

faiss_IndexIVFScalarQuantizer_add_core

whether object owns the quantizer

faiss_IndexIVFScalarQuantizer_cast
faiss_IndexIVFScalarQuantizer_free
faiss_IndexIVFScalarQuantizer_new

Opaque type for IndexIVFScalarQuantizer

faiss_IndexIVFScalarQuantizer_new_with
faiss_IndexIVFScalarQuantizer_new_with_metric
faiss_IndexIVFScalarQuantizer_nlist
faiss_IndexIVFScalarQuantizer_nprobe
faiss_IndexIVFScalarQuantizer_own_fields
faiss_IndexIVFScalarQuantizer_quantizer
faiss_IndexIVFScalarQuantizer_set_nprobe
faiss_IndexIVFScalarQuantizer_set_own_fields
faiss_IndexIVFScalarQuantizer_train_residual
faiss_IndexIVFStats_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_bytes_per_vec
faiss_IndexLSH_cast
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_IndexPreTransform_cast
faiss_IndexPreTransform_free
faiss_IndexPreTransform_index
faiss_IndexPreTransform_new

Index that applies a LinearTransform transform on vectors before handing them over to a sub-index

faiss_IndexPreTransform_new_with
faiss_IndexPreTransform_new_with_transform
faiss_IndexPreTransform_own_fields
faiss_IndexPreTransform_set_own_fields
faiss_IndexRefineFlat_free
faiss_IndexRefineFlat_k_factor
faiss_IndexRefineFlat_new

Opaque type for IndexRefineFlat

faiss_IndexRefineFlat_own_fields
faiss_IndexRefineFlat_set_k_factor
faiss_IndexRefineFlat_set_own_fields
faiss_IndexScalarQuantizer_cast
faiss_IndexScalarQuantizer_free
faiss_IndexScalarQuantizer_new

Opaque type for IndexScalarQuantizer

faiss_IndexScalarQuantizer_new_with
faiss_IndexShards_add_shard
faiss_IndexShards_at
faiss_IndexShards_new

Index that concatenates the results from several sub-indexes

faiss_IndexShards_new_with_options
faiss_IndexShards_own_fields
faiss_IndexShards_set_own_fields
faiss_IndexShards_set_successive_ids
faiss_IndexShards_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_search

query n vectors of dimension d to the index.

faiss_Index_set_verbose
faiss_Index_train

Perform training on a representative set of vectors

faiss_Index_verbose
faiss_LinearTransform_free
faiss_LinearTransform_have_bias
faiss_LinearTransform_is_orthonormal
faiss_LinearTransform_set_is_orthonormal

compute A^T * A to set the is_orthonormal flag

faiss_LinearTransform_transform_transpose

compute x = A^T * (x - b) is reverse transform if A has orthonormal lines

faiss_NormalizationTransform_free
faiss_NormalizationTransform_new_with
faiss_NormalizationTransform_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_ParameterRange_name
faiss_ParameterRange_values

Getter for the values in the range. The output values are invalidated upon any other modification of the range.

faiss_ParameterSpace_add_range

add a new parameter (or return it if it exists)

faiss_ParameterSpace_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_ParameterSpace_display

print a description on stdout

faiss_ParameterSpace_free
faiss_ParameterSpace_n_combinations

nb of combinations, = product of values sizes

faiss_ParameterSpace_new

Parameter space default constructor

faiss_ParameterSpace_set_index_parameter

set one of the parameters

faiss_ParameterSpace_set_index_parameters

set a combination of parameters described by a string

faiss_ParameterSpace_set_index_parameters_cno

set a combination of parameters on an index

faiss_RandomRotationMatrix_free
faiss_RandomRotationMatrix_new_with

Getter for is_orthonormal

faiss_RangeQueryResult_add

result structure for a single query

faiss_RangeQueryResult_nres
faiss_RangeQueryResult_pres
faiss_RangeQueryResult_qno
faiss_RangeSearchPartialResult_finalize
faiss_RangeSearchPartialResult_new
faiss_RangeSearchPartialResult_new_result
faiss_RangeSearchPartialResult_res
faiss_RangeSearchPartialResult_set_lims

called by range_search before do_allocation

faiss_RangeSearchResult_buffer_size
faiss_RangeSearchResult_do_allocation

called when lims contains the nb of elements result entries for each query

faiss_RangeSearchResult_free
faiss_RangeSearchResult_labels

getter for labels and respective distances (not sorted): result for query i is labels[lims[i]:lims[i+1]]

faiss_RangeSearchResult_lims

getter for lims: size (nq + 1)

faiss_RangeSearchResult_new
faiss_RangeSearchResult_new_with
faiss_RangeSearchResult_nq
faiss_RemapDimensionsTransform_free
faiss_RemapDimensionsTransform_new_with
faiss_VectorTransform_apply

apply the random rotation, return new allocated matrix @param x size n * d_in @return size n * d_out

faiss_VectorTransform_apply_noalloc

apply transformation and result is pre-allocated @param x size n * d_in @param xt size n * d_out

faiss_VectorTransform_d_in
faiss_VectorTransform_d_out
faiss_VectorTransform_free
faiss_VectorTransform_is_trained
faiss_VectorTransform_reverse_transform

reverse transformation. May not be implemented or may return approximate result

faiss_VectorTransform_train

Perform training on a representative set of vectors

faiss_clone_index

Clone an index. This is equivalent to faiss::clone_index

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_read_index

Read index from a file. This is equivalent to faiss:read_index when a file descriptor 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_write_index

Write index to a file. This is equivalent to faiss::write_index when a file descriptor 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 Definitions

FILE
FaissBufferList
FaissCenteringTransform
FaissClustering
FaissClusteringIterationStats
FaissDistanceComputer
FaissErrorCode

An error code which depends on the exception thrown from the previous operation. See faiss_get_last_error to retrieve the error message.

FaissIDSelector
FaissIDSelectorBatch
FaissIDSelectorRange
FaissITQMatrix
FaissITQTransform
FaissIndex
FaissIndexFlat
FaissIndexFlat1D
FaissIndexFlatIP
FaissIndexFlatL2
FaissIndexIDMap
FaissIndexIDMap2
FaissIndexIVF
FaissIndexIVFFlat
FaissIndexIVFScalarQuantizer
FaissIndexLSH
FaissIndexPreTransform
FaissIndexRefineFlat
FaissIndexScalarQuantizer
FaissIndexShards
FaissLinearTransform
FaissMetricType

Some algorithms support both an inner product version and a L2 search version.

FaissNormalizationTransform
FaissOPQMatrix
FaissPCAMatrix
FaissParameterRange
FaissParameterSpace
FaissQuantizerType
FaissRandomRotationMatrix
FaissRangeQueryResult
FaissRangeSearchPartialResult
FaissRangeSearchResult
FaissRemapDimensionsTransform
FaissVectorTransform
__int64_t
faiss_idx_t
idx_t