Namespaces | |
anyimpl | |
lsh | |
serialization | |
Typedefs | |
typedef std::map< std::string, any > | IndexParams |
typedef unsigned char | uchar |
Functions | |
template<typename T > | |
void | addValue (int pos, float val, float *vals, T *point, T *points, int n) |
template<typename T > | |
T * | allocate (size_t count=1) |
template<typename Distance > | |
void | compute_ground_truth (const Matrix< typename Distance::ElementType > &dataset, const Matrix< typename Distance::ElementType > &testset, Matrix< size_t > &matches, int skip=0, Distance d=Distance()) |
template<typename Distance > | |
Distance::ResultType | computeDistanceRaport (const Matrix< typename Distance::ElementType > &inputData, typename Distance::ElementType *target, size_t *neighbors, size_t *groundTruth, int veclen, int n, const Distance &distance) |
int | countCorrectMatches (size_t *neighbors, size_t *groundTruth, int n) |
template<template< typename > class Index, typename Distance , typename T > | |
NNIndex< Distance > * | create_index_ (rtflann::Matrix< T > data, const rtflann::IndexParams ¶ms, const Distance &distance, typename enable_if< valid_combination< Index, Distance, T >::value, void >::type *=0) |
template<template< typename > class Index, typename Distance , typename T > | |
NNIndex< Distance > * | create_index_ (rtflann::Matrix< T > data, const rtflann::IndexParams ¶ms, const Distance &distance, typename disable_if< valid_combination< Index, Distance, T >::value, void >::type *=0) |
template<typename Distance > | |
NNIndex< Distance > * | create_index_by_type (const flann_algorithm_t index_type, const Matrix< typename Distance::ElementType > &dataset, const IndexParams ¶ms, const Distance &distance) |
template<typename Distance > | |
Distance::ResultType | ensureSquareDistance (typename Distance::ResultType dist) |
template<typename Distance > | |
void | find_nearest (const Matrix< typename Distance::ElementType > &dataset, typename Distance::ElementType *query, size_t *matches, size_t nn, size_t skip=0, Distance distance=Distance()) |
size_t | flann_datatype_size (flann_datatype_t type) |
template<typename T > | |
T | get_param (const IndexParams ¶ms, std::string name, const T &default_value) |
template<typename T > | |
T | get_param (const IndexParams ¶ms, std::string name) |
bool | has_param (const IndexParams ¶ms, std::string name) |
template<typename Distance > | |
int | hierarchicalClustering (const Matrix< typename Distance::ElementType > &points, Matrix< typename Distance::ResultType > ¢ers, const KMeansIndexParams ¶ms, Distance d=Distance()) |
IndexHeader | load_header (FILE *stream) |
void | log_verbosity (int level) |
std::ostream & | operator<< (std::ostream &out, const any &any_val) |
template<typename T , typename F > | |
float | optimizeSimplexDownhill (T *points, int n, F func, float *vals=NULL) |
void | print_params (const IndexParams ¶ms) |
void | print_params (const SearchParams ¶ms) |
double | rand_double (double high=1.0, double low=0) |
int | rand_int (int high=RAND_MAX, int low=0) |
template<typename T > | |
Matrix< T > | random_sample (Matrix< T > &srcMatrix, size_t size, bool remove=false) |
template<typename Index > | |
void | save_header (FILE *stream, const Index &index) |
template<typename Index , typename Distance > | |
float | search_with_ground_truth (Index &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< size_t > &matches, int nn, int checks, float &time, typename Distance::ResultType &dist, const Distance &distance, int skipMatches) |
void | seed_random (unsigned int seed) |
template<typename Index , typename Distance > | |
float | test_index_checks (Index &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< size_t > &matches, int checks, float &precision, const Distance &distance, int nn=1, int skipMatches=0) |
template<typename Index , typename Distance > | |
float | test_index_precision (Index &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< size_t > &matches, float precision, int &checks, const Distance &distance, int nn=1, int skipMatches=0) |
template<typename Index , typename Distance > | |
void | test_index_precisions (Index &index, const Matrix< typename Distance::ElementType > &inputData, const Matrix< typename Distance::ElementType > &testData, const Matrix< int > &matches, float *precisions, int precisions_length, const Distance &distance, int nn=1, int skipMatches=0, float maxTime=0) |
Variables | |
const size_t | BLOCKSIZE =8192 |
const size_t | WORDSIZE =16 |
typedef std::map<std::string, any> rtflann::IndexParams |
typedef unsigned char rtflann::uchar |
enum rtflann::tri_type |
void rtflann::addValue | ( | int | pos, |
float | val, | ||
float * | vals, | ||
T * | point, | ||
T * | points, | ||
int | n | ||
) |
Adds val to array vals (and point to array points) and keeping the arrays sorted by vals.
Definition at line 41 of file simplex_downhill.h.
T* rtflann::allocate | ( | size_t | count = 1 | ) |
Allocates (using C's malloc) a generic type T.
Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer
Definition at line 49 of file allocator.h.
void rtflann::compute_ground_truth | ( | const Matrix< typename Distance::ElementType > & | dataset, |
const Matrix< typename Distance::ElementType > & | testset, | ||
Matrix< size_t > & | matches, | ||
int | skip = 0 , |
||
Distance | d = Distance() |
||
) |
Definition at line 87 of file ground_truth.h.
Distance::ResultType rtflann::computeDistanceRaport | ( | const Matrix< typename Distance::ElementType > & | inputData, |
typename Distance::ElementType * | target, | ||
size_t * | neighbors, | ||
size_t * | groundTruth, | ||
int | veclen, | ||
int | n, | ||
const Distance & | distance | ||
) |
Definition at line 64 of file index_testing.h.
|
inline |
Definition at line 48 of file index_testing.h.
|
inline |
Definition at line 129 of file all_indices.h.
|
inline |
Definition at line 136 of file all_indices.h.
|
inline |
#define this symbol before including flann.h to enable GPU search algorithms. But you have to link libflann_cuda then!
Definition at line 144 of file all_indices.h.
Distance::ResultType rtflann::ensureSquareDistance | ( | typename Distance::ResultType | dist | ) |
Definition at line 63 of file center_chooser.h.
void rtflann::find_nearest | ( | const Matrix< typename Distance::ElementType > & | dataset, |
typename Distance::ElementType * | query, | ||
size_t * | matches, | ||
size_t | nn, | ||
size_t | skip = 0 , |
||
Distance | distance = Distance() |
||
) |
Definition at line 42 of file ground_truth.h.
|
inline |
T rtflann::get_param | ( | const IndexParams & | params, |
std::string | name, | ||
const T & | default_value | ||
) |
T rtflann::get_param | ( | const IndexParams & | params, |
std::string | name | ||
) |
|
inline |
int rtflann::hierarchicalClustering | ( | const Matrix< typename Distance::ElementType > & | points, |
Matrix< typename Distance::ResultType > & | centers, | ||
const KMeansIndexParams & | params, | ||
Distance | d = Distance() |
||
) |
Performs a hierarchical clustering of the points passed as argument and then takes a cut in the the clustering tree to return a flat clustering.
[in] | points | Points to be clustered |
centers | The computed cluster centres. Matrix should be preallocated and centers.rows is the number of clusters requested. | |
params | Clustering parameters (The same as for flann::KMeansIndex) | |
d | Distance to be used for clustering (eg: flann::L2) |
|
inline |
|
inline |
|
inline |
float rtflann::optimizeSimplexDownhill | ( | T * | points, |
int | n, | ||
F | func, | ||
float * | vals = NULL |
||
) |
Simplex downhill optimization function. Preconditions: points is a 2D mattrix of size (n+1) x n func is the cost function taking n an array of n params and returning float vals is the cost function in the n+1 simplex points, if NULL it will be computed
Postcondition: returns optimum value and points[0..n] are the optimum parameters
Definition at line 69 of file simplex_downhill.h.
|
inline |
|
inline |
|
inline |
|
inline |
Matrix<T> rtflann::random_sample | ( | Matrix< T > & | srcMatrix, |
size_t | size, | ||
bool | remove = false |
||
) |
Definition at line 40 of file sampling.h.
void rtflann::save_header | ( | FILE * | stream, |
const Index & | index | ||
) |
float rtflann::search_with_ground_truth | ( | Index & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< size_t > & | matches, | ||
int | nn, | ||
int | checks, | ||
float & | time, | ||
typename Distance::ResultType & | dist, | ||
const Distance & | distance, | ||
int | skipMatches | ||
) |
Definition at line 86 of file index_testing.h.
|
inline |
float rtflann::test_index_checks | ( | Index & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< size_t > & | matches, | ||
int | checks, | ||
float & | precision, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 |
||
) |
Definition at line 142 of file index_testing.h.
float rtflann::test_index_precision | ( | Index & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< size_t > & | matches, | ||
float | precision, | ||
int & | checks, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 |
||
) |
Definition at line 159 of file index_testing.h.
void rtflann::test_index_precisions | ( | Index & | index, |
const Matrix< typename Distance::ElementType > & | inputData, | ||
const Matrix< typename Distance::ElementType > & | testData, | ||
const Matrix< int > & | matches, | ||
float * | precisions, | ||
int | precisions_length, | ||
const Distance & | distance, | ||
int | nn = 1 , |
||
int | skipMatches = 0 , |
||
float | maxTime = 0 |
||
) |
Definition at line 232 of file index_testing.h.
const size_t rtflann::BLOCKSIZE =8192 |
Definition at line 73 of file allocator.h.
const size_t rtflann::WORDSIZE =16 |
Pooled storage allocator
The following routines allow for the efficient allocation of storage in small chunks from a specified pool. Rather than allowing each structure to be freed individually, an entire pool of storage is freed at once. This method has two advantages over just using malloc() and free(). First, it is far more efficient for allocating small objects, as there is no overhead for remembering all the information needed to free each object or consolidating fragmented memory. Second, the decision about how long to keep an object is made at the time of allocation, and there is no need to track down all the objects to free them.
Definition at line 72 of file allocator.h.