Skip to content

Commit 466c8e9

Browse files
committed
Added get_distance_type and get_distance_order methods to the C API to
assist in debugging set_distance_type in the Ruby API.
1 parent 6eeff99 commit 466c8e9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/cpp/flann/flann.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ void flann_set_distance_type(flann_distance_t distance_type, int order)
191191
}
192192

193193

194+
flann_distance_t flann_get_distance_type() {
195+
return flann_distance_type;
196+
}
197+
198+
int flann_get_distance_order() {
199+
return flann_distance_order;
200+
}
201+
202+
194203
template<typename Distance>
195204
flann_index_t __flann_build_index(typename Distance::ElementType* dataset, int rows, int cols, float* speedup,
196205
FLANNParameters* flann_params, Distance d = Distance())

src/cpp/flann/flann.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ FLANN_EXPORT void flann_log_verbosity(int level);
100100
*/
101101
FLANN_EXPORT void flann_set_distance_type(enum flann_distance_t distance_type, int order);
102102

103+
/**
104+
* Gets the distance type in use throughout FLANN.
105+
*/
106+
FLANN_EXPORT enum flann_distance_t flann_get_distance_type();
107+
108+
/**
109+
* Gets the distance order in use throughout FLANN (only applicable if minkowski distance
110+
* is in use).
111+
*/
112+
FLANN_EXPORT int flann_get_distance_order();
103113

104114
/**
105115
Builds and returns an index. It uses autotuning if the target_precision field of index_params

0 commit comments

Comments
 (0)