-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and improve median searching in lmeds
- If there are NaN values in distances, sorting does not work. So move all NaN value to the end and continue with the valid sub range. erase-ing them could also be an option, but that might be slower. - When searching for the median, it is much faster to use nth_element instead of sort-ing the entire array. My benchmarks suggest that this can make computeModel 4 times faster
- Loading branch information
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters