Does this predicate's per-dim range intersect `bbox`? True if for every dim where the predicate has a bound, the tile's [min, max] overlaps the predicate's [lo, hi]. Dims the predicate doesn't constrain are accepted by default. If the predicate has more dims than the bbox, extra dims are ignored (stale predicate after schema change → conservative pass).
(&self, bbox: &BBox)
| 48 | /// predicate has more dims than the bbox, extra dims are ignored |
| 49 | /// (stale predicate after schema change → conservative pass). |
| 50 | pub fn intersects(&self, bbox: &BBox) -> bool { |
| 51 | for (i, dp) in self.per_dim.iter().enumerate() { |
| 52 | if i >= bbox.arity() { |
| 53 | break; |
| 54 | } |
| 55 | if let Some(lo) = &dp.lo |
| 56 | && lt_bound(&bbox.max[i], lo) |
| 57 | { |
| 58 | return false; |
| 59 | } |
| 60 | if let Some(hi) = &dp.hi |
| 61 | && lt_bound(hi, &bbox.min[i]) |
| 62 | { |
| 63 | return false; |
| 64 | } |
| 65 | // bounds equal-touching is overlap — handled by `lt_bound` |
| 66 | // returning false on equality. |
| 67 | let _ = le_bound; // keep helper compiled for future symmetric checks |
| 68 | } |
| 69 | true |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | #[cfg(test)] |