MetricKnn API
Fast Similarity Search using the Metric Space Approach
|
MetricKnn provides a set of pre-defined indexes. More...
#include <mknn_predefined_index.hpp>
Static Public Member Functions | |
Help functions. | |
static void | helpListIndexes () |
Lists to standard output all pre-defined indexes. | |
static void | helpPrintIndex (std::string id_index) |
Prints to standard output the help for a index. More... | |
static bool | testIndexId (std::string id_index) |
Tests whether the given string references a valid pre-defined index. More... | |
Linear Scan. | |
static IndexParams | LinearScan_indexParams () |
Resolves searches using the linear scan algorithm. More... | |
static ResolverParams | LinearScan_resolverExactNearestNeighbors (long long knn, double range, long long max_threads) |
Creates a new resolver for exact search of the K nearest neighbors using the linear scan index. More... | |
static ResolverParams | LinearScan_resolverExactFarthestNeighbors (long long knn, long long max_threads) |
Creates a new resolver for exact search of the K farthest neighbors using the linear scan index. More... | |
LAESA. | |
static IndexParams | Laesa_indexParams (long long num_pivots) |
Resolves searches using the LAESA algorithm. More... | |
static ResolverParams | Laesa_resolverExactNearestNeighbors (long long knn, double range, long long max_threads) |
Creates a new resolver for exact search using the LAESA index. More... | |
static ResolverParams | Laesa_resolverApproximateNearestNeighbors (long long knn, double range, long long max_threads, double approximation_percentage) |
Snake Table. | |
static IndexParams | SnakeTable_indexParams (long long num_pivots) |
Resolves searches using a Snake Table. More... | |
static ResolverParams | SnakeTable_resolverExactNearestNeighbors (long long knn, double range, long long max_threads) |
Creates a new resolver for exact search using the SnakeTable index. More... | |
FLANN Indexes. | |
static IndexParams | FlannLinearScan_indexParams () |
Resolves searches using the FLANN's implementation of linear scan algorithm. More... | |
static IndexParams | FlannKdTree_indexParams (long long num_trees) |
Resolves searches using FLANN's implementation of kd-tree. More... | |
static IndexParams | FlannKmeansTree_indexParams (long long branching, long long iterations) |
Resolves searches using FLANN's implementation of k-means tree. More... | |
static IndexParams | FlannLSH_indexParams (long long table_number, long long key_size, long long multi_probe_level) |
Resolves searches using FLANN's implementation of Local Sensitive Hashing. More... | |
static IndexParams | 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... | |
static ResolverParams | Flann_resolverExactNearestNeighbors (long long knn, long long max_threads) |
Creates a new resolver for exact searches using FLANN's indexes. More... | |
static ResolverParams | Flann_resolverApproximateNearestNeighbors (long long knn, long long max_threads, long long num_checks) |
Creates a new resolver for approximate searches using FLANN's indexes. More... | |
MetricKnn provides a set of pre-defined indexes.
The complete list of pre-defined indexes provided by MetricKnn can be printed by calling PredefIndex::helpListIndexes. The parameters supported by each index can be printed by calling PredefIndex::helpPrintIndex.
|
static |
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. |
|
static |
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. |
|
static |
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 |
|
static |
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. |
|
static |
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. |
|
static |
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/ .
|
static |
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 |
|
static |
Prints to standard output the help for a index.
id_index | the unique identifier of a pre-defined index. |
|
static |
Resolves searches using the LAESA algorithm.
In order to obtain the exact nearest neighbors, the distance dist_factory
must satisfy the metric properties, otherwise the exact search will be incorrect.
num_pivots | Amount of pivots to compute and store in memory. |
|
static |
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. |
|
static |
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. |
|
static |
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.
|
static |
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. |
|
static |
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 mean maximum range. |
max_threads | the maximum number of threads to be used. |
|
static |
Resolves searches using a Snake Table.
In order to obtain the exact nearest neighbors, the distance dist_factory
must satisfy the metric properties, otherwise the exact search will be incorrect.
num_pivots | Amount of pivots to store in memory. |
|
static |
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. |
|
static |
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.