SetNTotal

API Definition

virtual APP_ERROR SetNTotal(int n) = 0

Function

Adjusts the ntotal value externally.

Each time the base library vector is added, the index updates the ntotal value based on the maximum inserted subscript index, but does not record the invalid space in the range of [0, ntotal]. As a result, the RemoveFeatures operation does not change the value of ntotal. If the position of the maximum base library index after the base library is added or deleted is recorded externally, users can manually set ntotal to reduce the operator computing workload within a controllable range, thereby improving the API performance.

For example, if 100 vectors are inserted and the base library indexes range from 0 to 99, ntotal is 100. When the base libraries whose indexes range from 80 to 90 are deleted, the internal ntotal of the index remains unchanged and its value is in the range of [ntotal, capacity]. When the base libraries whose indexes range from 90 to 99 are deleted, users can manually set ntotal to a value in the range of [80, capacity]. If ntotal is set to 80, the number of base libraries to be compared is reduced by 20.

Input

int n: maximum index of the base library managed by the user on the service plane plus 1.

Output

N/A

Return Value

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

Restrictions

The input parameters must meet the requirements of the implementation class of this class