| 162 | } |
| 163 | |
| 164 | template<class T, class Policies> inline |
| 165 | interval<T, Policies> intersect(const interval<T, Policies>& x, |
| 166 | const interval<T, Policies>& y) |
| 167 | { |
| 168 | GECODE_BOOST_USING_STD_MIN(); |
| 169 | GECODE_BOOST_USING_STD_MAX(); |
| 170 | if (interval_lib::detail::test_input(x, y)) |
| 171 | return interval<T, Policies>::empty(); |
| 172 | const T& l = max GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.lower(), y.lower()); |
| 173 | const T& u = min GECODE_BOOST_PREVENT_MACRO_SUBSTITUTION(x.upper(), y.upper()); |
| 174 | if (l <= u) return interval<T, Policies>(l, u, true); |
| 175 | else return interval<T, Policies>::empty(); |
| 176 | } |
| 177 | |
| 178 | template<class T, class Policies> inline |
| 179 | interval<T, Policies> hull(const interval<T, Policies>& x, |
no test coverage detected