GetPQDistanceTableAdc
API Definition
int GetPQDistanceTableAdc(float* vector, const PQParams *params, float *pqDistanceTable, size_t pqDistanceTable_size);
Function
Calculate the PQ ADC distance table, that is, calculate the distance between the query vector and the cluster centroids in each subspace.
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
vector |
float* |
Original vector. |
The value cannot be null. |
pqDistanceTable |
float* |
ADC distance table. It can also be used as an output value. |
The value cannot be null. The value is specified by pqDistanceTable_size. |
pqDistanceTable_size |
size_t |
Length of the ADC distance table array. |
The value is specified by pqM × pqKsub × pqKsub, where pqM and pqKsub are fields in the PQParams structure, respectively indicating the number of subspaces and the number of cluster centroids in these subspaces. |
params |
const PQParams |
For details, see the description of PQParams in Structure Description. |
|
Return Value
Data Type |
Description |
|---|---|
int |
The value 0 is returned when the system runs properly, and the value −1 is returned when the system exits abnormally. |