-
Notifications
You must be signed in to change notification settings - Fork 114
Cpp Quick Reference
Construct the index object for the index specified with the NGT::Property.
property
Specify the index properties.
Open the specified index.
indexPath
Specify an existing index path.
Append the specified object at the end of the index repository. Not build the index for the object. The function createIndex() below should be called to build the index after appending objects with this function. Float, double and uint8_t are available for the TYPE.
Returns
ID for the appended object.
Insert the specified object into the index repository. Not build the index for the object. The function createIndex() below should be called to build the index after inserting objects with this function. Float, double and uint8_t are available for the TYPE.
Returns
ID for the inserted object.
Build the index for the objects that have been inserted by using the function insert.
numThreads
Specify the number of threads to build the index.
Save the index.
indexPath
Specify the path of the created index to be saved.
Search the nearest objects with the specified query.
searchQuery
Specify a query to search.
Define the index property.
int dimension
The dimensionality of the inserted object.
int16_t edgeSizeForCreation
The initial number of edges for each node.
DistanceType distanceType
The distance function for the objects.
- DistanceTypeL1: L1 distance
- DistanceTypeL2: L2 distance (default)
- DistanceTypeAngle: Angle distance
- DistanceTypeNormalizedAngle: Normalized angle distance. The specified data are automatically normalized to be appended to the index.
- DistanceTypeCosine: Cosine similarity
- DistanceTypeNormalizedCosine: Normalized cosine similarity. The specified data are automatically normalized to be appended to the index.
- DistanceTypeHamming: Hamming distance
- DistanceTypeJaccard: Jaccard distance
ObjectSpace::ObjectType objectType
The data type of the objects.
- Float: 4 byte floating point number
- Uint8: 1 byte unsigned integer
Define the search query to search.
Construct the search query object including the specified query object.
query
Specify the query. Float, double and uint8_t are available for TYPE.
Specify an object that is stored search results.
Specify the number of resultant search objects.
Specify epsilon that defines an explored search range.
A pair of an object ID and a distance to a query.
uint32_t id
float distance
A vector container of object IDs with distances. This class inherits vector<ObjectDistance>.
Construct an optimized graph from the specified graph.
numOfOutgoingEdges
The number of outgoing edges for each node of an optimized graph.
numOfIncomingEdges
The number of incoming edges for each node of an optimized graph.
Construct an optimized graph from the specified graph.
optimizedGraph
Specify the path of the optimized graph to be saved.
inputGraph
Specify the path of the existing graph.
Command line tool
Python
C++