private double[][] computeLookupADC(double[] queryVector) {
		double[][] distances = new double[numSubVectors][numProductCentroids];

		for (int i = 0; i < numSubVectors; i++) {
			int subvectorStart = i * subVectorLength;
			for (int j = 0; j < numProductCentroids; j++) {
				for (int k = 0; k < subVectorLength; k++) {
					distances[i][j] += (queryVector[subvectorStart + k] - productQuantizer[i][j][k])
							* (queryVector[subvectorStart + k] - productQuantizer[i][j][k]);
				}
			}
		}
		return distances;
	}
private double [ ] [ ] computeLookupADC ( double [ ] queryVector ) { double [ ] [ ] distances = new double [ numSubVectors ] [ numProductCentroids ] ; for ( int i = 0 ; i < numSubVectors ; i ++ ) { int subvectorStart = i * subVectorLength ; for ( int j = 0 ; j < numProductCentroids ; j ++ ) { for ( int k = 0 ; k < subVectorLength ; k ++ ) { distances [ i ] [ j ] += ( queryVector [ subvectorStart + k ] - productQuantizer [ i ] [ j ] [ k ] ) * ( queryVector [ subvectorStart + k ] - productQuantizer [ i ] [ j ] [ k ] ) ; } } } return distances ; }
Takes a (residual) query vector as input and returns a lookup table containing the distance between
each sub-vector from each centroid of the corresponding sub-quantizer. The calculation of this look-up
table requires numSubVectors*numProductCentroids*subVectorLength multiplications. After this
calculation, the distance between the query and any vector in the database can be computed in constant
time.

@param qVector
The (residual) query vector
@return A lookup table of size numSubVectors * numProductCentroids with the distance of each sub-vector
from the centroids of each sub-quantizer