#include <Interval_Restriction.defs.hh>


Public Types | |
| typedef T | modulo_type |
Public Member Functions | |
| PPL_COMPILE_TIME_CHECK (std::numeric_limits< T >::is_exact,"type for modulo values must be exact") | |
| Interval_Restriction_Integer_Modulo () | |
| bool | has_restriction () const |
| void | clear () |
| void | normalize () const |
| template<typename V > | |
| Result | restrict (Rounding_Dir rdir, V &x, Result dir) const |
| void | assign_or_swap (Interval_Restriction_Integer_Modulo &x) |
Public Attributes | |
| T | remainder |
| T | divisor |
Definition at line 319 of file Interval_Restriction.defs.hh.
| typedef T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::modulo_type |
Definition at line 397 of file Interval_Restriction.defs.hh.
| Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::Interval_Restriction_Integer_Modulo | ( | ) | [inline] |
Definition at line 323 of file Interval_Restriction.defs.hh.
References Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear().
00323 { 00324 // FIXME: would we have speed benefits with uninitialized info? 00325 // (Dirty_Temp) 00326 clear(); 00327 }
| void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::assign_or_swap | ( | Interval_Restriction_Integer_Modulo< T, Base > & | x | ) | [inline] |
Definition at line 393 of file Interval_Restriction.defs.hh.
References Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor, and Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::remainder.
00393 { 00394 Parma_Polyhedra_Library::assign_or_swap(remainder, x.remainder); 00395 Parma_Polyhedra_Library::assign_or_swap(divisor, x.divisor); 00396 }
| void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear | ( | ) | [inline] |
Definition at line 331 of file Interval_Restriction.defs.hh.
References Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor, and Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::remainder.
Referenced by Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::Interval_Restriction_Integer_Modulo().
00331 { 00332 remainder = 0; 00333 divisor = 0; 00334 Base::clear(); 00335 }
| bool Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::has_restriction | ( | ) | const [inline] |
Definition at line 328 of file Interval_Restriction.defs.hh.
References Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor.
Referenced by Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::restrict().
00328 { 00329 return divisor != 0; 00330 }
| void Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::normalize | ( | ) | const [inline] |
Definition at line 336 of file Interval_Restriction.defs.hh.
| Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::PPL_COMPILE_TIME_CHECK | ( | std::numeric_limits< T >::is_exact | , | |
| "type for modulo values must be exact" | ||||
| ) |
| Result Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::restrict | ( | Rounding_Dir | rdir, | |
| V & | x, | |||
| Result | dir | |||
| ) | const [inline] |
Definition at line 339 of file Interval_Restriction.defs.hh.
References Parma_Polyhedra_Library::assign_r(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor, Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::has_restriction(), and Parma_Polyhedra_Library::Checked::Result.
00339 { 00340 if (!has_restriction()) 00341 return dir; 00342 PPL_DIRTY_TEMP(V, n); 00343 PPL_DIRTY_TEMP(V, div); 00344 Result r; 00345 r = assign_r(div, divisor, ROUND_CHECK); 00346 PPL_ASSERT(r == V_EQ); 00347 int s; 00348 r = rem_assign_r(n, x, div, ROUND_NOT_NEEDED); 00349 PPL_ASSERT(r == V_EQ); 00350 s = sgn(n); 00351 switch (dir) { 00352 case V_GT: 00353 if (s >= 0) { 00354 r = sub_assign_r(n, div, n, ROUND_NOT_NEEDED); 00355 PPL_ASSERT(r == V_EQ); 00356 return add_assign_r(x, x, n, rdir); 00357 } 00358 else 00359 return sub_assign_r(x, x, n, rdir); 00360 case V_GE: 00361 if (s > 0) { 00362 r = sub_assign_r(n, div, n, ROUND_NOT_NEEDED); 00363 PPL_ASSERT(r == V_EQ); 00364 return add_assign_r(x, x, n, rdir); 00365 } 00366 else if (s < 0) 00367 return sub_assign_r(x, x, n, rdir); 00368 else 00369 return V_EQ; 00370 case V_LT: 00371 if (s <= 0) { 00372 r = add_assign_r(n, div, n, ROUND_NOT_NEEDED); 00373 PPL_ASSERT(r == V_EQ); 00374 return sub_assign_r(x, x, n, rdir); 00375 } 00376 else 00377 return sub_assign_r(x, x, n, rdir); 00378 case V_LE: 00379 if (s < 0) { 00380 r = add_assign_r(n, div, n, ROUND_NOT_NEEDED); 00381 PPL_ASSERT(r == V_EQ); 00382 return sub_assign_r(x, x, n, rdir); 00383 } 00384 else if (s > 0) 00385 return sub_assign_r(x, x, n, rdir); 00386 else 00387 return V_EQ; 00388 default: 00389 PPL_ASSERT(false); 00390 return dir; 00391 } 00392 }
| T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::divisor |
Definition at line 399 of file Interval_Restriction.defs.hh.
Referenced by Parma_Polyhedra_Library::add_restriction(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::assign_or_swap(), Parma_Polyhedra_Library::assign_restriction(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::has_restriction(), Parma_Polyhedra_Library::intersect_restriction(), Parma_Polyhedra_Library::join_restriction(), Parma_Polyhedra_Library::mul_restriction(), Parma_Polyhedra_Library::output_restriction(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::restrict(), Parma_Polyhedra_Library::set_integer(), Parma_Polyhedra_Library::set_unrestricted(), and Parma_Polyhedra_Library::sub_restriction().
| T Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::remainder |
Definition at line 398 of file Interval_Restriction.defs.hh.
Referenced by Parma_Polyhedra_Library::add_restriction(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::assign_or_swap(), Parma_Polyhedra_Library::assign_restriction(), Parma_Polyhedra_Library::Interval_Restriction_Integer_Modulo< T, Base >::clear(), Parma_Polyhedra_Library::intersect_restriction(), Parma_Polyhedra_Library::join_restriction(), Parma_Polyhedra_Library::mul_restriction(), Parma_Polyhedra_Library::output_restriction(), Parma_Polyhedra_Library::set_integer(), Parma_Polyhedra_Library::set_unrestricted(), and Parma_Polyhedra_Library::sub_restriction().
1.6.3