krl_L2sqr_by_idx
Interface Definition
int krl_L2sqr_by_idx(float* dis, const float* x, const float* y, const int64_t* ids, size_t d, size_t ny, size_t dis_size);
Function
Performs one-to-many Euclidean distance computation on vectors represented in float precision.
Parameters
Parameter |
Data Type |
Description |
Value Range |
|---|---|---|---|
dis |
float* |
Stores the distance computation result. |
The size is specified by dis_size. The memory needs to be allocated in advance. |
x |
const float* |
Query vector for distance computation. |
The vector has a dimension of d. |
y |
const float* |
Base vector for distance computation. |
The size is specified by d × ny. |
ids |
const int64_t* |
IDs of base vectors. |
The ID value is greater than or equal to 0 and less than the total number of base vectors. |
d |
size_t |
Vector dimension. |
[1, 65535] |
ny |
size_t |
The number of base vectors. |
[1, 2^30 – 1] |
dis_size |
size_t |
Size of the distance result array. |
The value is specified by ny. |
Return Values
Data Type |
Description |
|---|---|
int |
0 is returned on successful execution. In case of failure, an error code is returned to indicate the specific issue: |