Crate faiss_sys [] [src]

Structs

FaissBuffer

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

FaissBufferList_H
FaissClusteringParameters

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

FaissClustering_H
FaissIDSelectorBatch_H
FaissIDSelectorRange_H
FaissIDSelector_H
FaissIndexIDMap_H
FaissIndexIVFFlat_H
FaissIndexIVFStats
FaissIndex_H
FaissParameterRange_H
FaissParameterSpace_H
FaissQueryResult_H
FaissRangeSearchPartialResult_H
FaissRangeSearchResult_H

Constants

FaissErrorCode_FAISS_EXCEPT
FaissErrorCode_OK
FaissErrorCode_STD_EXCEPT
FaissErrorCode_UNKNOWN_EXCEPT
FaissMetricType_METRIC_INNER_PRODUCT
FaissMetricType_METRIC_L2

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_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_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_obj

getter for objective values (sum of distances reported by index) over iterations

faiss_Clustering_seed
faiss_Clustering_spherical
faiss_Clustering_train
faiss_Clustering_update_index
faiss_Clustering_verbose
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_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_IndexFlatL2BaseShift_new

Opaque type for IndexFlatL2BaseShift

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

Inverted file with stored vectors. Here the inverted file pre-selects the vectors to be searched, but they are not otherwise encoded, the code array just contains the raw float entries.

faiss_IndexIVFFlat_new_with
faiss_IndexIVFFlat_new_with_metric
faiss_IndexIVFFlat_update_vectors

Update a subset of vectors.

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

1= perfectly balanced, >1: imbalanced

faiss_IndexIVF_make_direct_map

intialize 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

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_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_IndexRefineFlat_free
faiss_IndexRefineFlat_new

Opaque type for IndexRefineFlat

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_set_threaded
faiss_IndexShards_shard_indexes

get a pointer to the index' shards (the shard_indexes field). The outputs of this function become invalid after any operation that can modify the index.

faiss_IndexShards_successive_ids
faiss_IndexShards_sync_with_shard_indexes

update metric_type and ntotal

faiss_IndexShards_threaded
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_d
faiss_Index_display

Display the actual class name and some more info @param index opaque pointer to index object

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_train

Perform training on a representative set of vectors

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_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_QueryResult_add
faiss_QueryResult_nres
faiss_QueryResult_pres
faiss_QueryResult_qno
faiss_RangeSearchPartialResult_finalize
faiss_RangeSearchPartialResult_new

the entries in the buffers are split per query

faiss_RangeSearchPartialResult_new_result

result structure for a single query

faiss_RangeSearchPartialResult_res
faiss_RangeSearchPartialResult_set_lims

called by range_search before do_allocation

faiss_RangeSearchPartialResult_set_result

called by range_search after 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_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
FaissClustering
FaissErrorCode
FaissIDSelector
FaissIDSelectorBatch
FaissIDSelectorRange
FaissIndex
FaissIndexFlat
FaissIndexFlat1D
FaissIndexFlatIP
FaissIndexFlatL2
FaissIndexFlatL2BaseShift
FaissIndexIDMap
FaissIndexIDMap2
FaissIndexIVF
FaissIndexIVFFlat
FaissIndexLSH
FaissIndexRefineFlat
FaissIndexShards
FaissMetricType

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

FaissParameterRange
FaissParameterSpace
FaissQueryResult
FaissRangeSearchPartialResult
FaissRangeSearchResult
idx_t