A generic, not necessarily closed, possibly restricted interval. More...
#include <Interval.defs.hh>


Public Types | |
| typedef Boundary | boundary_type |
| typedef Info | info_type |
| typedef Interval_NS::Property | Property |
Public Member Functions | |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, Interval & >::type | operator= (const T &x) |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, Interval & >::type | operator+= (const T &x) |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, Interval & >::type | operator-= (const T &x) |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, Interval & >::type | operator*= (const T &x) |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, Interval & >::type | operator/= (const T &x) |
| void | swap (Interval &y) |
Swaps *this with y. | |
| Info & | info () |
| const Info & | info () const |
| Boundary & | lower () |
| const Boundary & | lower () const |
| Boundary & | upper () |
| const Boundary & | upper () const |
| I_Constraint< boundary_type > | lower_constraint () const |
| I_Constraint< boundary_type > | upper_constraint () const |
| bool | has_restriction () const |
| I_Result | normalize () const |
| bool | is_empty () const |
| bool | check_empty (I_Result r) const |
| bool | is_singleton () const |
| bool | lower_is_open () const |
| bool | upper_is_open () const |
| bool | lower_is_boundary_infinity () const |
| bool | upper_is_boundary_infinity () const |
| bool | lower_is_domain_inf () const |
| bool | upper_is_domain_sup () const |
| bool | is_bounded () const |
| bool | is_universe () const |
| I_Result | lower_extend () |
| template<typename C > | |
| Enable_If< Is_Same_Or_Derived < I_Constraint_Base, C > ::value, I_Result >::type | lower_extend (const C &c) |
| I_Result | upper_extend () |
| template<typename C > | |
| Enable_If< Is_Same_Or_Derived < I_Constraint_Base, C > ::value, I_Result >::type | upper_extend (const C &c) |
| I_Result | build () |
| template<typename C > | |
| Enable_If< Is_Same_Or_Derived < I_Constraint_Base, C > ::value, I_Result >::type | build (const C &c) |
| template<typename C1 , typename C2 > | |
| Enable_If< Is_Same_Or_Derived < I_Constraint_Base, C1 > ::value &&Is_Same_Or_Derived < I_Constraint_Base, C2 > ::value, I_Result >::type | build (const C1 &c1, const C2 &c2) |
| template<typename C > | |
| Enable_If< Is_Same_Or_Derived < I_Constraint_Base, C > ::value, I_Result >::type | add_constraint (const C &c) |
| I_Result | assign (Degenerate_Element e) |
| template<typename From > | |
| Enable_If< Is_Special< From > ::value, I_Result >::type | assign (const From &) |
| I_Result | set_infinities () |
| bool | is_topologically_closed () const |
| void | topological_closure_assign () |
Assigns to *this its topological closure. | |
| void | remove_inf () |
| void | remove_sup () |
| bool | is_infinity () const |
| bool | contains_integer_point () const |
| void | drop_some_non_integer_points () |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | wrap_assign (Bounded_Integer_Type_Width w, Bounded_Integer_Type_Representation r, const From &refinement) |
| memory_size_type | total_memory_in_bytes () const |
Returns the total size in bytes of the memory occupied by *this. | |
| memory_size_type | external_memory_in_bytes () const |
Returns the size in bytes of the memory managed by *this. | |
| void | ascii_dump (std::ostream &s) const |
| bool | ascii_load (std::istream &s) |
| bool | OK () const |
| Interval () | |
| template<typename T > | |
| Interval (const T &x) | |
| Interval (const char *s) | |
Builds the smallest interval containing the number whose textual representation is contained in s. | |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, bool >::type | contains (const T &y) const |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, bool >::type | strictly_contains (const T &y) const |
| template<typename T > | |
| Enable_If< Is_Singleton< T > ::value||Is_Interval< T > ::value, bool >::type | is_disjoint_from (const T &y) const |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | assign (const From &x) |
| template<typename Type > | |
| Enable_If< Is_Singleton< Type > ::value||Is_Interval< Type > ::value, bool >::type | can_be_exactly_joined_to (const Type &x) const |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | join_assign (const From &x) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | join_assign (const From1 &x, const From2 &y) |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | intersect_assign (const From &x) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | intersect_assign (const From1 &x, const From2 &y) |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | difference_assign (const From &x) |
Assigns to *this the smallest interval containing the set-theoretic difference of *this and x. | |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | difference_assign (const From1 &x, const From2 &y) |
Assigns to *this the smallest interval containing the set-theoretic difference of x and y. | |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | lower_approximation_difference_assign (const From &x) |
Assigns to *this the largest interval contained in the set-theoretic difference of *this and x. | |
| template<typename From > | |
| Enable_If< Is_Interval< From > ::value, bool >::type | simplify_using_context_assign (const From &y) |
Assigns to *this a meet-preserving simplification of *this with respect to y. | |
| template<typename From > | |
| Enable_If< Is_Interval< From > ::value, void >::type | empty_intersection_assign (const From &y) |
Assigns to *this an interval having empty intersection with y. The assigned interval should be as large as possible. | |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | refine_existential (Relation_Symbol rel, const From &x) |
Refines to according to the existential relation rel with x. | |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | refine_universal (Relation_Symbol rel, const From &x) |
Refines to so that it satisfies the universal relation rel with x. | |
| template<typename From > | |
| Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | neg_assign (const From &x) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | add_assign (const From1 &x, const From2 &y) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | sub_assign (const From1 &x, const From2 &y) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | mul_assign (const From1 &x, const From2 &y) |
| template<typename From1 , typename From2 > | |
| Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | div_assign (const From1 &x, const From2 &y) |
| template<typename From , typename Iterator > | |
| Enable_If< Is_Interval< From > ::value, void >::type | CC76_widening_assign (const From &y, Iterator first, Iterator last) |
Static Public Member Functions | |
| static bool | is_always_topologically_closed () |
Private Member Functions | |
| PPL_COMPILE_TIME_CHECK (!Info::store_special||!std::numeric_limits< Boundary >::has_infinity,"store_special is meaningless"" when boundary type may contains infinity") | |
| Info & | w_info () const |
| Result | lower_normalize () const |
| Result | upper_normalize () const |
Private Attributes | |
| Boundary | lower_ |
| Boundary | upper_ |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename Boundary , typename Info > | |
| void | swap (Parma_Polyhedra_Library::Interval< Boundary, Info > &x, Parma_Polyhedra_Library::Interval< Boundary, Info > &y) |
A generic, not necessarily closed, possibly restricted interval.
The class template type parameter Boundary represents the type of the interval boundaries, and can be chosen, among other possibilities, within one of the following number families:
signed char to long long and from int8_t to int64_t);float, double or long double);mpz_class or mpq_class).The class template type parameter Info allows to control a number of features of the class, among which:
Definition at line 90 of file Interval.defs.hh.
| typedef Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::boundary_type |
Definition at line 144 of file Interval.defs.hh.
| typedef Info Parma_Polyhedra_Library::Interval< Boundary, Info >::info_type |
Definition at line 145 of file Interval.defs.hh.
| typedef Interval_NS::Property Parma_Polyhedra_Library::Interval< Boundary, Info >::Property |
Definition at line 147 of file Interval.defs.hh.
| Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval | ( | ) | [inline] |
Definition at line 652 of file Interval.defs.hh.
| Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval | ( | const T & | x | ) | [inline, explicit] |
Definition at line 656 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign().
00656 { 00657 assign(x); 00658 }
| Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval | ( | const char * | s | ) | [explicit] |
Builds the smallest interval containing the number whose textual representation is contained in s.
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::add_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
Definition at line 617 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::add_restriction(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::is_infinity(), Parma_Polyhedra_Library::MINUS_INFINITY, Parma_Polyhedra_Library::PLUS_INFINITY, and Parma_Polyhedra_Library::Checked::Result.
Referenced by Parma_Polyhedra_Library::operator+(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator+=().
00617 { 00618 PPL_ASSERT(f_OK(x)); 00619 PPL_ASSERT(f_OK(y)); 00620 if (check_empty_arg(x) || check_empty_arg(y)) 00621 return assign(EMPTY); 00622 int inf = Parma_Polyhedra_Library::is_infinity(x); 00623 if (inf) { 00624 if (Parma_Polyhedra_Library::is_infinity(y) == -inf) 00625 return assign(EMPTY); 00626 } 00627 else 00628 inf = Parma_Polyhedra_Library::is_infinity(y); 00629 if (inf < 0) 00630 return assign(MINUS_INFINITY); 00631 else if (inf > 0) 00632 return assign(PLUS_INFINITY); 00633 PPL_DIRTY_TEMP(To_Info, to_info); 00634 to_info.clear(); 00635 if (!add_restriction(to_info, x, y)) 00636 return assign(EMPTY); 00637 Result rl = Boundary_NS::add_assign(LOWER, lower(), to_info, 00638 LOWER, f_lower(x), f_info(x), 00639 LOWER, f_lower(y), f_info(y)); 00640 Result ru = Boundary_NS::add_assign(UPPER, upper(), to_info, 00641 UPPER, f_upper(x), f_info(x), 00642 UPPER, f_upper(y), f_info(y)); 00643 assign_or_swap(info(), to_info); 00644 PPL_ASSERT(OK()); 00645 return combine(rl, ru); 00646 }
| Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::add_constraint | ( | const C & | c | ) | [inline] |
Definition at line 368 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::build(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::build().
00368 { 00369 Interval x; 00370 x.build(c); 00371 return intersect_assign(x); 00372 }
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_dump | ( | std::ostream & | s | ) | const [inline] |
Definition at line 1092 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::ascii_dump(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
01092 { 01093 using Parma_Polyhedra_Library::ascii_dump; 01094 s << "info "; 01095 info().ascii_dump(s); 01096 s << " lower "; 01097 ascii_dump(s, lower()); 01098 s << " upper "; 01099 ascii_dump(s, upper()); 01100 s << '\n'; 01101 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load | ( | std::istream & | s | ) | [inline] |
Definition at line 1105 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
01105 { 01106 using Parma_Polyhedra_Library::ascii_load; 01107 std::string str; 01108 if (!(s >> str) || str != "info") 01109 return false; 01110 if (!info().ascii_load(s)) 01111 return false; 01112 if (!(s >> str) || str != "lower") 01113 return false; 01114 if (!ascii_load(s, lower())) 01115 return false; 01116 if (!(s >> str) || str != "upper") 01117 return false; 01118 if (!ascii_load(s, upper())) 01119 return false; 01120 PPL_ASSERT(OK()); 01121 return true; 01122 }
| Enable_If<Is_Singleton<From>::value || Is_Interval<From>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::assign | ( | const From & | x | ) | [inline] |
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::assign | ( | const From & | x | ) | [inline] |
Definition at line 398 of file Interval.defs.hh.
References Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00398 { 00399 info().clear(); 00400 Result rl, ru; 00401 switch (From::vclass) { 00402 case VC_MINUS_INFINITY: 00403 rl = Boundary_NS::set_minus_infinity(LOWER, lower(), info()); 00404 ru = Boundary_NS::set_minus_infinity(UPPER, upper(), info()); 00405 break; 00406 case VC_PLUS_INFINITY: 00407 rl = Boundary_NS::set_plus_infinity(LOWER, lower(), info()); 00408 ru = Boundary_NS::set_plus_infinity(UPPER, upper(), info()); 00409 break; 00410 default: 00411 PPL_ASSERT(0); 00412 rl = V_NAN; 00413 ru = V_NAN; 00414 } 00415 PPL_ASSERT(OK()); 00416 return combine(rl, ru); 00417 }
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::assign | ( | Degenerate_Element | e | ) | [inline] |
Definition at line 374 of file Interval.defs.hh.
References Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::UNIVERSE, Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::build(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::operator=(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
00374 { 00375 I_Result r; 00376 info().clear(); 00377 switch (e) { 00378 default: 00379 PPL_ASSERT(0); 00380 /* Fall through */ 00381 case EMPTY: 00382 lower_ = 1; 00383 upper_ = 0; 00384 r = I_EMPTY | I_EXACT; 00385 break; 00386 case UNIVERSE: 00387 set_unbounded(LOWER, lower(), info()); 00388 set_unbounded(UPPER, upper(), info()); 00389 r = I_UNIVERSE | I_EXACT; 00390 break; 00391 } 00392 PPL_ASSERT(OK()); 00393 return r; 00394 }
| Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C1>::value && Is_Same_Or_Derived<I_Constraint_Base, C2>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::build | ( | const C1 & | c1, | |
| const C2 & | c2 | |||
| ) | [inline] |
Definition at line 344 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::add_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::build(), and Parma_Polyhedra_Library::EMPTY.
00344 { 00345 switch (c1.rel()) { 00346 case V_LGE: 00347 return build(c2); 00348 case V_NAN: 00349 return assign(EMPTY); 00350 default: 00351 break; 00352 } 00353 switch (c2.rel()) { 00354 case V_LGE: 00355 return build(c1); 00356 case V_NAN: 00357 return assign(EMPTY); 00358 default: 00359 break; 00360 } 00361 build(c1); 00362 I_Result r = add_constraint(c2); 00363 return r - (I_CHANGED | I_UNCHANGED); 00364 }
| Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::build | ( | const C & | c | ) | [inline] |
Definition at line 318 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), and Parma_Polyhedra_Library::UNIVERSE.
00318 { 00319 Relation_Symbol rs; 00320 switch (c.rel()) { 00321 case V_LGE: 00322 case V_GT_MINUS_INFINITY: 00323 case V_LT_PLUS_INFINITY: 00324 return assign(UNIVERSE); 00325 default: 00326 return assign(EMPTY); 00327 case V_LT: 00328 case V_LE: 00329 case V_GT: 00330 case V_GE: 00331 case V_EQ: 00332 case V_NE: 00333 assign(UNIVERSE); 00334 rs = (Relation_Symbol) c.rel(); 00335 return refine_existential(rs, c.value()); 00336 } 00337 }
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::build | ( | ) | [inline] |
Definition at line 312 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), and Parma_Polyhedra_Library::UNIVERSE.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_constraint(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::build().
| Enable_If< Is_Singleton< Type >::value||Is_Interval< Type >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to | ( | const Type & | x | ) | const [inline] |
Definition at line 317 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Checked::eq, Parma_Polyhedra_Library::eq_restriction(), Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00317 { 00318 // FIXME: the two restrictions should be evaluated in the context of 00319 // the specific interval 00320 if (!eq_restriction(info(), f_info(x))) 00321 return false; 00322 PPL_DIRTY_TEMP(Boundary, b); 00323 if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) { 00324 b = lower(); 00325 return info().restrict(round_dir_check(LOWER, true), b, V_LT) == V_EQ 00326 && eq(LOWER, b, info(), UPPER, f_upper(x), f_info(x)); 00327 } 00328 else if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) { 00329 b = upper(); 00330 return info().restrict(round_dir_check(UPPER, true), b, V_GT) == V_EQ 00331 && eq(UPPER, b, info(), LOWER, f_lower(x), f_info(x)); 00332 } 00333 return true; 00334 }
| Enable_If<Is_Interval<From>::value, void>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::CC76_widening_assign | ( | const From & | y, | |
| Iterator | first, | |||
| Iterator | last | |||
| ) | [inline] |
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::check_empty | ( | I_Result | r | ) | const [inline] |
Definition at line 242 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty().
00242 { 00243 return (r & I_ANY) == I_EMPTY 00244 || ((r & I_ANY) != I_NOT_EMPTY && is_empty()); 00245 }
| Enable_If< Is_Singleton< T >::value||Is_Interval< T >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::contains | ( | const T & | y | ) | const [inline] |
Definition at line 190 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::contains_restriction(), Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00190 { 00191 PPL_ASSERT(OK()); 00192 PPL_ASSERT(f_OK(y)); 00193 if (check_empty_arg(y)) 00194 return true; 00195 if (check_empty_arg(*this)) 00196 return false; 00197 // FIXME: the two restrictions should be evaluated in the context of 00198 // the specific interval 00199 if (!contains_restriction(info(), f_info(y))) 00200 return false; 00201 return le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) 00202 && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)); 00203 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point | ( | ) | const [inline] |
Definition at line 474 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::is_bounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00474 { 00475 PPL_ASSERT(OK()); 00476 if (is_empty()) 00477 return false; 00478 if (!is_bounded()) 00479 return true; 00480 Boundary l; 00481 if (lower_is_open()) { 00482 add_assign_r(l, lower(), Boundary(1), ROUND_DOWN); 00483 floor_assign_r(l, l, ROUND_DOWN); 00484 } 00485 else 00486 ceil_assign_r(l, lower(), ROUND_DOWN); 00487 Boundary u; 00488 if (upper_is_open()) { 00489 sub_assign_r(u, upper(), Boundary(1), ROUND_UP); 00490 ceil_assign_r(u, u, ROUND_UP); 00491 } 00492 else 00493 floor_assign_r(u, upper(), ROUND_UP); 00494 return u >= l; 00495 }
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::difference_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
Assigns to *this the smallest interval containing the set-theoretic difference of x and y.
Definition at line 414 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::Checked::lt, and Parma_Polyhedra_Library::Checked::Result.
00415 { 00416 PPL_ASSERT(f_OK(x)); 00417 PPL_ASSERT(f_OK(y)); 00418 PPL_DIRTY_TEMP(To_Info, to_info); 00419 to_info.clear(); 00420 // FIXME: restrictions 00421 if (lt(UPPER, f_upper(x), f_info(x), LOWER, f_lower(y), f_info(y)) 00422 || 00423 gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y))) 00424 return assign(x); 00425 bool nl = ge(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y)); 00426 bool nu = le(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y)); 00427 Result rl = V_EQ, ru = V_EQ; 00428 if (nl) { 00429 if (nu) 00430 return assign(EMPTY); 00431 else { 00432 rl = complement(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)); 00433 ru = Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); 00434 } 00435 } 00436 else if (nu) { 00437 ru = complement(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y)); 00438 rl = Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); 00439 } 00440 assign_or_swap(info(), to_info); 00441 PPL_ASSERT(OK()); 00442 return combine(rl, ru); 00443 }
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::difference_assign | ( | const From & | x | ) | [inline] |
Assigns to *this the smallest interval containing the set-theoretic difference of *this and x.
Definition at line 382 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00382 { 00383 PPL_ASSERT(f_OK(x)); 00384 // FIXME: restrictions 00385 if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)) 00386 || 00387 gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) 00388 return combine(V_EQ, V_EQ); 00389 bool nl = ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); 00390 bool nu = le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); 00391 Result rl = V_EQ, ru = V_EQ; 00392 if (nl) { 00393 if (nu) 00394 return assign(EMPTY); 00395 else { 00396 info().clear_boundary_properties(LOWER); 00397 rl = complement(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)); 00398 } 00399 } 00400 else if (nu) { 00401 info().clear_boundary_properties(UPPER); 00402 ru = complement(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)); 00403 } 00404 PPL_ASSERT(OK()); 00405 return combine(rl, ru); 00406 }
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::div_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
+-----------+-----------+-----------+ | / | yu < 0 | yl > 0 | +-----------+-----------+-----------+ | xu<=0 |xu/yl,xl/yu|xl/yl,xu/yu| +-----------+-----------+-----------+ |xl<=0 xu>=0|xu/yu,xl/yu|xl/yl,xu/yl| +-----------+-----------+-----------+ | xl>=0 |xu/yu,xl/yl|xl/yu,xu/yl| +-----------+-----------+-----------+
Definition at line 876 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::div_restriction(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::is_infinity(), Parma_Polyhedra_Library::MINUS_INFINITY, Parma_Polyhedra_Library::PLUS_INFINITY, Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::UNIVERSE.
Referenced by Parma_Polyhedra_Library::operator/(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator/=().
00876 { 00877 PPL_ASSERT(f_OK(x)); 00878 PPL_ASSERT(f_OK(y)); 00879 if (check_empty_arg(x) || check_empty_arg(y)) 00880 return assign(EMPTY); 00881 int yls = sgn_b(LOWER, f_lower(y), f_info(y)); 00882 int yus = yls > 0 ? 1 : sgn_b(UPPER, f_upper(y), f_info(y)); 00883 if (yls == 0 && yus == 0) 00884 return assign(EMPTY); 00885 int inf = Parma_Polyhedra_Library::is_infinity(x); 00886 if (inf) { 00887 if (Parma_Polyhedra_Library::is_infinity(y)) 00888 return assign(EMPTY); 00889 if (yls == -yus) 00890 return set_infinities(); 00891 if (yls < 0 || yus < 0) 00892 inf = -inf; 00893 if (inf < 0) 00894 return assign(MINUS_INFINITY); 00895 else 00896 return assign(PLUS_INFINITY); 00897 } 00898 int xls = sgn_b(LOWER, f_lower(x), f_info(x)); 00899 int xus = xls > 0 ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); 00900 00901 PPL_DIRTY_TEMP(To_Info, to_info); 00902 to_info.clear(); 00903 if (!div_restriction(to_info, x, y)) 00904 return assign(EMPTY); 00905 Result rl, ru; 00906 PPL_DIRTY_TEMP(To_Boundary, to_lower); 00907 if (yls >= 0) { 00908 if (xls >= 0) { 00909 rl = div_assign_z(LOWER, to_lower, to_info, 00910 LOWER, f_lower(x), f_info(x), xls, 00911 UPPER, f_upper(y), f_info(y), yus); 00912 ru = div_assign_z(UPPER, upper(), to_info, 00913 UPPER, f_upper(x), f_info(x), xus, 00914 LOWER, f_lower(y), f_info(y), yls); 00915 } 00916 else if (xus <= 0) { 00917 rl = div_assign_z(LOWER, to_lower, to_info, 00918 LOWER, f_lower(x), f_info(x), xls, 00919 LOWER, f_lower(y), f_info(y), yls); 00920 ru = div_assign_z(UPPER, upper(), to_info, 00921 UPPER, f_upper(x), f_info(x), xus, 00922 UPPER, f_upper(y), f_info(y), yus); 00923 } 00924 else { 00925 rl = div_assign_z(LOWER, to_lower, to_info, 00926 LOWER, f_lower(x), f_info(x), xls, 00927 LOWER, f_lower(y), f_info(y), yls); 00928 ru = div_assign_z(UPPER, upper(), to_info, 00929 UPPER, f_upper(x), f_info(x), xus, 00930 LOWER, f_lower(y), f_info(y), yls); 00931 } 00932 } 00933 else if (yus <= 0) { 00934 if (xls >= 0) { 00935 rl = div_assign_z(LOWER, to_lower, to_info, 00936 UPPER, f_upper(x), f_info(x), xus, 00937 UPPER, f_upper(y), f_info(y), yus); 00938 ru = div_assign_z(UPPER, upper(), to_info, 00939 LOWER, f_lower(x), f_info(x), xls, 00940 LOWER, f_lower(y), f_info(y), yls); 00941 } 00942 else if (xus <= 0) { 00943 rl = div_assign_z(LOWER, to_lower, to_info, 00944 UPPER, f_upper(x), f_info(x), xus, 00945 LOWER, f_lower(y), f_info(y), yls); 00946 ru = div_assign_z(UPPER, upper(), to_info, 00947 LOWER, f_lower(x), f_info(x), xls, 00948 UPPER, f_upper(y), f_info(y), yus); 00949 } 00950 else { 00951 rl = div_assign_z(LOWER, to_lower, to_info, 00952 UPPER, f_upper(x), f_info(x), xus, 00953 UPPER, f_upper(y), f_info(y), yus); 00954 ru = div_assign_z(UPPER, upper(), to_info, 00955 LOWER, f_lower(x), f_info(x), xls, 00956 UPPER, f_upper(y), f_info(y), yus); 00957 } 00958 } 00959 else { 00960 // FIXME: restrictions 00961 return static_cast<I_Result>(assign(UNIVERSE) | I_SINGULARITIES); 00962 } 00963 assign_or_swap(lower(), to_lower); 00964 assign_or_swap(info(), to_info); 00965 PPL_ASSERT(OK()); 00966 return combine(rl, ru); 00967 }
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points | ( | ) | [inline] |
Definition at line 497 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00497 { 00498 if (is_empty()) 00499 return; 00500 if (lower_is_open() && !lower_is_boundary_infinity()) { 00501 add_assign_r(lower(), lower(), Boundary(1), ROUND_DOWN); 00502 floor_assign_r(lower(), lower(), ROUND_DOWN); 00503 info().set_boundary_property(LOWER, OPEN, false); 00504 } 00505 else 00506 ceil_assign_r(lower(), lower(), ROUND_DOWN); 00507 if (upper_is_open() && !upper_is_boundary_infinity()) { 00508 sub_assign_r(upper(), upper(), Boundary(1), ROUND_UP); 00509 ceil_assign_r(upper(), upper(), ROUND_UP); 00510 info().set_boundary_property(UPPER, OPEN, false); 00511 } 00512 else 00513 floor_assign_r(upper(), upper(), ROUND_UP); 00514 }
| Enable_If<Is_Interval<From>::value, void>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::empty_intersection_assign | ( | const From & | y | ) | [inline] |
Assigns to *this an interval having empty intersection with y. The assigned interval should be as large as possible.
y. | memory_size_type Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes | ( | ) | const [inline] |
Returns the size in bytes of the memory managed by *this.
Definition at line 42 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::total_memory_in_bytes().
00042 { 00043 return Parma_Polyhedra_Library::external_memory_in_bytes(lower()) 00044 + Parma_Polyhedra_Library::external_memory_in_bytes(upper()); 00045 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::has_restriction | ( | ) | const [inline] |
Definition at line 221 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize().
00221 { 00222 return info().has_restriction(); 00223 }
| const Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::info | ( | ) | const [inline] |
Definition at line 188 of file Interval.defs.hh.
| Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::info | ( | ) | [inline] |
Definition at line 184 of file Interval.defs.hh.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_dump(), Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::has_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_sup(), Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::swap(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::intersect_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
Definition at line 358 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::intersect_restriction(), Parma_Polyhedra_Library::max_assign(), Parma_Polyhedra_Library::min_assign(), and Parma_Polyhedra_Library::Checked::Result.
00359 { 00360 PPL_ASSERT(f_OK(x)); 00361 PPL_ASSERT(f_OK(y)); 00362 PPL_DIRTY_TEMP(To_Info, to_info); 00363 to_info.clear(); 00364 if (!intersect_restriction(to_info, x, y)) 00365 return assign(EMPTY); 00366 Result rl, ru; 00367 rl = max_assign(LOWER, lower(), to_info, 00368 LOWER, f_lower(x), f_info(x), 00369 LOWER, f_lower(y), f_info(y)); 00370 ru = min_assign(UPPER, upper(), to_info, 00371 UPPER, f_upper(x), f_info(x), 00372 UPPER, f_upper(y), f_info(y)); 00373 assign_or_swap(info(), to_info); 00374 PPL_ASSERT(OK()); 00375 return I_NOT_EMPTY; 00376 }
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::intersect_assign | ( | const From & | x | ) | [inline] |
Definition at line 341 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::intersect_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::max_assign(), Parma_Polyhedra_Library::min_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
00341 { 00342 PPL_ASSERT(f_OK(x)); 00343 if (!intersect_restriction(info(), *this, x)) 00344 return assign(EMPTY); 00345 Result rl, ru; 00346 rl = max_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); 00347 ru = min_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); 00348 PPL_ASSERT(OK()); 00349 return I_ANY; 00350 }
| static bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_always_topologically_closed | ( | ) | [inline, static] |
Definition at line 428 of file Interval.defs.hh.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_bounded | ( | ) | const [inline] |
Definition at line 281 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point().
00281 { 00282 PPL_ASSERT(OK()); 00283 return !lower_is_boundary_infinity() && !upper_is_boundary_infinity(); 00284 }
| Enable_If< Is_Singleton< T >::value||Is_Interval< T >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from | ( | const T & | y | ) | const [inline] |
Definition at line 232 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00232 { 00233 PPL_ASSERT(OK()); 00234 PPL_ASSERT(f_OK(y)); 00235 if (check_empty_arg(*this) || check_empty_arg(y)) 00236 return true; 00237 // CHECKME. 00238 // if (!contains_restriction(info(), f_info(y))) 00239 // return false; 00240 return gt(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y)) 00241 || lt(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y)); 00242 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty | ( | ) | const [inline] |
Definition at line 238 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::check_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::f_is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_sup(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_constraint(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity | ( | ) | const [inline] |
Definition at line 464 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::is_infinity().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton | ( | ) | const [inline] |
Definition at line 247 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Checked::eq, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::f_is_singleton().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed | ( | ) | const [inline] |
Definition at line 432 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::is_always_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00432 { 00433 PPL_ASSERT(OK()); 00434 return is_always_topologically_closed() 00435 || is_empty() 00436 || ((lower_is_boundary_infinity() || !lower_is_open()) 00437 && (upper_is_boundary_infinity() || !upper_is_open())); 00438 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe | ( | ) | const [inline] |
Definition at line 286 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::has_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup().
00286 { 00287 PPL_ASSERT(OK()); 00288 return lower_is_domain_inf() && upper_is_domain_sup() 00289 && !has_restriction(); 00290 }
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::join_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
Definition at line 290 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::join_restriction(), Parma_Polyhedra_Library::max_assign(), Parma_Polyhedra_Library::min_assign(), and Parma_Polyhedra_Library::Checked::Result.
00290 { 00291 PPL_ASSERT(f_OK(x)); 00292 PPL_ASSERT(f_OK(y)); 00293 if (check_empty_arg(x)) 00294 return assign(y); 00295 if (check_empty_arg(y)) 00296 return assign(x); 00297 PPL_DIRTY_TEMP(To_Info, to_info); 00298 to_info.clear(); 00299 if (!join_restriction(to_info, x, y)) 00300 return assign(EMPTY); 00301 Result rl, ru; 00302 rl = min_assign(LOWER, lower(), to_info, 00303 LOWER, f_lower(x), f_info(x), 00304 LOWER, f_lower(y), f_info(y)); 00305 ru = max_assign(UPPER, upper(), to_info, 00306 UPPER, f_upper(x), f_info(x), 00307 UPPER, f_upper(y), f_info(y)); 00308 assign_or_swap(info(), to_info); 00309 PPL_ASSERT(OK()); 00310 return combine(rl, ru); 00311 }
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::join_assign | ( | const From & | x | ) | [inline] |
Definition at line 269 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::join_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::max_assign(), Parma_Polyhedra_Library::min_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
00269 { 00270 PPL_ASSERT(f_OK(x)); 00271 if (check_empty_arg(*this)) 00272 return assign(x); 00273 if (check_empty_arg(x)) 00274 return combine(V_EQ, V_EQ); 00275 if (!join_restriction(info(), *this, x)) 00276 return assign(EMPTY); 00277 Result rl, ru; 00278 rl = min_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)); 00279 ru = max_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)); 00280 PPL_ASSERT(OK()); 00281 return combine(rl, ru); 00282 }
| const Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::lower | ( | ) | const [inline] |
Definition at line 196 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_.
00196 { 00197 return lower_; 00198 }
| Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::lower | ( | ) | [inline] |
Definition at line 192 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_dump(), Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::swap(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
00192 { 00193 return lower_; 00194 }
| Enable_If<Is_Singleton<From>::value || Is_Interval<From>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_approximation_difference_assign | ( | const From & | x | ) | [inline] |
Assigns to *this the largest interval contained in the set-theoretic difference of *this and x.
| I_Constraint<boundary_type> Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_constraint | ( | ) | const [inline] |
Definition at line 208 of file Interval.defs.hh.
References Parma_Polyhedra_Library::GREATER_OR_EQUAL, Parma_Polyhedra_Library::GREATER_THAN, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open().
00208 { 00209 PPL_ASSERT(!is_empty()); 00210 if (info().get_boundary_property(LOWER, SPECIAL)) 00211 return I_Constraint<boundary_type>(); 00212 return i_constraint(lower_is_open() ? GREATER_THAN : GREATER_OR_EQUAL, lower(), true); 00213 }
| Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend | ( | const C & | c | ) | [inline] |
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend | ( | ) | [inline] |
Definition at line 292 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::lower().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity | ( | ) | const [inline] |
Definition at line 261 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_bounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf | ( | ) | const [inline] |
Definition at line 271 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open | ( | ) | const [inline] |
Definition at line 251 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_constraint(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign().
| Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize | ( | ) | const [inline, private] |
Definition at line 99 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::w_info().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize().
00099 { 00100 Result r; 00101 if (info().get_boundary_property(LOWER, NORMALIZED) 00102 || info().get_boundary_property(LOWER, SPECIAL)) 00103 r = V_EQ; 00104 else { 00105 Boundary& l = const_cast<Boundary&>(lower()); 00106 if (info().get_boundary_property(LOWER, OPEN)) { 00107 r = info().restrict(round_dir_check(LOWER, true), l, V_GT); 00108 if (r != V_GT) 00109 w_info().set_boundary_property(LOWER, OPEN, false); 00110 } 00111 else { 00112 r = info().restrict(round_dir_check(LOWER, true), l, V_GE); 00113 if (r == V_GT) 00114 w_info().set_boundary_property(LOWER, OPEN); 00115 } 00116 w_info().set_boundary_property(LOWER, NORMALIZED); 00117 } 00118 return r; 00119 }
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::mul_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
+---------+-----------+-----------+-----------------+ | * | yl > 0 | yu < 0 | yl < 0, yu > 0 | +---------+-----------+-----------+-----------------+ | xl > 0 |xl*yl,xu*yu|xu*yl,xl*yu| xu*yl,xu*yu | +---------+-----------+-----------+-----------------+ | xu < 0 |xl*yu,xu*yl|xu*yu,xl*yl| xl*yu,xl*yl | +---------+-----------+-----------+-----------------+ |xl<0 xu>0|xl*yu,xu*yu|xu*yl,xl*yl|min(xl*yu,xu*yl),| | | | |max(xl*yl,xu*yu) | +---------+-----------+-----------+-----------------+
Definition at line 707 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::is_infinity(), Parma_Polyhedra_Library::Checked::lt, Parma_Polyhedra_Library::MINUS_INFINITY, Parma_Polyhedra_Library::mul_restriction(), Parma_Polyhedra_Library::PLUS_INFINITY, and Parma_Polyhedra_Library::Checked::Result.
Referenced by Parma_Polyhedra_Library::operator*(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator*=().
00707 { 00708 PPL_ASSERT(f_OK(x)); 00709 PPL_ASSERT(f_OK(y)); 00710 if (check_empty_arg(x) || check_empty_arg(y)) 00711 return assign(EMPTY); 00712 int xls = sgn_b(LOWER, f_lower(x), f_info(x)); 00713 int xus = xls > 0 ? 1 : sgn_b(UPPER, f_upper(x), f_info(x)); 00714 int yls = sgn_b(LOWER, f_lower(y), f_info(y)); 00715 int yus = yls > 0 ? 1 : sgn_b(UPPER, f_upper(y), f_info(y)); 00716 int inf = Parma_Polyhedra_Library::is_infinity(x); 00717 int ls, us; 00718 if (inf) { 00719 ls = yls; 00720 us = yus; 00721 goto inf; 00722 } 00723 else { 00724 inf = Parma_Polyhedra_Library::is_infinity(y); 00725 if (inf) { 00726 ls = xls; 00727 us = xus; 00728 inf: 00729 if (ls == 0 && us == 0) 00730 return assign(EMPTY); 00731 if (ls == -us) 00732 return set_infinities(); 00733 if (ls < 0 || us < 0) 00734 inf = -inf; 00735 if (inf < 0) 00736 return assign(MINUS_INFINITY); 00737 else 00738 return assign(PLUS_INFINITY); 00739 } 00740 } 00741 00742 PPL_DIRTY_TEMP(To_Info, to_info); 00743 to_info.clear(); 00744 if (!mul_restriction(to_info, x, y)) 00745 return assign(EMPTY); 00746 Result rl, ru; 00747 PPL_DIRTY_TEMP(To_Boundary, to_lower); 00748 00749 if (xls >= 0) { 00750 if (yls >= 0) { 00751 // 0 <= xl <= xu, 0 <= yl <= yu 00752 rl = mul_assign_z(LOWER, to_lower, to_info, 00753 LOWER, f_lower(x), f_info(x), xls, 00754 LOWER, f_lower(y), f_info(y), yls); 00755 ru = mul_assign_z(UPPER, upper(), to_info, 00756 UPPER, f_upper(x), f_info(x), xus, 00757 UPPER, f_upper(y), f_info(y), yus); 00758 } 00759 else if (yus <= 0) { 00760 // 0 <= xl <= xu, yl <= yu <= 0 00761 rl = mul_assign_z(LOWER, to_lower, to_info, 00762 UPPER, f_upper(x), f_info(x), xus, 00763 LOWER, f_lower(y), f_info(y), yls); 00764 ru = mul_assign_z(UPPER, upper(), to_info, 00765 LOWER, f_lower(x), f_info(x), xls, 00766 UPPER, f_upper(y), f_info(y), yus); 00767 } 00768 else { 00769 // 0 <= xl <= xu, yl < 0 < yu 00770 rl = mul_assign_z(LOWER, to_lower, to_info, 00771 UPPER, f_upper(x), f_info(x), xus, 00772 LOWER, f_lower(y), f_info(y), yls); 00773 ru = mul_assign_z(UPPER, upper(), to_info, 00774 UPPER, f_upper(x), f_info(x), xus, 00775 UPPER, f_upper(y), f_info(y), yus); 00776 } 00777 } 00778 else if (xus <= 0) { 00779 if (yls >= 0) { 00780 // xl <= xu <= 0, 0 <= yl <= yu 00781 rl = mul_assign_z(LOWER, to_lower, to_info, 00782 LOWER, f_lower(x), f_info(x), xls, 00783 UPPER, f_upper(y), f_info(y), yus); 00784 ru = mul_assign_z(UPPER, upper(), to_info, 00785 UPPER, f_upper(x), f_info(x), xus, 00786 LOWER, f_lower(y), f_info(y), yls); 00787 } 00788 else if (yus <= 0) { 00789 // xl <= xu <= 0, yl <= yu <= 0 00790 rl = mul_assign_z(LOWER, to_lower, to_info, 00791 UPPER, f_upper(x), f_info(x), xus, 00792 UPPER, f_upper(y), f_info(y), yus); 00793 ru = mul_assign_z(UPPER, upper(), to_info, 00794 LOWER, f_lower(x), f_info(x), xls, 00795 LOWER, f_lower(y), f_info(y), yls); 00796 } 00797 else { 00798 // xl <= xu <= 0, yl < 0 < yu 00799 rl = mul_assign_z(LOWER, to_lower, to_info, 00800 LOWER, f_lower(x), f_info(x), xls, 00801 UPPER, f_upper(y), f_info(y), yus); 00802 ru = mul_assign_z(UPPER, upper(), to_info, 00803 LOWER, f_lower(x), f_info(x), xls, 00804 LOWER, f_lower(y), f_info(y), yls); 00805 } 00806 } 00807 else if (yls >= 0) { 00808 // xl < 0 < xu, 0 <= yl <= yu 00809 rl = mul_assign_z(LOWER, to_lower, to_info, 00810 LOWER, f_lower(x), f_info(x), xls, 00811 UPPER, f_upper(y), f_info(y), yus); 00812 ru = mul_assign_z(UPPER, upper(), to_info, 00813 UPPER, f_upper(x), f_info(x), xus, 00814 UPPER, f_upper(y), f_info(y), yus); 00815 } 00816 else if (yus <= 0) { 00817 // xl < 0 < xu, yl <= yu <= 0 00818 rl = mul_assign_z(LOWER, to_lower, to_info, 00819 UPPER, f_upper(x), f_info(x), xus, 00820 LOWER, f_lower(y), f_info(y), yls); 00821 ru = mul_assign_z(UPPER, upper(), to_info, 00822 LOWER, f_lower(x), f_info(x), xls, 00823 LOWER, f_lower(y), f_info(y), yls); 00824 } 00825 else { 00826 // xl < 0 < xu, yl < 0 < yu 00827 PPL_DIRTY_TEMP(To_Boundary, tmp); 00828 PPL_DIRTY_TEMP(To_Info, tmp_info); 00829 tmp_info.clear(); 00830 Result tmp_r; 00831 tmp_r = Boundary_NS::mul_assign(LOWER, tmp, tmp_info, 00832 UPPER, f_upper(x), f_info(x), 00833 LOWER, f_lower(y), f_info(y)); 00834 rl = Boundary_NS::mul_assign(LOWER, to_lower, to_info, 00835 LOWER, f_lower(x), f_info(x), 00836 UPPER, f_upper(y), f_info(y)); 00837 if (gt(LOWER, to_lower, to_info, LOWER, tmp, tmp_info)) { 00838 to_lower = tmp; 00839 rl = tmp_r; 00840 } 00841 tmp_info.clear(); 00842 tmp_r = Boundary_NS::mul_assign(UPPER, tmp, tmp_info, 00843 UPPER, f_upper(x), f_info(x), 00844 UPPER, f_upper(y), f_info(y)); 00845 ru = Boundary_NS::mul_assign(UPPER, upper(), to_info, 00846 LOWER, f_lower(x), f_info(x), 00847 LOWER, f_lower(y), f_info(y)); 00848 if (lt(UPPER, upper(), to_info, UPPER, tmp, tmp_info)) { 00849 upper() = tmp; 00850 ru = tmp_r; 00851 } 00852 } 00853 assign_or_swap(lower(), to_lower); 00854 assign_or_swap(info(), to_info); 00855 PPL_ASSERT(OK()); 00856 return combine(rl, ru); 00857 }
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::neg_assign | ( | const From & | x | ) | [inline] |
Definition at line 593 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::neg_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00593 { 00594 PPL_ASSERT(f_OK(x)); 00595 if (check_empty_arg(x)) 00596 return assign(EMPTY); 00597 PPL_DIRTY_TEMP(To_Info, to_info); 00598 to_info.clear(); 00599 if (!neg_restriction(to_info, x)) 00600 return assign(EMPTY); 00601 Result rl, ru; 00602 PPL_DIRTY_TEMP(To_Boundary, to_lower); 00603 rl = Boundary_NS::neg_assign(LOWER, to_lower, to_info, UPPER, f_upper(x), f_info(x)); 00604 ru = Boundary_NS::neg_assign(UPPER, upper(), to_info, LOWER, f_lower(x), f_info(x)); 00605 assign_or_swap(lower(), to_lower); 00606 assign_or_swap(info(), to_info); 00607 PPL_ASSERT(OK()); 00608 return combine(rl, ru); 00609 }
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize | ( | ) | const [inline] |
Definition at line 225 of file Interval.defs.hh.
References Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::has_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal().
00225 { 00226 PPL_ASSERT(OK()); 00227 if (has_restriction()) { 00228 Result rl = lower_normalize(); 00229 Result ru = upper_normalize(); 00230 info().normalize(); 00231 PPL_ASSERT(OK()); 00232 return combine(rl, ru); 00233 } 00234 else 00235 return combine(V_EQ, V_EQ); 00236 }
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::OK | ( | ) | const [inline] |
Definition at line 569 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::is_minus_infinity(), Parma_Polyhedra_Library::is_not_a_number(), Parma_Polyhedra_Library::is_plus_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_bounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_domain_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00569 { 00570 #if 0 00571 if (!Info::may_be_empty && is_empty()) { 00572 #ifndef NDEBUG 00573 std::cerr << "The interval is unexpectedly empty.\n"; 00574 #endif 00575 return false; 00576 } 00577 #endif 00578 00579 if (is_open(LOWER, lower(), info())) { 00580 if (is_plus_infinity(LOWER, lower(), info())) { 00581 #ifndef NDEBUG 00582 std::cerr << "The lower boundary is +inf open.\n"; 00583 #endif 00584 } 00585 } 00586 else if (!Info::may_contain_infinity 00587 && (is_minus_infinity(LOWER, lower(), info()) 00588 || is_plus_infinity(LOWER, lower(), info()))) { 00589 #ifndef NDEBUG 00590 std::cerr << "The lower boundary is unexpectedly infinity.\n"; 00591 #endif 00592 return false; 00593 } 00594 if (!info().get_boundary_property(LOWER, SPECIAL)) { 00595 if (is_not_a_number(lower())) { 00596 #ifndef NDEBUG 00597 std::cerr << "The lower boundary is not a number.\n"; 00598 #endif 00599 return false; 00600 } 00601 #if 0 00602 if (info().get_boundary_property(LOWER, NORMALIZED) 00603 && !info().is_restricted(lower())) { 00604 #ifndef NDEBUG 00605 std::cerr << "The lower boundary is marked to be normalized, " 00606 << "but it is not.\n"; 00607 #endif 00608 return false; 00609 } 00610 #endif 00611 } 00612 00613 if (is_open(UPPER, upper(), info())) { 00614 if (is_minus_infinity(UPPER, upper(), info())) { 00615 #ifndef NDEBUG 00616 std::cerr << "The upper boundary is -inf open.\n"; 00617 #endif 00618 } 00619 } 00620 else if (!Info::may_contain_infinity 00621 && (is_minus_infinity(UPPER, upper(), info()) 00622 || is_plus_infinity(UPPER, upper(), info()))) { 00623 #ifndef NDEBUG 00624 std::cerr << "The upper boundary is unexpectedly infinity." 00625 << std::endl; 00626 #endif 00627 return false; 00628 } 00629 if (!info().get_boundary_property(UPPER, SPECIAL)) { 00630 if (is_not_a_number(upper())) { 00631 #ifndef NDEBUG 00632 std::cerr << "The upper boundary is not a number.\n"; 00633 #endif 00634 return false; 00635 } 00636 #if 0 00637 if (info().get_boundary_property(UPPER, NORMALIZED) 00638 && !info().is_restricted(upper())) { 00639 #ifndef NDEBUG 00640 std::cerr << "The upper boundary is marked to be normalized, " 00641 << "but it is not.\n"; 00642 #endif 00643 return false; 00644 } 00645 #endif 00646 } 00647 00648 // Everything OK. 00649 return true; 00650 }
| Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::operator*= | ( | const T & | x | ) | [inline] |
Definition at line 170 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign().
00170 { 00171 mul_assign(*this, x); 00172 return *this; 00173 }
| Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::operator+= | ( | const T & | x | ) | [inline] |
Definition at line 158 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign().
00158 { 00159 add_assign(*this, x); 00160 return *this; 00161 }
| Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::operator-= | ( | const T & | x | ) | [inline] |
Definition at line 164 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::sub_assign().
00164 { 00165 sub_assign(*this, x); 00166 return *this; 00167 }
| Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::operator/= | ( | const T & | x | ) | [inline] |
Definition at line 176 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign().
00176 { 00177 div_assign(*this, x); 00178 return *this; 00179 }
| Enable_If<Is_Singleton<T>::value || Is_Interval<T>::value, Interval&>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::operator= | ( | const T & | x | ) | [inline] |
Definition at line 151 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign().
00151 { 00152 assign(x); 00153 return *this; 00154 }
| Parma_Polyhedra_Library::Interval< Boundary, Info >::PPL_COMPILE_TIME_CHECK | ( | !Info::store_special||!std::numeric_limits< Boundary >::has_infinity | , | |
| "store_special is meaningless"" when boundary type may contains infinity" | ||||
| ) | [private] |
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::refine_existential | ( | Relation_Symbol | rel, | |
| const From & | x | |||
| ) | [inline] |
Refines to according to the existential relation rel with x.
The to interval is restricted to become, upon successful exit, the smallest interval of its type that contains the set
Definition at line 450 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Checked::eq, Parma_Polyhedra_Library::EQUAL, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::f_is_singleton(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::GREATER_OR_EQUAL, Parma_Polyhedra_Library::GREATER_THAN, Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::LESS_OR_EQUAL, Parma_Polyhedra_Library::LESS_THAN, Parma_Polyhedra_Library::Checked::lt, and Parma_Polyhedra_Library::NOT_EQUAL.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::build().
00450 { 00451 PPL_ASSERT(OK()); 00452 PPL_ASSERT(f_OK(x)); 00453 if (check_empty_arg(x)) 00454 return assign(EMPTY); 00455 switch (rel) { 00456 case LESS_THAN: 00457 { 00458 if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) 00459 return combine(V_EQ, V_EQ); 00460 info().clear_boundary_properties(UPPER); 00461 Boundary_NS::assign(UPPER, upper(), info(), 00462 UPPER, f_upper(x), f_info(x), true); 00463 normalize(); 00464 return I_ANY; 00465 } 00466 case LESS_OR_EQUAL: 00467 { 00468 if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) 00469 return combine(V_EQ, V_EQ); 00470 info().clear_boundary_properties(UPPER); 00471 Boundary_NS::assign(UPPER, upper(), info(), 00472 UPPER, f_upper(x), f_info(x)); 00473 normalize(); 00474 return I_ANY; 00475 } 00476 case GREATER_THAN: 00477 { 00478 if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) 00479 return combine(V_EQ, V_EQ); 00480 info().clear_boundary_properties(LOWER); 00481 Boundary_NS::assign(LOWER, lower(), info(), 00482 LOWER, f_lower(x), f_info(x), true); 00483 normalize(); 00484 return I_ANY; 00485 } 00486 case GREATER_OR_EQUAL: 00487 { 00488 if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) 00489 return combine(V_EQ, V_EQ); 00490 info().clear_boundary_properties(LOWER); 00491 Boundary_NS::assign(LOWER, lower(), info(), 00492 LOWER, f_lower(x), f_info(x)); 00493 normalize(); 00494 return I_ANY; 00495 } 00496 case EQUAL: 00497 return intersect_assign(x); 00498 case NOT_EQUAL: 00499 { 00500 if (!f_is_singleton(x)) 00501 return combine(V_EQ, V_EQ); 00502 if (check_empty_arg(*this)) 00503 return I_EMPTY; 00504 if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) 00505 remove_inf(); 00506 if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) 00507 remove_sup(); 00508 normalize(); 00509 return I_ANY; 00510 } 00511 default: 00512 PPL_ASSERT(false); 00513 return I_EMPTY; 00514 } 00515 }
| Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::refine_universal | ( | Relation_Symbol | rel, | |
| const From & | x | |||
| ) | [inline] |
Refines to so that it satisfies the universal relation rel with x.
The to interval is restricted to become, upon successful exit, the smallest interval of its type that contains the set
Definition at line 521 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Checked::eq, Parma_Polyhedra_Library::EQUAL, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::f_is_singleton(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::GREATER_OR_EQUAL, Parma_Polyhedra_Library::GREATER_THAN, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::LESS_OR_EQUAL, Parma_Polyhedra_Library::LESS_THAN, Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize(), Parma_Polyhedra_Library::NOT_EQUAL, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_inf(), Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_sup(), Parma_Polyhedra_Library::Checked::Result, Parma_Polyhedra_Library::Interval_NS::SCALAR_INFO, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00522 { 00523 PPL_ASSERT(OK()); 00524 PPL_ASSERT(f_OK(x)); 00525 if (check_empty_arg(x)) 00526 return combine(V_EQ, V_EQ); 00527 switch (rel) { 00528 case LESS_THAN: 00529 { 00530 if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) 00531 return combine(V_EQ, V_EQ); 00532 info().clear_boundary_properties(UPPER); 00533 Result ru = Boundary_NS::assign(UPPER, upper(), info(), 00534 LOWER, f_lower(x), SCALAR_INFO, !is_open(LOWER, f_lower(x), f_info(x))); 00535 normalize(); 00536 return I_ANY; 00537 } 00538 case LESS_OR_EQUAL: 00539 { 00540 if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x))) 00541 return combine(V_EQ, V_EQ); 00542 info().clear_boundary_properties(UPPER); 00543 Result ru = Boundary_NS::assign(UPPER, upper(), info(), 00544 LOWER, f_lower(x), SCALAR_INFO); 00545 normalize(); 00546 return I_ANY; 00547 } 00548 case GREATER_THAN: 00549 { 00550 if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) 00551 return combine(V_EQ, V_EQ); 00552 info().clear_boundary_properties(LOWER); 00553 Result rl = Boundary_NS::assign(LOWER, lower(), info(), 00554 UPPER, f_upper(x), SCALAR_INFO, !is_open(UPPER, f_upper(x), f_info(x))); 00555 normalize(); 00556 return I_ANY; 00557 } 00558 case GREATER_OR_EQUAL: 00559 { 00560 if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x))) 00561 return combine(V_EQ, V_EQ); 00562 info().clear_boundary_properties(LOWER); 00563 Result rl = Boundary_NS::assign(LOWER, lower(), info(), 00564 UPPER, f_upper(x), SCALAR_INFO); 00565 normalize(); 00566 return I_ANY; 00567 } 00568 case EQUAL: 00569 if (!f_is_singleton(x)) 00570 return assign(EMPTY); 00571 return intersect_assign(x); 00572 case NOT_EQUAL: 00573 { 00574 if (check_empty_arg(*this)) 00575 return I_EMPTY; 00576 if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x))) 00577 remove_inf(); 00578 if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x))) 00579 remove_sup(); 00580 normalize(); 00581 return I_ANY; 00582 } 00583 default: 00584 PPL_ASSERT(false); 00585 return I_EMPTY; 00586 } 00587 }
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_inf | ( | ) | [inline] |
Definition at line 450 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal().
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::remove_sup | ( | ) | [inline] |
Definition at line 457 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal().
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities | ( | ) | [inline] |
Definition at line 419 of file Interval.defs.hh.
References Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
| Enable_If<Is_Interval<From>::value, bool>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::simplify_using_context_assign | ( | const From & | y | ) | [inline] |
Assigns to *this a meet-preserving simplification of *this with respect to y.
false if and only if the meet of *this and y is empty. | Enable_If< Is_Singleton< T >::value||Is_Interval< T >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains | ( | const T & | y | ) | const [inline] |
Definition at line 208 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::contains_restriction(), Parma_Polyhedra_Library::eq_restriction(), Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
00208 { 00209 PPL_ASSERT(OK()); 00210 PPL_ASSERT(f_OK(y)); 00211 if (check_empty_arg(y)) 00212 return !check_empty_arg(*this); 00213 if (check_empty_arg(*this)) 00214 return false; 00215 // FIXME: the two restrictions should be evaluated in the context of 00216 // the specific interval 00217 if (!contains_restriction(info(), f_info(y))) 00218 return false; 00219 else if (!eq_restriction(info(), f_info(y))) 00220 return le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) 00221 && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y)); 00222 return (lt(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) 00223 && ge(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y))) 00224 || (le(LOWER, lower(), info(), LOWER, f_lower(y), f_info(y)) 00225 && gt(UPPER, upper(), info(), UPPER, f_upper(y), f_info(y))); 00226 }
| Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::sub_assign | ( | const From1 & | x, | |
| const From2 & | y | |||
| ) | [inline] |
Definition at line 654 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::Interval_NS::f_info(), Parma_Polyhedra_Library::Interval_NS::f_lower(), Parma_Polyhedra_Library::f_OK(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::is_infinity(), Parma_Polyhedra_Library::MINUS_INFINITY, Parma_Polyhedra_Library::PLUS_INFINITY, Parma_Polyhedra_Library::Checked::Result, and Parma_Polyhedra_Library::sub_restriction().
Referenced by Parma_Polyhedra_Library::operator-(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator-=().
00654 { 00655 PPL_ASSERT(f_OK(x)); 00656 PPL_ASSERT(f_OK(y)); 00657 if (check_empty_arg(x) || check_empty_arg(y)) 00658 return assign(EMPTY); 00659 int inf = Parma_Polyhedra_Library::is_infinity(x); 00660 if (inf) { 00661 if (Parma_Polyhedra_Library::is_infinity(y) == inf) 00662 return assign(EMPTY); 00663 } 00664 else 00665 inf = -Parma_Polyhedra_Library::is_infinity(y); 00666 if (inf < 0) 00667 return assign(MINUS_INFINITY); 00668 else if (inf > 0) 00669 return assign(PLUS_INFINITY); 00670 00671 PPL_DIRTY_TEMP(To_Info, to_info); 00672 to_info.clear(); 00673 if (!sub_restriction(to_info, x, y)) 00674 return assign(EMPTY); 00675 Result rl, ru; 00676 PPL_DIRTY_TEMP(To_Boundary, to_lower); 00677 rl = Boundary_NS::sub_assign(LOWER, to_lower, to_info, 00678 LOWER, f_lower(x), f_info(x), 00679 UPPER, f_upper(y), f_info(y)); 00680 ru = Boundary_NS::sub_assign(UPPER, upper(), to_info, 00681 UPPER, f_upper(x), f_info(x), 00682 LOWER, f_lower(y), f_info(y)); 00683 assign_or_swap(lower(), to_lower); 00684 assign_or_swap(info(), to_info); 00685 PPL_ASSERT(OK()); 00686 return combine(rl, ru); 00687 }
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::swap | ( | Interval< Boundary, Info > & | y | ) | [inline] |
Swaps *this with y.
Definition at line 55 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::swap().
| void Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign | ( | ) | [inline] |
Assigns to *this its topological closure.
Definition at line 441 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00441 { 00442 if (!Info::store_open || is_empty()) 00443 return; 00444 if (lower_is_open() && !lower_is_boundary_infinity()) 00445 info().set_boundary_property(LOWER, OPEN, false); 00446 if (upper_is_open() && !upper_is_boundary_infinity()) 00447 info().set_boundary_property(UPPER, OPEN, false); 00448 }
| memory_size_type Parma_Polyhedra_Library::Interval< Boundary, Info >::total_memory_in_bytes | ( | ) | const [inline] |
Returns the total size in bytes of the memory occupied by *this.
Definition at line 49 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes().
00049 { 00050 return sizeof(*this) + external_memory_in_bytes(); 00051 }
| const Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::upper | ( | ) | const [inline] |
Definition at line 204 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_.
00204 { 00205 return upper_; 00206 }
| Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::upper | ( | ) | [inline] |
Definition at line 200 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_dump(), Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::can_be_exactly_joined_to(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes(), Parma_Polyhedra_Library::Interval_NS::f_upper(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_disjoint_from(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), Parma_Polyhedra_Library::Interval< Boundary, Info >::strictly_contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::swap(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_constraint(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
00200 { 00201 return upper_; 00202 }
| I_Constraint<boundary_type> Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_constraint | ( | ) | const [inline] |
Definition at line 214 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::LESS_OR_EQUAL, Parma_Polyhedra_Library::LESS_THAN, Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open().
00214 { 00215 PPL_ASSERT(!is_empty()); 00216 if (info().get_boundary_property(UPPER, SPECIAL)) 00217 return I_Constraint<boundary_type>(); 00218 return i_constraint(upper_is_open() ? LESS_THAN : LESS_OR_EQUAL, upper(), true); 00219 }
| Enable_If<Is_Same_Or_Derived<I_Constraint_Base, C>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_extend | ( | const C & | c | ) | [inline] |
| I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_extend | ( | ) | [inline] |
Definition at line 302 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity | ( | ) | const [inline] |
Definition at line 266 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_bounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_domain_sup | ( | ) | const [inline] |
Definition at line 276 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe().
| bool Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open | ( | ) | const [inline] |
Definition at line 256 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::drop_some_non_integer_points(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_constraint().
| Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize | ( | ) | const [inline, private] |
Definition at line 120 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Checked::Result, Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::w_info().
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize().
00120 { 00121 Result r; 00122 if (info().get_boundary_property(UPPER, NORMALIZED) 00123 || info().get_boundary_property(UPPER, SPECIAL)) 00124 r = V_EQ; 00125 else { 00126 Boundary& u = const_cast<Boundary&>(upper()); 00127 if (info().get_boundary_property(UPPER, OPEN)) { 00128 r = info().restrict(round_dir_check(UPPER, true), u, V_LT); 00129 if (r != V_LT) 00130 w_info().set_boundary_property(UPPER, OPEN, false); 00131 } 00132 else { 00133 r = info().restrict(round_dir_check(UPPER, true), u, V_LE); 00134 if (r == V_LT) 00135 w_info().set_boundary_property(UPPER, OPEN); 00136 } 00137 w_info().set_boundary_property(UPPER, NORMALIZED); 00138 } 00139 return r; 00140 }
| Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::w_info | ( | ) | const [inline, private] |
Definition at line 96 of file Interval.defs.hh.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize().
00096 { 00097 return const_cast<Interval&>(*this); 00098 }
| Enable_If<Is_Singleton<From>::value || Is_Interval<From>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::wrap_assign | ( | Bounded_Integer_Type_Width | w, | |
| Bounded_Integer_Type_Representation | r, | |||
| const From & | refinement | |||
| ) | [inline] |
Definition at line 518 of file Interval.defs.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Checked::le, Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_extend(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_boundary_infinity(), Parma_Polyhedra_Library::Checked::Result, Parma_Polyhedra_Library::SIGNED_2_COMPLEMENT, Parma_Polyhedra_Library::UNSIGNED, Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_boundary_infinity().
00520 { 00521 if (is_empty()) 00522 return I_EMPTY; 00523 if (lower_is_boundary_infinity() || upper_is_boundary_infinity()) 00524 return assign(refinement); 00525 PPL_DIRTY_TEMP(Boundary, u); 00526 Result result = sub_2exp_assign_r(u, upper(), w, ROUND_UP); 00527 if (!result_overflow(result) && u > lower()) 00528 return assign(refinement); 00529 info().clear(); 00530 switch (r) { 00531 case UNSIGNED: 00532 umod_2exp_assign(LOWER, lower(), info(), 00533 LOWER, lower(), info(), w); 00534 umod_2exp_assign(UPPER, upper(), info(), 00535 UPPER, upper(), info(), w); 00536 break; 00537 case SIGNED_2_COMPLEMENT: 00538 smod_2exp_assign(LOWER, lower(), info(), 00539 LOWER, lower(), info(), w); 00540 smod_2exp_assign(UPPER, upper(), info(), 00541 UPPER, upper(), info(), w); 00542 break; 00543 default: 00544 PPL_ASSERT(false); 00545 break; 00546 } 00547 if (le(LOWER, lower(), info(), UPPER, upper(), info())) 00548 return intersect_assign(refinement); 00549 PPL_DIRTY_TEMP(Interval, tmp); 00550 tmp.info().clear(); 00551 Boundary_NS::assign(LOWER, tmp.lower(), tmp.info(), 00552 LOWER, lower(), info()); 00553 set_unbounded(UPPER, tmp.upper(), tmp.info()); 00554 tmp.intersect_assign(refinement); 00555 lower_extend(); 00556 intersect_assign(refinement); 00557 return join_assign(tmp); 00558 }
| void swap | ( | Parma_Polyhedra_Library::Interval< Boundary, Info > & | x, | |
| Parma_Polyhedra_Library::Interval< Boundary, Info > & | y | |||
| ) | [related] |
Definition at line 1198 of file Interval.inlines.hh.
References Parma_Polyhedra_Library::Interval< Boundary, Info >::swap().
01199 { 01200 x.swap(y); 01201 }
Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_ [private] |
Definition at line 838 of file Interval.defs.hh.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::lower().
Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_ [private] |
Definition at line 839 of file Interval.defs.hh.
Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().
1.6.3