AddFeatures

API definition

APP_ERROR AddFeatures(int n, const float *features, const uint32_t *indices);

Function

Inserts n feature vectors with specified indexes into the feature database and modifies a feature vector if it already exists.

Input

int n: number of feature vectors to be inserted.

const float *feature: feature vectors to be inserted. The length is n × dim (vector dimension).

const uint32_t *indices: index corresponding to the feature vector to be inserted. The valid length is n.

Output

N/A

Return value

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

Restrictions

  • indices: The index of each feature must range from [0, capacity) and must be consecutive.
  • n: The value range is (0, capacity].
  • features and indices must be non-null pointers and their lengths must meet the requirements. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.

API definition

APP_ERROR AddFeatures(int n, const uint16_t *features, const int64_t *indices);

Function

Inserts n feature vectors with specified indexes into the feature database and modifies a feature vector if it already exists.

Input

int n: number of feature vectors to be inserted.

const uint16_t *features: feature vectors to be inserted. The length is n × dim (vector dimension).

const int64_t *indices: index corresponding to the feature vector to be inserted. The valid length is n.

Output

N/A

Return value

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

Restrictions

  • indices: The range of each feature index is [0, capacity).
  • n: The value range is (0, capacity].
  • features and indices must be non-null pointers and their lengths must meet the requirements. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.