diff --git a/src/db/db/dbHierNetworkProcessor.cc b/src/db/db/dbHierNetworkProcessor.cc index f3db932aa..b424ed4cd 100644 --- a/src/db/db/dbHierNetworkProcessor.cc +++ b/src/db/db/dbHierNetworkProcessor.cc @@ -740,7 +740,6 @@ private: hier_clusters *mp_tree; const cell_clusters_box_converter *mp_cbc; const db::Connectivity *mp_conn; - connector_map m_connectors; std::map *> m_cm2join_map; std::list > m_cm2join_sets; @@ -846,31 +845,29 @@ private: ClusterInstance k1 = make_path (i->id (), p1); ClusterInstance k2 = make_path (j->id (), p2); - typename connector_map::iterator x1 = m_connectors.find (k1); - typename connector_map::iterator x2 = m_connectors.find (k2); + id_type x1 = mp_cell_clusters->find_cluster_with_connection (k1); + id_type x2 = mp_cell_clusters->find_cluster_with_connection (k2); - if (x1 == m_connectors.end ()) { + if (x1 == 0) { - if (x2 == m_connectors.end ()) { + if (x2 == 0) { id_type connector = mp_cell_clusters->insert_dummy (); - m_connectors [k1] = connector; mp_cell_clusters->add_connection (connector, k1); mp_cell_clusters->add_connection (connector, k2); } else { - mp_cell_clusters->add_connection (x2->second, k1); + mp_cell_clusters->add_connection (x2, k1); } - } else if (x2 == m_connectors.end ()) { + } else if (x2 == 0) { - mp_cell_clusters->add_connection (x1->second, k2); + mp_cell_clusters->add_connection (x1, k2); - } else if (x1->second != x2->second) { + } else if (x1 != x2) { - mp_cell_clusters->join_cluster_with (x1->second, x2->second); - mp_cell_clusters->remove_cluster (x2->second); - x2->second = x1->second; + mp_cell_clusters->join_cluster_with (x1, x2); + mp_cell_clusters->remove_cluster (x2); } diff --git a/src/db/db/dbHierNetworkProcessor.h b/src/db/db/dbHierNetworkProcessor.h index 69918db97..1c57b9513 100644 --- a/src/db/db/dbHierNetworkProcessor.h +++ b/src/db/db/dbHierNetworkProcessor.h @@ -342,6 +342,12 @@ public: // .. nothing yet .. } + ClusterInstance () + : m_id (0), m_inst () + { + // .. nothing yet .. + } + /** * @brief Gets the cluster ID */ diff --git a/src/db/unit_tests/dbHierNetworkProcessorTests.cc b/src/db/unit_tests/dbHierNetworkProcessorTests.cc index 6ed5f38ad..fab9c5d49 100644 --- a/src/db/unit_tests/dbHierNetworkProcessorTests.cc +++ b/src/db/unit_tests/dbHierNetworkProcessorTests.cc @@ -585,3 +585,18 @@ TEST(48_HierClusters) { run_hc_test (_this, "hc_test_l8.gds", "hc_test_au8.gds"); } + +TEST(49_HierClusters) +{ + run_hc_test (_this, "hc_test_l9.gds", "hc_test_au9.gds"); +} + +TEST(50_HierClusters) +{ + run_hc_test (_this, "hc_test_l10.gds", "hc_test_au10.gds"); +} + +TEST(51_HierClusters) +{ + run_hc_test (_this, "hc_test_l11.gds", "hc_test_au11.gds"); +} diff --git a/testdata/algo/hc_test_au10.gds b/testdata/algo/hc_test_au10.gds new file mode 100644 index 000000000..d7c92fb93 Binary files /dev/null and b/testdata/algo/hc_test_au10.gds differ diff --git a/testdata/algo/hc_test_au11.gds b/testdata/algo/hc_test_au11.gds new file mode 100644 index 000000000..9552f7549 Binary files /dev/null and b/testdata/algo/hc_test_au11.gds differ diff --git a/testdata/algo/hc_test_au9.gds b/testdata/algo/hc_test_au9.gds new file mode 100644 index 000000000..16ac993e5 Binary files /dev/null and b/testdata/algo/hc_test_au9.gds differ diff --git a/testdata/algo/hc_test_l10.gds b/testdata/algo/hc_test_l10.gds new file mode 100644 index 000000000..b4906fc32 Binary files /dev/null and b/testdata/algo/hc_test_l10.gds differ diff --git a/testdata/algo/hc_test_l11.gds b/testdata/algo/hc_test_l11.gds new file mode 100644 index 000000000..21037004c Binary files /dev/null and b/testdata/algo/hc_test_l11.gds differ diff --git a/testdata/algo/hc_test_l9.gds b/testdata/algo/hc_test_l9.gds new file mode 100644 index 000000000..ebbf2798e Binary files /dev/null and b/testdata/algo/hc_test_l9.gds differ