Fixes the new dist_max search

Last (at least, we hope) mod. of getkClosestInSs function.

git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@33 785a6c6c-259e-4ff1-8b91-dc31627914f0
This commit is contained in:
Frédéric Lassabe 2008-05-07 12:15:42 +00:00 committed by Matteo Cypriani
parent b2f613bce5
commit cbe71f0004
1 changed files with 5 additions and 6 deletions

View File

@ -388,16 +388,15 @@ vector<Point> Server::getkClosestInSs(const vector<Measurement> &m, const unsign
for (j = 0 ; j < distances_vector.size() ; j++)
if (distances_vector[j] == dist_max)
{
dist_max = tmp_distance;
/* Old fashion
distances_vector.erase(distances_vector.begin() + j);
points_vector.erase(points_vector.begin() + j);
distances_vector.push_back(tmp_distance);
points_vector.push_back(reference_point_list[i].getCoordinates());*/
distance_vector[j] = tmp_distance;
points_vector[j] = reference_point_list[i].getCoordinates();
break;
}
/* Now seek the new max. distance */
dist_max = distances_vector[0];
for(j = 1 ; j < distances_vector.size() ; j++)
if(distances_vector[j] > dist_max)
dist_max = distances_vector[j];
}
/* Else nothing needs to be done */
}