add_with_ids

API Definition

void add_with_ids(Index::idx_t n, const float *x, const Index::idx_t *ids) override;

Function

Creates a base library for AscendIndex and adds new feature vectors into the library. Each feature vector in the base library has a corresponding ID.

Input

Index::idx_t n: number of feature vectors to be added to the base library.

const float *x: feature vectors to be added to the base library.

const Index::idx_t *ids: IDs of the feature vectors to be added to the base library.

Output

N/A

Return Value

N/A

Restrictions

The length of the x must be dim x n, and the length of the ids must be n. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown. The value of n cannot exceed 1e9.