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

Function div_non_zero

gecode/third-party/boost/numeric/interval/detail/division.hpp:24–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace detail {
23
24template<class T, class Policies> inline
25interval<T, Policies> div_non_zero(const interval<T, Policies>& x,
26 const interval<T, Policies>& y)
27{
28 // assert(!in_zero(y));
29 typename Policies::rounding rnd;
30 typedef interval<T, Policies> I;
31 const T& xl = x.lower();
32 const T& xu = x.upper();
33 const T& yl = y.lower();
34 const T& yu = y.upper();
35 if (::gecode_boost::numeric::interval_lib::user::is_neg(xu))
36 if (::gecode_boost::numeric::interval_lib::user::is_neg(yu))
37 return I(rnd.div_down(xu, yl), rnd.div_up(xl, yu), true);
38 else
39 return I(rnd.div_down(xl, yl), rnd.div_up(xu, yu), true);
40 else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl))
41 if (::gecode_boost::numeric::interval_lib::user::is_neg(yu))
42 return I(rnd.div_down(xu, yu), rnd.div_up(xl, yu), true);
43 else
44 return I(rnd.div_down(xl, yl), rnd.div_up(xu, yl), true);
45 else
46 if (::gecode_boost::numeric::interval_lib::user::is_neg(yu))
47 return I(rnd.div_down(xu, yu), rnd.div_up(xl, yl), true);
48 else
49 return I(rnd.div_down(xl, yu), rnd.div_up(xu, yl), true);
50}
51
52template<class T, class Policies> inline
53interval<T, Policies> div_non_zero(const T& x, const interval<T, Policies>& y)

Callers 2

operator/Function · 0.85
division_part1Function · 0.85

Calls 5

is_negFunction · 0.85
lowerMethod · 0.45
upperMethod · 0.45
div_downMethod · 0.45
div_upMethod · 0.45

Tested by

no test coverage detected