multi-layer repository/Static Index/VQ_quantizer.cpp
void VQ_quantizer::recover_residual_group_id(size_t n, const idx_t * labels, const float * residuals, float * x){
#pragma omp parallel for
        for (size_t i = 0; i < n; i++){
            std::vector<float> final_centroid(dimension);
            compute_final_centroid(labels[i], final_centroid.data());
            faiss::fvec_madd(dimension, residuals + i * dimension, 1.0, final_centroid.data(), x + i * dimension);
        }
    }
/**
     * This is for recover data point with residual and the centroid
     * 
     * Input:
     * n:             number of residual points.           size: umlimited
     * labels:        id of the centroid, [0, nc].         size: n
     * residuals:     precomputed residual of data point.  size: n * dimension
     * 
     * Output:
     * x:             reconstructed data point             size: n * dimension
     **/
This is for recover data point with residual and the centroid

number of residual points.           size: umlimited
labels:        id of the centroid, [0, nc].         size: n
residuals:     precomputed residual of data point.  size: n * dimension

reconstructed data point             size: n * dimension
This is for recover data point with residual and the centroid number of residual points . size : umlimited labels : id of the centroid [ 0 nc ] . size : n residuals : precomputed residual of data point . size : n * dimension reconstructed data point size : n * dimension
void VQ_quantizer::recover_residual_group_id(size_t n, const idx_t * labels, const float * residuals, float * x){
#pragma omp parallel for
        for (size_t i = 0; i < n; i++){
            std::vector<float> final_centroid(dimension);
            compute_final_centroid(labels[i], final_centroid.data());
            faiss::fvec_madd(dimension, residuals + i * dimension, 1.0, final_centroid.data(), x + i * dimension);
        }
    }
void VQ_quantizer :: recover_residual_group_id ( size_t n , const idx_t * labels , const float * residuals , float * x ) { #pragma  omp parallel for for ( size_t i = 0 ; i < n ; i ++ ) { std :: vector < float > final_centroid ( dimension ) ; compute_final_centroid ( labels [ i ] , final_centroid . data ( ) ) ; faiss :: fvec_madd ( dimension , residuals + i * dimension , 1.0 , final_centroid . data ( ) , x + i * dimension ) ; } }
This is for recover data point with residual and the centroid
This is for recover data point with residual and the centroid