-
Notifications
You must be signed in to change notification settings - Fork 116
Cpp Quick Reference
Construct the Index object and open the specified index.
indexPath
Specify an existing index path.
readOnly
Specify if read only mode or not. Read only mode can reduce the search times.
Create an empty index specified with the NGT::Property.
indexPath
Specify an index path where the empty index is created.
property
Specify the index properties.
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.
Disable logging to the standard error.
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 object. 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 the epsilon value that defines an explored search range. The default value is 0.1.
Specify the expected accuracy value. When the expected accuracy value is specified, the epsilon converted from the expected accuracy with the accuracy table will be used, instead of the epsilon that is specified with setEpsilon(). This accuracy table is generated by GraphOptimizer::execute.
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 the GraphOptimizer object to optimize a graph.
logDisabled
Standard error logging is disabled when true is set.
Specify the parameters to reconstruct and optimize a graph for execute().
outgoing
Specify the number of outgoing edges to build an ONNG.
incoming
Specify the number of incoming edges to build an ONNG.
noOfQueries
Specify the number of queries to be used for the optimization.
noOfResultantObjects
Specify the number of resultant objects for search. the number which will be specified for search after this optimization should be specified.
void setProcessingModes(bool shortcut, bool searchParameter, bool prefetchParameter, bool accuracyTable)
Specify the processingModes for execute().
shortcut
When true is set, the shortcut reduction is executed by execute().
searchparameter
When true is set, the search parameter optimization is executed by execute().
prefetchParameter
When true is set, the prefetch parameter optimization is executed by execute().
accuracyTable
When true is set, the accuracy table generation is executed by execute().
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++