|
MetricKnn API
Fast Similarity Search using the Metric Space Approach
|
MetricKnn provides a set of pre-defined indexes identified. More...
#include "../metricknn_c.h"Go to the source code of this file.
Functions | |
Help functions. | |
| void | mknn_predefIndex_helpListIndexes () |
| Lists to standard output all pre-defined indexes. | |
| void | mknn_predefIndex_helpPrintIndex (const char *id_index) |
| Prints to standard output the help for a index. More... | |
| bool | mknn_predefIndex_testIndexId (const char *id_index) |
| Tests whether the given string references a valid pre-defined index. More... | |
Linear Scan. | |
| MknnIndexParams * | mknn_predefIndex_LinearScan_indexParams () |
| Resolves searches using the linear scan algorithm. More... | |
| MknnResolverParams * | mknn_predefIndex_LinearScan_resolverExactNearestNeighbors (int64_t knn, double range, int64_t max_threads) |
| Creates a new resolver for exact search of the K nearest neighbors using the linear scan index. More... | |
| MknnResolverParams * | mknn_predefIndex_LinearScan_resolverExactFarthestNeighbors (int64_t knn, int64_t max_threads) |
| Creates a new resolver for exact search of the K farthest neighbors using the linear scan index. More... | |
LAESA. | |
| MknnIndexParams * | mknn_predefIndex_Laesa_indexParams (int64_t num_pivots) |
| Resolves searches using the LAESA algorithm. More... | |
| MknnResolverParams * | mknn_predefIndex_Laesa_resolverExactNearestNeighbors (int64_t knn, double range, int64_t max_threads) |
| Creates a new resolver for exact search using the LAESA index. More... | |
| MknnResolverParams * | mknn_predefIndex_Laesa_resolverApproximateNearestNeighbors (int64_t knn, double range, int64_t max_threads, double approximation_percentage) |
Snake Table. | |
| MknnIndexParams * | mknn_predefIndex_SnakeTable_indexParams (int64_t num_pivots) |
| Resolves searches using a Snake Table. More... | |
| MknnResolverParams * | mknn_predefIndex_SnakeTable_resolverExactNearestNeighbors (int64_t knn, double range, int64_t max_threads) |
| Creates a new resolver for exact search using the SnakeTable index. More... | |
FLANN Indexes. | |
| MknnIndexParams * | mknn_predefIndex_FlannLinearScan_indexParams () |
| Resolves searches using the FLANN's implementation of linear scan algorithm. More... | |
| MknnIndexParams * | mknn_predefIndex_FlannKdTree_indexParams (int64_t num_trees) |
| Resolves searches using FLANN's implementation of kd-tree. More... | |
| MknnIndexParams * | mknn_predefIndex_FlannKmeansTree_indexParams (int64_t branching, int64_t iterations) |
| Resolves searches using FLANN's implementation of k-means tree. More... | |
| MknnIndexParams * | mknn_predefIndex_FlannLSH_indexParams (int64_t table_number, int64_t key_size, int64_t multi_probe_level) |
| Resolves searches using FLANN's implementation of Local Sensitive Hashing. More... | |
| MknnIndexParams * | mknn_predefIndex_FlannAutoIndex_indexParams (double target_precision, double build_weight, double memory_weight, double sample_fraction) |
| Resolves searches using FLANN's automatic selection of the best algorithm. More... | |
| MknnResolverParams * | mknn_predefIndex_Flann_resolverExactNearestNeighbors (int64_t knn, int64_t max_threads) |
| Creates a new resolver for exact searches using FLANN's indexes. More... | |
| MknnResolverParams * | mknn_predefIndex_Flann_resolverApproximateNearestNeighbors (int64_t knn, int64_t max_threads, int64_t num_checks) |
| Creates a new resolver for approximate searches using FLANN's indexes. More... | |
MetricKnn provides a set of pre-defined indexes identified.
The complete list of pre-defined indexes provided by MetricKnn can be printed by calling mknn_predefIndex_helpListIndexes. The parameters supported by each index can be printed by calling mknn_predefIndex_helpPrintIndex.
| MknnResolverParams* mknn_predefIndex_Flann_resolverApproximateNearestNeighbors | ( | int64_t | knn, |
| int64_t | max_threads, | ||
| int64_t | num_checks | ||
| ) |
Creates a new resolver for approximate searches using FLANN's indexes.
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| max_threads | the maximum number of threads to be used. |
| num_checks | how many leafs to check in one search. A value >= 1, where a value closer to 1 means faster (but lower quality) search. |
| MknnResolverParams* mknn_predefIndex_Flann_resolverExactNearestNeighbors | ( | int64_t | knn, |
| int64_t | max_threads | ||
| ) |
Creates a new resolver for exact searches using FLANN's indexes.
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| max_threads | the maximum number of threads to be used. |
| MknnIndexParams* mknn_predefIndex_FlannAutoIndex_indexParams | ( | double | target_precision, |
| double | build_weight, | ||
| double | memory_weight, | ||
| double | sample_fraction | ||
| ) |
Resolves searches using FLANN's automatic selection of the best algorithm.
This method is just an interface to FLANN library. See FLANN's documentation http://www.cs.ubc.ca/research/flann/ .
| target_precision | precision desired |
| build_weight | build tree time weighting factor |
| memory_weight | index memory weigthing factor |
| sample_fraction | what fraction of the dataset to use for autotuning |
| MknnIndexParams* mknn_predefIndex_FlannKdTree_indexParams | ( | int64_t | num_trees | ) |
Resolves searches using FLANN's implementation of kd-tree.
This method is just an interface to FLANN library. See FLANN's documentation http://www.cs.ubc.ca/research/flann/ .
| num_trees | Amount of trees to build. |
| MknnIndexParams* mknn_predefIndex_FlannKmeansTree_indexParams | ( | int64_t | branching, |
| int64_t | iterations | ||
| ) |
Resolves searches using FLANN's implementation of k-means tree.
This method is just an interface to FLANN library. See FLANN's documentation http://www.cs.ubc.ca/research/flann/ .
| branching | branching factor. Number of centroids at each level. |
| iterations | max iterations to perform in one kmeans clustering. |
| MknnIndexParams* mknn_predefIndex_FlannLinearScan_indexParams | ( | ) |
Resolves searches using the FLANN's implementation of linear scan algorithm.
This method is just an interface to FLANN library. See FLANN's documentation http://www.cs.ubc.ca/research/flann/ .
| MknnIndexParams* mknn_predefIndex_FlannLSH_indexParams | ( | int64_t | table_number, |
| int64_t | key_size, | ||
| int64_t | multi_probe_level | ||
| ) |
Resolves searches using FLANN's implementation of Local Sensitive Hashing.
This method is just an interface to FLANN library. See FLANN's documentation http://www.cs.ubc.ca/research/flann/ .
| table_number | The number of hash tables to use |
| key_size | The length of the key in the hash tables |
| multi_probe_level | Number of levels to use in multi-probe LSH, 0 for standard LSH |
| void mknn_predefIndex_helpPrintIndex | ( | const char * | id_index | ) |
Prints to standard output the help for a index.
| id_index | the unique identifier of a pre-defined index. |
| MknnIndexParams* mknn_predefIndex_Laesa_indexParams | ( | int64_t | num_pivots | ) |
Resolves searches using the LAESA algorithm.
In order to obtain the exact nearest neighbors, the distance distance must satisfy the metric properties, otherwise the exact search will be incorrect.
| num_pivots | Amount of pivots to compute and store in memory. |
| MknnResolverParams* mknn_predefIndex_Laesa_resolverApproximateNearestNeighbors | ( | int64_t | knn, |
| double | range, | ||
| int64_t | max_threads, | ||
| double | approximation_percentage | ||
| ) |
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| range | the search range. A value <= 0 or the constant DBL_MAX mean maximum range. |
| max_threads | the maximum number of threads to be used. |
| approximation_percentage | The amount of distance evaluation to compute. A value between 0 and 1, where a value closer to 0 means faster (but lower quality) search. |
| MknnResolverParams* mknn_predefIndex_Laesa_resolverExactNearestNeighbors | ( | int64_t | knn, |
| double | range, | ||
| int64_t | max_threads | ||
| ) |
Creates a new resolver for exact search using the LAESA index.
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| range | the search range. A value <= 0 or constant DBL_MAX mean maximum range. |
| max_threads | the maximum number of threads to be used. |
| MknnIndexParams* mknn_predefIndex_LinearScan_indexParams | ( | ) |
Resolves searches using the linear scan algorithm.
The algorithm compares each query object to each object in search_dataset sequentially and retrieves the nearest objects.
| MknnResolverParams* mknn_predefIndex_LinearScan_resolverExactFarthestNeighbors | ( | int64_t | knn, |
| int64_t | max_threads | ||
| ) |
Creates a new resolver for exact search of the K farthest neighbors using the linear scan index.
| knn | number of farthest neighbors to return. A value < 1 means 1. |
| max_threads | the maximum number of threads to be used. |
| MknnResolverParams* mknn_predefIndex_LinearScan_resolverExactNearestNeighbors | ( | int64_t | knn, |
| double | range, | ||
| int64_t | max_threads | ||
| ) |
Creates a new resolver for exact search of the K nearest neighbors using the linear scan index.
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| range | the search range. A value <= 0 or constant DBL_MAX (defined in float.h) mean maximum range. |
| max_threads | the maximum number of threads to be used. |
| MknnIndexParams* mknn_predefIndex_SnakeTable_indexParams | ( | int64_t | num_pivots | ) |
Resolves searches using a Snake Table.
In order to obtain the exact nearest neighbors, the distance distance must satisfy the metric properties, otherwise the exact search will be incorrect.
| num_pivots | Amount of pivots to store in memory. |
| MknnResolverParams* mknn_predefIndex_SnakeTable_resolverExactNearestNeighbors | ( | int64_t | knn, |
| double | range, | ||
| int64_t | max_threads | ||
| ) |
Creates a new resolver for exact search using the SnakeTable index.
| knn | number of nearest neighbors to return. A value < 1 means 1. |
| range | the search range. A value <= 0 or constant DBL_MAX mean maximum range. |
| max_threads | the maximum number of threads to be used. |
| bool mknn_predefIndex_testIndexId | ( | const char * | id_index | ) |
Tests whether the given string references a valid pre-defined index.
| id_index | the unique identifier of a pre-defined index. |
id_index corresponds to a pre-defined index, and false otherwise.
1.8.9.1