MCPcopy Create free account
hub / github.com/Gecode/gecode / intersect

Function intersect

gecode/third-party/boost/numeric/interval/utility.hpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164template<class T, class Policies> inline
165interval<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
178template<class T, class Policies> inline
179interval<T, Policies> hull(const interval<T, Policies>& x,

Callers 1

root_auxFunction · 0.70

Calls 5

test_inputFunction · 0.85
emptyFunction · 0.70
lowerMethod · 0.45
upperMethod · 0.45

Tested by

no test coverage detected