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 | Public Attributes | List of all members
faiss::HeapArray< C > Struct Template Reference

`#include <Heap.h>`

## Public Types
typedef C::TI | TI
typedef C::T | T

## Public Member Functions
T * | get_val (size_t key)
| Return the list of values for a heap.
TI * | get_ids (size_t key)
| Correspponding identifiers.
void | heapify ()
| prepare all the heaps before adding
void | addn (size_t nj, const T *vin, TI j0=0, size_t i0=0, long ni=-1)
void | addn_with_ids (size_t nj, const T *vin, const TI *id_in=nullptr, long id_stride=0, size_t i0=0, long ni=-1)
void | reorder ()
| reorder all the heaps
void | per_line_extrema (T *vals_out, TI *idx_out) const

## Public Attributes
size_t | nh
| number of heaps
size_t | k
| allocated size per heap
TI * | ids
| identifiers (size nh * k)
T * | val
| values (distances or similarities), size nh * k

## Detailed Description

### template<typename C>
struct faiss::HeapArray< C >

a template structure for a set of [min|max]-heaps it is tailored so that the actual data of the heaps can just live in compact arrays.

Definition at line 351 of file Heap.h.

## Member Function Documentation

template<typename C >

void faiss::HeapArray< C >::addn | ( | size_t | nj,
|  | const T * | vin,
|  | TI | j0 = `0`,
|  | size_t | i0 = `0`,
|  | long | ni = `-1`
| ) |  |

add nj elements to heaps i0:i0+ni, with sequential ids

Parameters

  nj | nb of elements to add to each heap
  vin | elements to add, size ni * nj
  j0 | add this to the ids that are added
  i0 | first heap to update
  ni | nb of elements to update (-1 = use nh)

Definition at line 43 of file Heap.cpp.

template<typename C >

void faiss::HeapArray< C >::addn_with_ids | ( | size_t | nj,
|  | const T * | vin,
|  | const TI * | id_in = `nullptr`,
|  | long | id_stride = `0`,
|  | size_t | i0 = `0`,
|  | long | ni = `-1`
| ) |  |

same as addn

Parameters

  id_in | ids of the elements to add, size ni * nj
  id_stride | stride for id_in

Definition at line 65 of file Heap.cpp.

template<typename C >

void faiss::HeapArray< C >::per_line_extrema | ( | T * | vals_out,
|  | TI * | idx_out
| ) |  | const

this is not really a heap function. It just finds the per-line extrema of each line of array D

Parameters

  vals_out | extreme value of each line (size nh, or NULL)
  idx_out | index of extreme value (size nh or NULL)

Definition at line 93 of file Heap.cpp.

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

- Heap.h
- Heap.cpp