MetricKnn API
Fast Similarity Search using the Metric Space Approach
List of all members
mknn::PredefIndex Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

static ResolverParams mknn::PredefIndex::Flann_resolverApproximateNearestNeighbors ( long long  knn,
long long  max_threads,
long long  num_checks 
)
static

Creates a new resolver for approximate searches using FLANN's indexes.

Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
max_threadsthe maximum number of threads to be used.
num_checkshow many leafs to check in one search. A value >= 1, where a value closer to 1 means faster (but lower quality) search.
Returns
an object with the configuration of a similarity search.
static ResolverParams mknn::PredefIndex::Flann_resolverExactNearestNeighbors ( long long  knn,
long long  max_threads 
)
static

Creates a new resolver for exact searches using FLANN's indexes.

Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
max_threadsthe maximum number of threads to be used.
Returns
an object with the configuration of a similarity search.
static IndexParams mknn::PredefIndex::FlannAutoIndex_indexParams ( double  target_precision,
double  build_weight,
double  memory_weight,
double  sample_fraction 
)
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/ .

Parameters
target_precisionprecision desired
build_weightbuild tree time weighting factor
memory_weightindex memory weigthing factor
sample_fractionwhat fraction of the dataset to use for autotuning
Returns
the new index (must be released with delete)
static IndexParams mknn::PredefIndex::FlannKdTree_indexParams ( long long  num_trees)
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/ .

Parameters
num_treesAmount of trees to build.
Returns
the new index (must be released with delete)
static IndexParams mknn::PredefIndex::FlannKmeansTree_indexParams ( long long  branching,
long long  iterations 
)
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/ .

Parameters
branchingbranching factor. Number of centroids at each level.
iterationsmax iterations to perform in one kmeans clustering.
Returns
the new index (must be released with delete)
static IndexParams mknn::PredefIndex::FlannLinearScan_indexParams ( )
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/ .

Returns
the new index (must be released with delete)
static IndexParams mknn::PredefIndex::FlannLSH_indexParams ( long long  table_number,
long long  key_size,
long long  multi_probe_level 
)
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/ .

Parameters
table_numberThe number of hash tables to use
key_sizeThe length of the key in the hash tables
multi_probe_levelNumber of levels to use in multi-probe LSH, 0 for standard LSH
Returns
the new index (must be released with delete)
static void mknn::PredefIndex::helpPrintIndex ( std::string  id_index)
static

Prints to standard output the help for a index.

Parameters
id_indexthe unique identifier of a pre-defined index.
static IndexParams mknn::PredefIndex::Laesa_indexParams ( long long  num_pivots)
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.

Parameters
num_pivotsAmount of pivots to compute and store in memory.
Returns
the new index (must be released with delete)
static ResolverParams mknn::PredefIndex::Laesa_resolverApproximateNearestNeighbors ( long long  knn,
double  range,
long long  max_threads,
double  approximation_percentage 
)
static
Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
rangethe search range. A value <= 0 or the constant DBL_MAX mean maximum range.
max_threadsthe maximum number of threads to be used.
approximation_percentageThe amount of distance evaluation to compute. A value between 0 and 1, where a value closer to 0 means faster (but lower quality) search.
Returns
an object with the configuration of a similarity search.
static ResolverParams mknn::PredefIndex::Laesa_resolverExactNearestNeighbors ( long long  knn,
double  range,
long long  max_threads 
)
static

Creates a new resolver for exact search using the LAESA index.

Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
rangethe search range. A value <= 0 or constant DBL_MAX mean maximum range.
max_threadsthe maximum number of threads to be used.
Returns
an object with the configuration of a similarity search.
static IndexParams mknn::PredefIndex::LinearScan_indexParams ( )
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.

Returns
the new index (must be released with delete)
static ResolverParams mknn::PredefIndex::LinearScan_resolverExactFarthestNeighbors ( long long  knn,
long long  max_threads 
)
static

Creates a new resolver for exact search of the K farthest neighbors using the linear scan index.

Parameters
knnnumber of farthest neighbors to return. A value < 1 means 1.
max_threadsthe maximum number of threads to be used.
Returns
an object with the configuration of a similarity search.
static ResolverParams mknn::PredefIndex::LinearScan_resolverExactNearestNeighbors ( long long  knn,
double  range,
long long  max_threads 
)
static

Creates a new resolver for exact search of the K nearest neighbors using the linear scan index.

Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
rangethe search range. A value <= 0 or constant DBL_MAX mean maximum range.
max_threadsthe maximum number of threads to be used.
Returns
an object with the configuration of a similarity search.
static IndexParams mknn::PredefIndex::SnakeTable_indexParams ( long long  num_pivots)
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.

Parameters
num_pivotsAmount of pivots to store in memory.
Returns
the new index (must be released with delete)
static ResolverParams mknn::PredefIndex::SnakeTable_resolverExactNearestNeighbors ( long long  knn,
double  range,
long long  max_threads 
)
static

Creates a new resolver for exact search using the SnakeTable index.

Parameters
knnnumber of nearest neighbors to return. A value < 1 means 1.
rangethe search range. A value <= 0 or constant DBL_MAX mean maximum range.
max_threadsthe maximum number of threads to be used.
Returns
an object with the configuration of a similarity search.
static bool mknn::PredefIndex::testIndexId ( std::string  id_index)
static

Tests whether the given string references a valid pre-defined index.

Parameters
id_indexthe unique identifier of a pre-defined index.
Returns
true whether id_index corresponds to a pre-defined index, and false otherwise.

The documentation for this class was generated from the following file:
Powered by Download MetricKnn