clusters
clusters copied to clipboard
fix dbscan waitgroup panic when multiple workers are used
Hi, I hope this message finds you well.
I'm raising this PR to fix negative wait group value when DBSCAN is utilising multiple threads.
Issue: The division used to calculate c.f takes the floor of the integer value, which may result in the "nearest" function creating more rangeJobs than the number of workers. Consequently, this causes more calls to WaitGroup.Done than WaitGroup.Add, leading to a negative wait group value.
Solution: Modify the calculation to use the ceiling of the integer value for c.f.
Thank you for your time.