multi-layer repository/Static Index/PQ_quantizer.cpp
void PQ_quantizer::search_in_group(const float * query, const idx_t group_id, float * result_dists, idx_t * result_labels, size_t keep_space){
        assert(keep_space <= exact_ksubs[group_id]);
        std::vector<float> distance_table(this->M * exact_ksubs[group_id]);
        this->PQs[group_id]->compute_distance_table(query, distance_table.data());
        multi_sequence_sort(group_id, distance_table.data(), keep_space, result_dists, result_labels);

    }
/**
     * This is the search function for PQ layer in one group
     * 
     * Input:
     * queries:      the query data                                        size: n * dimension
     * group_ids:    the group id for query data                           size: n
     * keep space:   how many result do we want to keep                    size_t
     * 
     * Output:
     * result_dists:  the result distances between queries and centroids   size: n * keep_space
     * result_labels: the result labels for queries                        size: n * keep_space
     * 
     * 
     **/
This is the search function for PQ layer in one group

the query data                                        size: n * dimension
group_ids:    the group id for query data                           size: n
keep space:   how many result do we want to keep                    size_t

the result distances between queries and centroids   size: n * keep_space
result_labels: the result labels for queries                        size: n * keep_space
This is the search function for PQ layer in one group the query data size : n * dimension group_ids : the group id for query data size : n keep space : how many result do we want to keep size_t the result distances between queries and centroids size : n * keep_space result_labels : the result labels for queries size : n * keep_space
void PQ_quantizer::search_in_group(const float * query, const idx_t group_id, float * result_dists, idx_t * result_labels, size_t keep_space){
        assert(keep_space <= exact_ksubs[group_id]);
        std::vector<float> distance_table(this->M * exact_ksubs[group_id]);
        this->PQs[group_id]->compute_distance_table(query, distance_table.data());
        multi_sequence_sort(group_id, distance_table.data(), keep_space, result_dists, result_labels);
    }
void PQ_quantizer :: search_in_group ( const float * query , const idx_t group_id , float * result_dists , idx_t * result_labels , size_t keep_space ) { assert ( keep_space <= exact_ksubs [ group_id ] ) ; std :: vector < float > distance_table ( this -> M * exact_ksubs [ group_id ] ) ; this -> PQs [ group_id ] -> compute_distance_table ( query , distance_table . data ( ) ) ; multi_sequence_sort ( group_id , distance_table . data ( ) , keep_space , result_dists , result_labels ) ; }
This is the search function for PQ layer in one group
This is the search function for PQ layer in one group