search_with_masks
API definition |
void search_with_masks(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels, const void *mask) const; |
|---|---|
Function |
Queries the feature vectors for AscendIndexSQ and returns IDs of the most similar k features based on the input feature vectors. The mask is a bit string consisting of 0 and 1. Each bit indicates whether the feature of the corresponding sequence in the database is involved in distance calculation. 1 indicates that it is involved, and 0 indicates that it is not involved. |
Input |
idx_t n: number of query vectors. const float *x: feature vector data. idx_t k: number of the most similar results to be returned. const void *mask: database masks. |
Output |
float *distances: distance between a vector and the first k nearest vectors. idx_t *labels: IDs of the first k nearest vectors that are queried. |
Return value |
N/A |
Restrictions |
|