예제 #1
0
 /**
  * Add the point <code>p</code> to the cluster and expand the cluster using the neighbors of
  * MatchPoint <code>p</code>
  *
  * @param p the MatchPoint to expand upon
  * @param clust
  */
 private void expandClusters(MatchPoint p, Set<MatchPoint> clust) {
   clust.add(p);
   p.setAssigned();
   Vector<MatchPoint> neighbors = new Vector<MatchPoint>(p.getNeighbors());
   int i = 0;
   while (i < neighbors.size()) {
     MatchPoint tmp = neighbors.get(i);
     if (!tmp.isVisited()) {
       tmp.setVisited();
       if (tmp.size() >= MIN_PTS) neighbors.addAll(tmp.getNeighbors());
     }
     if (!tmp.isAssigned()) {
       clust.add(tmp);
       tmp.setAssigned();
     }
     i++;
   }
 }