multi-layer repository/Static Index/PQ_quantizer.cpp
PQ_quantizer::PQ_quantizer(size_t dimension, size_t nc_upper, size_t M, size_t max_nbits):
        Base_quantizer(dimension, nc_upper, new_pow(2, max_nbits*M)), M(M), max_nbits(max_nbits){

            this->max_ksub = new_pow(2, max_nbits);
            this->dsub = dimension / M;
            this->exact_ksubs.resize(nc_upper);
            this->exact_nbits.resize(nc_upper);
        }
/**
     * The initialization function for PQ layer
     * 
     * Input: 
     * M: number of sub-spaces
     * max_nbits: bits for storing centroids in each subspace
     * 
     * Notice: we should keep the total number of centroids smaller than the range of int64
     * nc_upper * pow(2, max_nbits * M)
     * 
     **/
The initialization function for PQ layer

number of sub-spaces
max_nbits: bits for storing centroids in each subspace

we should keep the total number of centroids smaller than the range of int64
nc_upper * pow(2, max_nbits * M)
The initialization function for PQ layer number of sub - spaces max_nbits : bits for storing centroids in each subspace we should keep the total number of centroids smaller than the range of int64 nc_upper * pow ( 2 max_nbits * M )
PQ_quantizer::PQ_quantizer(size_t dimension, size_t nc_upper, size_t M, size_t max_nbits):
        Base_quantizer(dimension, nc_upper, new_pow(2, max_nbits*M)), M(M), max_nbits(max_nbits){
            this->max_ksub = new_pow(2, max_nbits);
            this->dsub = dimension / M;
            this->exact_ksubs.resize(nc_upper);
            this->exact_nbits.resize(nc_upper);
        }
PQ_quantizer :: PQ_quantizer ( size_t dimension , size_t nc_upper , size_t M , size_t max_nbits ) : Base_quantizer ( dimension , nc_upper , new_pow ( 2 , max_nbits * M ) ) , M ( M ) , max_nbits ( max_nbits ) { this -> max_ksub = new_pow ( 2 , max_nbits ) ; this -> dsub = dimension / M ; this -> exact_ksubs . resize ( nc_upper ) ; this -> exact_nbits . resize ( nc_upper ) ; }
The initialization function for PQ layer
The initialization function for PQ layer