| 33 |
33 |
| 34 impl<U, const N: usize> Set<Loc<N, U>> for Cube<N, U> |
34 impl<U, const N: usize> Set<Loc<N, U>> for Cube<N, U> |
| 35 where |
35 where |
| 36 U: Num + PartialOrd + Sized, |
36 U: Num + PartialOrd + Sized, |
| 37 { |
37 { |
| |
38 #[inline] |
| 38 fn contains<I: Instance<Loc<N, U>>>(&self, item: I) -> bool { |
39 fn contains<I: Instance<Loc<N, U>>>(&self, item: I) -> bool { |
| 39 item.eval_ref(|r| self.0.iter().zip(r.iter()).all(|(s, x)| s.contains(x))) |
40 item.eval_ref(|r| self.0.iter().zip(r.iter()).all(|([a, b], x)| a<=x && x<=b)) |
| 40 } |
41 } |
| 41 } |
42 } |
| 42 |
43 |
| 43 impl<U: Space> Set<U> for RangeFull { |
44 impl<U: Space> Set<U> for RangeFull { |
| 44 fn contains<I: Instance<U>>(&self, _item: I) -> bool { |
45 fn contains<I: Instance<U>>(&self, _item: I) -> bool { |