Skip to content

Commit ae83814

Browse files
committed
throw exception when using FLANN + max_dist (produces incorrect results)
1 parent 524c60f commit ae83814

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pygsp/graphs/nngraphs/nngraph.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def _knn_sp_kdtree(X, num_neighbors, dist_type, order=0):
4545

4646
def _knn_flann(X, num_neighbors, dist_type, order):
4747
pfl = _import_pfl()
48+
# the combination FLANN + max_dist produces incorrect results
49+
# do not allow it
50+
if dist_type == 'max_dist':
51+
raise ValueError('FLANN and max_dist is not supported')
4852
pfl.set_distance_type(dist_type, order=order)
4953
flann = pfl.FLANN()
5054

0 commit comments

Comments
 (0)