search_with_masks
API Definition |
void search_with_masks(Index::idx_t n, const float *x, Index::idx_t k, float *distances, Index::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 base library 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 feature vectors to be queried. const float *x: feature vector data. idx_t k: number of the most similar results to be returned. const void *mask: feature base library mask |
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 |
|