diff --git a/src/db/db/dbHash.h b/src/db/db/dbHash.h index fe6f6b452..5e666df3e 100644 --- a/src/db/db/dbHash.h +++ b/src/db/db/dbHash.h @@ -50,6 +50,11 @@ namespace std { + inline size_t hcombine (size_t h1, size_t h2) + { + return (h1 << 4) ^ (h1 >> 4) ^ h2; + } + template inline size_t hfunc (const T &t) { @@ -57,11 +62,6 @@ namespace std return hf (t); } - inline size_t hcombine (size_t h1, size_t h2) - { - return (h1 << 4) ^ (h1 >> 4) ^ h2; - } - template inline size_t hfunc (const T &t, size_t h) { @@ -82,365 +82,695 @@ namespace std template inline size_t hfunc_coord (C d, size_t h) { - return hcombine (hfunc_coord (d), h); + return hcombine (h, hfunc_coord (d)); } /** * @brief Hash value for a point */ + + template + size_t hfunc (const db::point &o, size_t h) + { + return hfunc_coord (o.x (), hfunc_coord (o.y (), h)); + } + + template + size_t hfunc (const db::point &o) + { + return hfunc_coord (o.x (), hfunc_coord (o.y ())); + } + template struct hash > { size_t operator() (const db::point &o) const { - return hfunc_coord (o.x (), hfunc_coord (o.y ())); + return hfunc (o); } }; /** * @brief Hash value for a vector */ + + template + size_t hfunc (const db::vector &o, size_t h) + { + return hfunc_coord (o.x (), hfunc_coord (o.y (), h)); + } + + template + size_t hfunc (const db::vector &o) + { + return hfunc_coord (o.x (), hfunc_coord (o.y ())); + } + template struct hash > { size_t operator() (const db::vector &o) const { - return hfunc_coord (o.x (), hfunc_coord (o.y ())); + return hfunc (o); } }; /** * @brief Hash value for a box */ + + template + size_t hfunc (const db::box &o, size_t h) + { + return hfunc (o.p1 (), hfunc (o.p2 (), h)); + } + + template + size_t hfunc (const db::box &o) + { + return hfunc (o.p1 (), hfunc (o.p2 ())); + } + template struct hash > { size_t operator() (const db::box &o) const { - return hfunc (o.p1 (), hfunc (o.p2 ())); + return hfunc (o); } }; /** * @brief Hash value for an edge */ + + template + size_t hfunc (const db::edge &o, size_t h) + { + return hfunc (o.p1 (), hfunc (o.p2 (), h)); + } + + template + size_t hfunc (const db::edge &o) + { + return hfunc (o.p1 (), hfunc (o.p2 ())); + } + template struct hash > { size_t operator() (const db::edge &o) const { - return hfunc (o.p1 (), hfunc (o.p2 ())); + return hfunc (o); } }; /** * @brief Hash value for an edge pair */ + + template + size_t hfunc (const db::edge_pair &o, size_t h) + { + return hfunc (o.lesser (), hfunc (o.greater (), hfunc (int (o.is_symmetric ()), h))); + } + + template + size_t hfunc (const db::edge_pair &o) + { + return hfunc (o.lesser (), hfunc (o.greater (), hfunc (int (o.is_symmetric ())))); + } + template struct hash > { size_t operator() (const db::edge_pair &o) const { - return hfunc (o.lesser (), hfunc (o.greater (), hfunc (int (o.is_symmetric ())))); + return hfunc (o); } }; /** * @brief Hash value for a text object */ + + template + size_t hfunc (const db::text &o, size_t h) + { + h = hfunc (int (o.halign ()), h); + h = hfunc (int (o.valign ()), h); + h = hfunc (o.trans ().rot (), h); + h = hfunc (o.trans ().disp (), h); + // NOTE: using std::string for the value makes sure the default hasher doesn't use the pointer value + h = hfunc (hfunc (std::string (o.string ())), h); + return h; + } + + template + size_t hfunc (const db::text &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { size_t operator() (const db::text &o) const { - size_t h = hfunc (int (o.halign ())); - h = hfunc (int (o.valign ()), h); - h = hfunc (o.trans ().rot (), h); - h = hfunc (o.trans ().disp (), h); - // NOTE: using std::string for the value makes sure the default hasher doesn't use the pointer value - h = hfunc (hfunc (std::string (o.string ())), h); - return h; + return hfunc (o); } }; /** * @brief Hash value for a path */ + + template + size_t hfunc (const db::path &o, size_t h) + { + h = hfunc (int (o.round ()), h); + h = hfunc_coord (o.bgn_ext (), h); + h = hfunc_coord (o.end_ext (), h); + h = hfunc_coord (o.width (), h); + for (typename db::path::iterator p = o.begin (); p != o.end (); ++p) { + h = hfunc (*p, h); + } + return h; + } + + template + size_t hfunc (const db::path &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { size_t operator() (const db::path &o) const { - size_t h = hfunc (int (o.round ())); - h = hfunc_coord (o.bgn_ext (), h); - h = hfunc_coord (o.end_ext (), h); - h = hfunc_coord (o.width (), h); - for (typename db::path::iterator p = o.begin (); p != o.end (); ++p) { - h = hfunc (*p, h); - } - return h; + return hfunc (o); } }; /** * @brief Hash value for a polygon contour */ + + template + size_t hfunc (const db::polygon_contour &o, size_t h) + { + for (typename db::polygon_contour::simple_iterator i = o.begin (); i != o.end (); ++i) { + h = hfunc (*i, h); + } + return h; + } + + template + size_t hfunc (const db::polygon_contour &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { - size_t operator() (const db::polygon_contour &o) const + size_t operator() (const db::path &o) const { - size_t h = 0; - for (typename db::polygon_contour::simple_iterator i = o.begin (); i != o.end (); ++i) { - h = hfunc (*i, h); - } - return h; + return hfunc (o); } }; /** * @brief Hash value for a polygon */ + + template + size_t hfunc (const db::polygon &o, size_t h) + { + h = hfunc (o.hull (), h); + for (size_t i = 0; i < o.holes (); ++i) { + h = hfunc (o.hole (int (i)), h); + } + return h; + } + + template + size_t hfunc (const db::polygon &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { size_t operator() (const db::polygon &o) const { - size_t h = hfunc (o.hull ()); - for (size_t i = 0; i < o.holes (); ++i) { - h = hfunc (o.hole (int (i)), h); - } - return h; + return hfunc (o); } }; /** * @brief Hash value for a simple polygon */ + + template + size_t hfunc (const db::simple_polygon &o, size_t h) + { + return hfunc (o.hull (), h); + } + + template + size_t hfunc (const db::simple_polygon &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { size_t operator() (const db::simple_polygon &o) const { - return hfunc (o.hull ()); + return hfunc (o); } }; /** * @brief Hash value for a simple transformation */ + + template + size_t hfunc (const db::simple_trans &t, size_t h) + { + return hfunc (int (t.rot ()), hfunc (t.disp (), h)); + } + + template + size_t hfunc (const db::simple_trans &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { - size_t operator() (const db::simple_trans &t) const + size_t operator() (const db::simple_trans &o) const { - return hfunc (int (t.rot ()), hfunc (t.disp ())); + return hfunc (o); } }; /** * @brief A hash function for a displacement transformation */ + + template + size_t hfunc (const db::disp_trans &t, size_t h) + { + return hfunc (t.disp (), h); + } + + template + size_t hfunc (const db::disp_trans &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { - size_t operator() (const db::disp_trans &t) const + size_t operator() (const db::disp_trans &o) const { - return hfunc (t.disp ()); + return hfunc (o); } }; /** * @brief Hash value for a complex transformation */ + + template + size_t hfunc (const db::complex_trans &t, size_t h) + { + h = hfunc (int64_t (0.5 + t.angle () / db::epsilon), h); + h = hfunc (int64_t (0.5 + t.mag () / db::epsilon), h); + h = hfunc (int (t.is_mirror ()), h); + h = hfunc (t.disp (), h); + return h; + } + + template + size_t hfunc (const db::complex_trans &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > { - size_t operator() (const db::complex_trans &t) const + size_t operator() (const db::complex_trans &o) const { - size_t h = hfunc (int64_t (0.5 + t.angle () / db::epsilon)); - h = hfunc (int64_t (0.5 + t.mag () / db::epsilon), h); - h = hfunc (int (t.is_mirror ()), h); - h = hfunc (t.disp (), h); - return h; + return hfunc (o); } }; /** * @brief A hash value for a db::CellInstArray and db::DCellInstArray */ + + template + size_t hfunc (const db::array > &o, size_t h) + { + h = hfunc (o.object ().cell_index (), h); + + db::vector a, b; + unsigned long na = 1, nb = 1; + if (o.is_regular_array (a, b, na, nb)) { + h = hfunc (a, h); + h = hfunc (b, h); + h = hfunc (na, h); + h = hfunc (nb, h); + } else if (o.size () > 1) { + // iterated array + typename db::array >::iterator i = o.begin (); + while (! (++i).at_end ()) { + h = hfunc (*i, h); + } + } + + if (o.is_complex ()) { + h = hfunc (o.complex_trans (), h); + } else { + h = hfunc (o.front (), h); + } + + return h; + } + + template + size_t hfunc (const db::array > &o) + { + return hfunc (o, size_t (0)); + } + template struct hash > > { size_t operator() (const db::array > &o) const { - size_t h = hfunc (o.object ().cell_index ()); - - db::vector a, b; - unsigned long na = 1, nb = 1; - if (o.is_regular_array (a, b, na, nb)) { - h = hfunc (a, h); - h = hfunc (b, h); - h = hfunc (na, h); - h = hfunc (nb, h); - } else if (o.size () > 1) { - // iterated array - typename db::array >::iterator i = o.begin (); - while (! (++i).at_end ()) { - h = hfunc (*i, h); - } - } - - if (o.is_complex ()) { - h = hfunc (o.complex_trans (), h); - } else { - h = hfunc (o.front (), h); - } - - return h; + return hfunc (o); } }; /** * @brief Hash value for an object with properties */ - template + + template + size_t hfunc (const db::object_with_properties &o, size_t h) + { + return hfunc ((const O &) o, hfunc (o.properties_id (), h)); + } + + template + size_t hfunc (const db::object_with_properties &o) + { + return hfunc ((const O &) o, hfunc (o.properties_id ())); + } + + template struct hash > { size_t operator() (const db::object_with_properties &o) const { - return hfunc ((const O &) o, hfunc (o.properties_id ())); + return hfunc (o); } }; /** * @brief A hash function for a shape reference */ + template - struct hash > + size_t hfunc (const db::shape_ref &o, size_t h) + { + return hfunc (*o.ptr (), hfunc (o.trans (), h)); + } + + template + size_t hfunc (const db::shape_ref &o) + { + return hfunc (*o.ptr (), hfunc (o.trans ())); + } + + template + struct hash > { size_t operator() (const db::shape_ref &o) const { - return hfunc (std::hash () (*o.ptr ()), std::hash () (o.trans ())); + return hfunc (o); } }; /** * @brief A hash function for a polygon reference */ + template - struct hash > + size_t hfunc (const db::polygon_ref &o, size_t h) + { + return hfunc (*o.ptr (), hfunc (o.trans (), h)); + } + + template + size_t hfunc (const db::polygon_ref &o) + { + return hfunc (*o.ptr (), hfunc (o.trans ())); + } + + template + struct hash > { size_t operator() (const db::polygon_ref &o) const { - return std::hash > () (o); + return hfunc (o); } }; /** * @brief A hash function for a path reference */ + template - struct hash > + size_t hfunc (const db::path_ref &o, size_t h) + { + return hfunc (*o.ptr (), hfunc (o.trans (), h)); + } + + template + size_t hfunc (const db::path_ref &o) + { + return hfunc (*o.ptr (), hfunc (o.trans ())); + } + + template + struct hash > { size_t operator() (const db::path_ref &o) const { - return std::hash > () (o); + return hfunc (o); } }; /** * @brief A hash function for a text reference */ + template - struct hash > + size_t hfunc (const db::text_ref &o, size_t h) + { + return hfunc (*o.ptr (), hfunc (o.trans (), h)); + } + + template + size_t hfunc (const db::text_ref &o) + { + return hfunc (*o.ptr (), hfunc (o.trans ())); + } + + template + struct hash > { size_t operator() (const db::text_ref &o) const { - return std::hash > () (o); + return hfunc (o); } }; /** * @brief A hash value for a db::LayerProperties object */ + + inline size_t hfunc (const db::LayerProperties &o, size_t h) + { + if (o.is_named ()) { + return hfunc (o.name, h); + } else { + h = hfunc (o.layer, h); + h = hfunc (o.datatype, h); + h = hfunc (o.name, h); + return h; + } + } + + inline size_t hfunc (const db::LayerProperties &o) + { + return hfunc (o, size_t (0)); + } + template <> struct hash { size_t operator() (const db::LayerProperties &o) const { - if (o.is_named ()) { - return hfunc (o.name); - } else { - size_t h = hfunc (o.layer); - h = hfunc (o.datatype, h); - h = hfunc (o.name, h); - return h; - } + return hfunc (o); } }; /** * @brief Generic hash for a pair of objects */ + + template + size_t hfunc (const std::pair &o, size_t h) + { + return hfunc (o.first, hfunc (o.second, h)); + } + + template + size_t hfunc (const std::pair &o) + { + return hfunc (o.first, hfunc (o.second)); + } + template struct hash > { - size_t operator() (const std::pair &p) const + size_t operator() (const std::pair &o) const { - hash hf1; - hash hf2; - size_t h = hf1 (p.first); - return hfunc (hf2 (p.second), h); + return hfunc (o); } }; /** * @brief Generic hash for an unordered set */ + template - struct hash > + size_t hfunc (const std::unordered_set &o, size_t h) + { + for (typename std::unordered_set::const_iterator i = o.begin (); i != o.end (); ++i) { + h = hfunc (*i, h); + } + return h; + } + + template + size_t hfunc (const std::unordered_set &o) + { + return hfunc (o, size_t (0)); + } + + template + struct hash > { size_t operator() (const std::unordered_set &o) const { - size_t hf = 0; - for (typename std::unordered_set::const_iterator i = o.begin (); i != o.end (); ++i) { - hf = hfunc (hf, std::hash () (*i)); - } - return hf; + return hfunc (o); } }; /** * @brief Generic hash for an ordered set */ + template - struct hash > + size_t hfunc (const std::set &o, size_t h) + { + for (typename std::set::const_iterator i = o.begin (); i != o.end (); ++i) { + h = hfunc (*i, h); + } + return h; + } + + template + size_t hfunc (const std::set &o) + { + return hfunc (o, size_t (0)); + } + + template + struct hash > { size_t operator() (const std::set &o) const { - size_t hf = 0; - for (typename std::set::const_iterator i = o.begin (); i != o.end (); ++i) { - hf = hfunc (hf, std::hash () (*i)); - } - return hf; + return hfunc (o); + } + }; + + /** + * @brief Generic hash for an unordered map + */ + + template + size_t hfunc (const std::unordered_map &o, size_t h) + { + for (typename std::unordered_map::const_iterator i = o.begin (); i != o.end (); ++i) { + h = hfunc (i->first, hfunc (i->second, h)); + } + return h; + } + + template + size_t hfunc (const std::unordered_map &o) + { + return hfunc (o, size_t (0)); + } + + template + struct hash > + { + size_t operator() (const std::unordered_map &o) const + { + return hfunc (o); } }; /** * @brief Generic hash for an ordered map */ + template - struct hash > + size_t hfunc (const std::map &o, size_t h) + { + for (typename std::map::const_iterator i = o.begin (); i != o.end (); ++i) { + h = hfunc (i->first, hfunc (i->second, h)); + } + return h; + } + + template + size_t hfunc (const std::map &o) + { + return hfunc (o, size_t (0)); + } + + template + struct hash > { size_t operator() (const std::map &o) const { - size_t hf = 0; - for (typename std::map::const_iterator i = o.begin (); i != o.end (); ++i) { - hf = hfunc (hf, std::hash () (i->first)); - hf = hfunc (hf, std::hash () (i->second)); - } - return hf; + return hfunc (o); } }; diff --git a/src/db/unit_tests/dbRegionTests.cc b/src/db/unit_tests/dbRegionTests.cc index 8c4a7dd43..00e065041 100644 --- a/src/db/unit_tests/dbRegionTests.cc +++ b/src/db/unit_tests/dbRegionTests.cc @@ -581,11 +581,11 @@ TEST(15d) r.insert (db::Box (db::Point (0, 140), db::Point (350, 160))); EXPECT_EQ (r.space_check (120, db::RegionCheckOptions (false, db::Projection)).to_string (), - "(300,100;350,100)|(350,140;300,140);" "(0,100;100,100)|(100,140;0,140);" - "(0,160;100,160)|(100,200;0,200);" "(300,160;350,160)|(350,200;300,200);" + "(300,100;350,100)|(350,140;300,140);" "(300,100;400,100)|(400,200;300,200);" + "(0,160;100,160)|(100,200;0,200);" "(600,100;700,100)|(700,200;600,200)" ); } @@ -845,17 +845,17 @@ TEST(18a) o.select_inside (rr); EXPECT_EQ (o.to_string (), "(20,30;20,50;40,50;40,30)"); o = r; - EXPECT_EQ (o.selected_not_inside (rr).to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(0,60;0,80;60,80;60,60);(70,60;70,80;90,80;90,60);(0,100;0,130;30,130;30,100)"); + EXPECT_EQ (o.selected_not_inside (rr).to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); EXPECT_EQ (o.selected_inside (rr).count () + o.selected_not_inside (rr).count (), size_t (6)); EXPECT_EQ (o.selected_inside (rr).hier_count () + o.selected_not_inside (rr).hier_count (), size_t (6)); o.select_not_inside (rr); - EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(0,60;0,80;60,80;60,60);(70,60;70,80;90,80;90,60);(0,100;0,130;30,130;30,100)"); + EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); } - EXPECT_EQ (r.selected_interacting (rr).to_string (), "(0,0;0,20;20,20;20,0);(20,30;20,50;40,50;40,30);(50,10;50,30;70,30;70,10);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); + EXPECT_EQ (r.selected_interacting (rr).to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(20,30;20,50;40,50;40,30);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); { db::Region o = r; o.select_interacting (rr); - EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(20,30;20,50;40,50;40,30);(50,10;50,30;70,30;70,10);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); + EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(20,30;20,50;40,50;40,30);(0,60;0,80;60,80;60,60);(0,100;0,130;30,130;30,100)"); o = r; EXPECT_EQ (o.selected_not_interacting (rr).to_string (), "(70,60;70,80;90,80;90,60)"); EXPECT_EQ (o.selected_interacting (rr).count () + o.selected_not_interacting (rr).count (), size_t (6)); @@ -881,11 +881,11 @@ TEST(18a) o.select_enclosing (rr); EXPECT_EQ (o.to_string (), "(0,100;0,130;30,130;30,100)"); o = r; - EXPECT_EQ (o.selected_not_enclosing (rr).to_string (), "(0,0;0,20;20,20;20,0);(20,30;20,50;40,50;40,30);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(0,60;0,80;60,80;60,60)"); + EXPECT_EQ (o.selected_not_enclosing (rr).to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(20,30;20,50;40,50;40,30);(0,60;0,80;60,80;60,60)"); EXPECT_EQ (o.selected_enclosing (rr).count () + o.selected_not_enclosing (rr).count (), size_t (6)); EXPECT_EQ (o.selected_enclosing (rr).hier_count () + o.selected_not_enclosing (rr).hier_count (), size_t (6)); o.select_not_enclosing (rr); - EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(20,30;20,50;40,50;40,30);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(0,60;0,80;60,80;60,60)"); + EXPECT_EQ (o.to_string (), "(0,0;0,20;20,20;20,0);(50,10;50,30;70,30;70,10);(70,60;70,80;90,80;90,60);(20,30;20,50;40,50;40,30);(0,60;0,80;60,80;60,60)"); } } @@ -957,7 +957,7 @@ TEST(18c) EXPECT_EQ (r.selected_outside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_inside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_overlapping (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); - EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(-20,0;-20,20;20,20;20,0);(100,0;100,20;120,20;120,0)"); + EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-20,0;-20,20;20,20;20,0);(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_outside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_not_inside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); @@ -976,7 +976,7 @@ TEST(18c) EXPECT_EQ (r.selected_outside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_inside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_overlapping (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); - EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(-20,0;-20,20;20,20;20,0);(100,0;100,20;120,20;120,0)"); + EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-20,0;-20,20;20,20;20,0);(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_outside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_not_inside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); @@ -994,7 +994,7 @@ TEST(18c) EXPECT_EQ (r.selected_outside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_inside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_overlapping (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); - EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(-20,0;-20,20;20,20;20,0);(100,0;100,20;120,20;120,0)"); + EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-20,0;-20,20;20,20;20,0);(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_outside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); EXPECT_EQ (r.selected_not_inside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); @@ -1013,10 +1013,10 @@ TEST(18c) EXPECT_EQ (r.selected_outside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_inside (rr).to_string (), ""); EXPECT_EQ (r.selected_overlapping (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); - EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(-20,0;-20,20;20,20;20,0);(100,0;100,20;120,20;120,0)"); + EXPECT_EQ (r.selected_interacting (rr).to_string (), "(-20,0;-20,20;20,20;20,0);(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_outside (rr).to_string (), "(-20,0;-20,20;20,20;20,0)"); - EXPECT_EQ (r.selected_not_inside (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(-20,0;-20,20;20,20;20,0);(100,0;100,20;120,20;120,0)"); + EXPECT_EQ (r.selected_not_inside (rr).to_string (), "(-20,0;-20,20;20,20;20,0);(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_overlapping (rr).to_string (), "(-120,0;-120,20;-100,20;-100,0);(100,0;100,20;120,20;120,0)"); EXPECT_EQ (r.selected_not_interacting (rr).to_string (), ""); @@ -1251,7 +1251,7 @@ TEST(20) EXPECT_EQ (r1.has_valid_polygons (), false); db::Region r2 (db::RecursiveShapeIterator (ly, ly.cell (top), l2)); EXPECT_EQ (r2.has_valid_polygons (), false); - EXPECT_EQ (r1.separation_check (r2, 20).to_string (), "(50,0;50,30)/(40,40;40,10);(63,30;80,30)/(97,40;80,40);(80,70;80,40)/(80,40;80,70);(50,40;50,57)/(40,40;40,23)"); + EXPECT_EQ (r1.separation_check (r2, 20).to_string (), "(63,30;80,30)/(97,40;80,40);(50,0;50,30)/(40,40;40,10);(80,70;80,40)/(80,40;80,70);(50,40;50,57)/(40,40;40,23)"); } { diff --git a/testdata/net_tracer/t6_all_nets.oas.gz.1 b/testdata/net_tracer/t6_all_nets.oas.gz.1 index fe935937b..709ef1e17 100644 Binary files a/testdata/net_tracer/t6_all_nets.oas.gz.1 and b/testdata/net_tracer/t6_all_nets.oas.gz.1 differ