MCPcopy Create free account
hub / github.com/NVlabs/AutoDMP / queryRange

Method queryRange

dreamplace/ops/place_io/src/SubRowNodeMap.cpp:87–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87std::vector<SubRowNodeMap::index_type> SubRowNodeMap::queryRange(Box<SubRowNodeMap::coordinate_type> const& box) const
88{
89 // go through bins and extract sub rows
90 Box<index_type> idxBinBox = m_algoDB->getBinIndexRange(kSBin, box.xl(), box.yl(), box.xh(), box.yh());
91 std::vector<index_type> vSubRow;
92 for (index_type idxX = idxBinBox.xl(); idxX <= idxBinBox.xh(); ++idxX)
93 for (index_type idxY = idxBinBox.yl(); idxY <= idxBinBox.yh(); ++idxY)
94 {
95 Bin const& bin = m_algoDB->getBinByIndex(kSBin, idxX, idxY);
96 for (HrchyList<index_type>::const_iterator_type itBR = bin.binRows().begin(), itBRe = bin.binRows().end(); itBR != itBRe; ++itBR)
97 {
98 BinRow const& brow = m_algoDB->getBinRow(*itBR);
99 vSubRow.push_back(brow.subRowId());
100 }
101 }
102 // remove duplicates of sub rows
103 removeDuplicates(vSubRow);
104
105 // go through sub rows and extract nodes
106 std::vector<index_type> vNodeInBox; // result
107 for (std::vector<index_type>::const_iterator itSR = vSubRow.begin(), itSRe = vSubRow.end(); itSR != itSRe; ++itSR)
108 {
109 SubRow const& srow = m_algoDB->getSubRow(*itSR);
110 if (intersects(srow, box, false)) // consider sub row that has overlap with the box
111 {
112 std::pair<map_const_iterator_type, map_const_iterator_type> found = queryRange(srow.index1D(), box.xl(), box.xh(), true);
113 for (map_const_iterator_type itn = found.first; itn != found.second; ++itn)
114 {
115#ifdef DEBUG
116#ifdef USE_RTREE
117 dreamplaceAssert(getMapElementHigh(itn) > box.xl()); // skip cells that do not have overlap with the range
118#endif
119#endif
120#ifdef USE_RTREE
121 vNodeInBox.push_back(getMapElementId(itn));
122#elif defined(USE_INTERVALHASHMAP)
123 if (getMapElementHigh(itn) > box.xl()) // skip cells that do not have overlap with the range
124 vNodeInBox.push_back(getMapElementId(itn));
125#endif
126 }
127 }
128 }
129 return vNodeInBox;
130}
131
132std::vector<SubRowNodeMap::index_type> SubRowNodeMap::queryRange(
133 SubRowNodeMap::coordinate_type xl, SubRowNodeMap::coordinate_type yl,

Callers

nothing calls this directly

Calls 9

NoBoundaryPredicateClass · 0.85
xlMethod · 0.80
ylMethod · 0.80
xhMethod · 0.80
yhMethod · 0.80
insertMethod · 0.80
intersectsFunction · 0.70
subRowIdMethod · 0.45
index1DMethod · 0.45

Tested by

no test coverage detected