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

Function div_negative

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

Source from the content-addressed store, hash-verified

99}
100
101template<class T, class Policies> inline
102interval<T, Policies> div_negative(const interval<T, Policies>& x, const T& yl)
103{
104 // assert(::gecode_boost::numeric::interval_lib::user::is_neg(yl));
105 if (::gecode_boost::numeric::interval_lib::user::is_zero(x.lower()) &&
106 ::gecode_boost::numeric::interval_lib::user::is_zero(x.upper()))
107 return x;
108 typename Policies::rounding rnd;
109 typedef interval<T, Policies> I;
110 const T& xl = x.lower();
111 const T& xu = x.upper();
112 typedef typename Policies::checking checking;
113 if (::gecode_boost::numeric::interval_lib::user::is_neg(xu))
114 return I(rnd.div_down(xu, yl), checking::pos_inf(), true);
115 else if (::gecode_boost::numeric::interval_lib::user::is_neg(xl))
116 return I(checking::neg_inf(), checking::pos_inf(), true);
117 else
118 return I(checking::neg_inf(), rnd.div_up(xl, yl), true);
119}
120
121template<class T, class Policies> inline
122interval<T, Policies> div_negative(const T& x, const T& yl)

Callers 2

operator/Function · 0.85
division_part1Function · 0.85

Calls 6

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

Tested by

no test coverage detected