我要评分
获取效率
正确性
完整性
易理解

Structure Description

The parameters used by the KVecTurbo APIs involve the VectorArray and PQParams structures. For details, see Table 1 and Table 2.

Table 1 VectorArray field description

Field

Description

Data Type

Value Range

maxLen

Maximum number of vectors.

int

If the value is too large, the memory allocation may fail due to insufficient system memory resources.

length

Number of vectors.

int

[1, maxLen], where maxLen is a field in the VectorArray structure, indicating the maximum number of vectors.

dim

Vector dimension.

int

[1,2000]

itemSize

Length of a single vector.

size_t

The value cannot be 0.

items

Start addresses of length vectors.

char*

The value cannot be null.

Table 2 PQParams field description

Field

Description

Data Type

Value Range

dim

Dimension.

int

[1,2000]

pqM

Number of subspaces.

int

[1, dim], where dim is a field in the PQParams structure, indicating the vector dimension.

pqKsub

Number of cluster centroids in the subspace.

int

[1,256]

functype

Distance type.

int

[1,3]

  • 1: L2 type.
  • 2: IP type.
  • 3: Cosine type.

subItemSize

Codeword size.

size_t

The value cannot be 0.

pqTable

Codebook.

char*

The value cannot be null.