示例#1
0
    def merge(self, cluster, neighbor, clusters):
      """
      @deprecated!
      """
      newbbox = bounding_box(cluster.bbox, neighbor.bbox)
      cidxs = self.get_intersection(newbbox)
      intersecting_clusters = [clusters[cidx] for cidx in cidxs]
      intersecting_clusters = filter(cluster.discretes_overlap, intersecting_clusters)

      merged = Cluster.merge(cluster, neighbor, intersecting_clusters, self.point_volume)
      if not merged or not merged.volume:
          return None
      
      if self.use_mtuples and cluster.discretes_same(neighbor):
          intersecting_clusters = filter(cluster.discretes_same, intersecting_clusters)
          merged.error = self.influence_from_mtuples(merged, intersecting_clusters)
      else:
          merged.error = self.influence(merged)
      return merged