CallmeNezha/SimpleDBSCAN

Specify my own dist_function

Closed this issue · 1 comments

Hi, thanks for ur nice work! it works well, and could u please tell me how to specify my own distance function?

It have been defined in dbscan.h and described in the code comment that DistanceFunc = std::function<Float(const T&, const T&)>; is your customized distance function.

All you need is to define a normal Cpp function that takes in two data points and returns with a float number. And assign it to disfunc as parameter in the DBSCAN.Run method.