ComputeVectorPQCode
API Definition
int ComputeVectorPQCode(float *vector, const PQParams *params, unsigned char *pqCode, size_t pqCode_size);
Function
Quantizes the input vector based on the PQ codebook.
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
vector |
float * |
Original vector. |
The value cannot be null. |
pqCode |
unsigned char * |
Quantized vector. It can also be used as an output value. |
The value cannot be null. The value is specified by pqCode_size, the length of the quantized vector array. |
pqCode_size |
size_t |
Length of the quantized vector array. |
The value is specified by pqM, which is a field in the PQParams structure and indicates the number of subspaces. |
params |
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. |