| 85 | } |
| 86 | |
| 87 | std::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 | |
| 132 | std::vector<SubRowNodeMap::index_type> SubRowNodeMap::queryRange( |
| 133 | SubRowNodeMap::coordinate_type xl, SubRowNodeMap::coordinate_type yl, |
nothing calls this directly
no test coverage detected