True if a tile's per-dim MBR overlaps every constrained dim range. An empty `dim_ranges` (no constraints) trivially overlaps.
(
dim_mins: &[DomainBound],
dim_maxs: &[DomainBound],
slice: &Slice,
)
| 66 | /// True if a tile's per-dim MBR overlaps every constrained dim range. |
| 67 | /// An empty `dim_ranges` (no constraints) trivially overlaps. |
| 68 | pub fn tile_overlaps_slice( |
| 69 | dim_mins: &[DomainBound], |
| 70 | dim_maxs: &[DomainBound], |
| 71 | slice: &Slice, |
| 72 | ) -> bool { |
| 73 | for (i, range) in slice.dim_ranges.iter().enumerate() { |
| 74 | let Some(r) = range else { continue }; |
| 75 | let Some(tile_min) = dim_mins.get(i) else { |
| 76 | return false; |
| 77 | }; |
| 78 | let Some(tile_max) = dim_maxs.get(i) else { |
| 79 | return false; |
| 80 | }; |
| 81 | // Disjoint when tile_max < range.lo OR tile_min > range.hi. |
| 82 | if bound_lt(tile_max, &r.lo) || bound_lt(&r.hi, tile_min) { |
| 83 | return false; |
| 84 | } |
| 85 | } |
| 86 | true |
| 87 | } |
| 88 | |
| 89 | /// Filter cells in `tile` to those whose coords pass every dim range. |
| 90 | /// Result is a freshly-built [`SparseTile`] — dictionaries shrink to |
no test coverage detected