Faiss

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | List of all members
faiss::InvertedListScanner Struct Referenceabstract

`#include <IndexIVF.h>`

## Public Types
using | idx_t = Index::idx_t

## Public Member Functions
virtual void | set_query (const float *query_vector)=0
| from now on we handle this query.
virtual void | set_list (idx_t list_no, float coarse_dis)=0
| following codes come from this inverted list
virtual float | distance_to_code (const uint8_t *code) const =0
| compute a single query-to-code distance
virtual size_t | scan_codes (size_t n, const uint8_t *codes, const idx_t *ids, float *distances, idx_t *labels, size_t k) const =0
virtual void | scan_codes_range (size_t n, const uint8_t *codes, const idx_t *ids, float radius, RangeQueryResult &result) const

## Detailed Description

Object that handles a query. The inverted lists to scan are provided externally. The object has a lot of state, but distance_to_code and scan_codes can be called in multiple threads

Definition at line 272 of file IndexIVF.h.

## Member Function Documentation

virtual size_t faiss::InvertedListScanner::scan_codes | ( | size_t | n,
|  | const uint8_t * | codes,
|  | const idx_t * | ids,
|  | float * | distances,
|  | idx_t * | labels,
|  | size_t | k
| ) |  | const
| pure virtual

scan a set of codes, compute distances to current query and update heap of results if necessary.

Parameters

  n | number of codes to scan
  codes | codes to scan (n * code_size)
  ids | corresponding ids (ignored if store_pairs)
  distances | heap distances (size k)
  labels | heap labels (size k)
  k | heap size

Returns
  number of heap updates performed

void faiss::InvertedListScanner::scan_codes_range | ( | size_t | n,
|  | const uint8_t * | codes,
|  | const idx_t * | ids,
|  | float | radius,
|  | RangeQueryResult & | result
| ) |  | const
| virtual

scan a set of codes, compute distances to current query and update results if distances are below radius

(default implementation fails)

Definition at line 830 of file IndexIVF.cpp.

The documentation for this struct was generated from the following files:

- /data/users/hoss/faiss/IndexIVF.h
- /data/users/hoss/faiss/IndexIVF.cpp