mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
Merge pull request #11222 from lopespt:add_binary_search_knearest
This commit is contained in:
commit
f93c1b942a
@ -240,20 +240,7 @@ public:
|
||||
else
|
||||
{
|
||||
float* rp = rbuf + testidx*k;
|
||||
for( j = k-1; j > 0; j-- )
|
||||
{
|
||||
bool swap_fl = false;
|
||||
for( i = 0; i < j; i++ )
|
||||
{
|
||||
if( rp[i] > rp[i+1] )
|
||||
{
|
||||
std::swap(rp[i], rp[i+1]);
|
||||
swap_fl = true;
|
||||
}
|
||||
}
|
||||
if( !swap_fl )
|
||||
break;
|
||||
}
|
||||
std::sort(rp, rp+k);
|
||||
|
||||
result = rp[0];
|
||||
int prev_start = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user