GetBaseByRange

API definition

APP_ERROR GetBaseByRange(uint32_t offset, uint32_t num, int64_t *labels, void *features, FeatureAttr *attributes);

Function

Queries base vectors by range.

Input

uint32_t offset: initial offset of features.

uint32_t num: number of features.

Output

int64_t *labels: feature label.

void *features: features. The Hamming distance requires data of the uint8_t type, Int8Flat requires data of the int8_t type, and FP16Flat requires data of the float type.

FeatureAttr *attributes: feature attribute.

Return value

APP_ERROR: return status. For details, see Return Code Reference.

Restrictions

  • 0< offset ≤8.0e8
  • 0< num ≤8.0e8
  • offset+num ≤ ntotal
  • The length of labels must be num. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • The length of features must be num × dim (vector dimension). Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • The length of attributes must be num. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.