Parma_Polyhedra_Library::Interval< Boundary, Info > Class Template Reference
[C++ Language Interface]

A generic, not necessarily closed, possibly restricted interval. More...

#include <Interval.defs.hh>

Inheritance diagram for Parma_Polyhedra_Library::Interval< Boundary, Info >:

Inheritance graph
[legend]
Collaboration diagram for Parma_Polyhedra_Library::Interval< Boundary, Info >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef Boundary boundary_type
typedef Info info_type
typedef Interval_NS::Property Property

Public Member Functions

void lower_load ()
void upper_load ()
void complete_init ()
void complete_init_internal ()
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
Ternary is_empty_cached () const
Ternary is_singleton_cached () const
bool is_empty () const
bool is_singleton () const
bool has_restriction () const
I_Result normalize () const
bool lower_is_open () const
bool upper_is_open () const
Result lower_shrink ()
Result upper_shrink ()
bool lower_is_unbounded () const
bool upper_is_unbounded () const
bool is_unbounded () const
bool is_universe () const
void invalidate_cardinality_cache () const
template<typename T>
Result lower_set_uninit (const T &x, bool open=false)
Result lower_set_uninit (const Unbounded &)
template<typename T>
Result lower_set (const T &x, bool open=false)
Result lower_set (const Unbounded &)
template<typename T>
Result lower_narrow (const T &x, bool open=false)
template<typename T>
Result lower_widen (const T &x, bool open=false)
Result lower_widen (const Unbounded &)
template<typename T>
Result upper_set_uninit (const T &x, bool open=false)
Result upper_set_uninit (const Unbounded &)
template<typename T>
Result upper_set (const T &x, bool open=false)
Result upper_set (const Unbounded &)
template<typename T>
Result upper_narrow (const T &x, bool open=false)
template<typename T>
Result upper_widen (const T &x, bool open=false)
Result upper_widen (const Unbounded &)
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.
bool is_infinity () const
bool contains_integer_point () const
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)
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 From1, typename From2>
I_Result assign (const From1 &l, const From2 &u)
template<typename From>
Enable_If< Is_Singleton< From >
::value||Is_Interval< From >
::value, I_Result >::type 
assign (const From &x)
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 
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)

Private Member Functions

 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
bool is_empty_nocache () const
bool is_singleton_nocache () 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)


Detailed Description

template<typename Boundary, typename Info>
class Parma_Polyhedra_Library::Interval< Boundary, Info >

A generic, not necessarily closed, possibly restricted interval.

FIXME: to be written.

Definition at line 92 of file Interval.defs.hh.


Member Typedef Documentation

template<typename Boundary, typename Info>
typedef Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::boundary_type

Definition at line 150 of file Interval.defs.hh.

template<typename Boundary, typename Info>
typedef Info Parma_Polyhedra_Library::Interval< Boundary, Info >::info_type

Definition at line 151 of file Interval.defs.hh.

template<typename Boundary, typename Info>
typedef Interval_NS::Property Parma_Polyhedra_Library::Interval< Boundary, Info >::Property

Definition at line 153 of file Interval.defs.hh.


Constructor & Destructor Documentation

template<typename Boundary, typename Info>
Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval (  )  [inline]

Definition at line 755 of file Interval.defs.hh.

00757     : lower_loaded(0), upper_loaded(0), completed(0)
00758 #endif
00759   {
00760   }

template<typename Boundary, typename Info>
template<typename T>
Parma_Polyhedra_Library::Interval< Boundary, Info >::Interval ( const T &  x  )  [inline, explicit]

Definition at line 763 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign().

00765     : lower_loaded(0), upper_loaded(0), completed(0)
00766 #endif
00767   {
00768     assign(x);
00769   }


Member Function Documentation

template<typename Boundary, typename Info>
Parma_Polyhedra_Library::Interval< Boundary, Info >::COMPILE_TIME_CHECK ( !Info::store_special||!std::numeric_limits< Boundary >::has_infinity  ,
"store_special is meaningless"" when boundary type may contains infinity"   
) [private]

template<typename Boundary, typename Info>
Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::w_info (  )  const [inline, private]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty_nocache (  )  const [inline, private]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_nocache (  )  const [inline, private]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize (  )  const [inline, private]

Definition at line 107 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 >::w_info().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize().

00107                                  {
00108     Result r;
00109     if (info().get_boundary_property(LOWER, NORMALIZED)
00110         || info().get_boundary_property(LOWER, SPECIAL))
00111       r = V_EQ;
00112     else {
00113       if (info().get_boundary_property(LOWER, OPEN)) {
00114         r = info().restrict(lower(), V_GT);
00115         if (r != V_GT)
00116           w_info().set_boundary_property(LOWER, OPEN, false);
00117       }
00118       else {
00119         r = info().restrict(lower(), V_GE);
00120         if (r == V_GT)
00121           w_info().set_boundary_property(LOWER, OPEN);
00122       }
00123       w_info().set_boundary_property(LOWER, NORMALIZED);
00124     }
00125     return r;
00126   }

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize (  )  const [inline, private]

Definition at line 127 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), 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().

00127                                  {
00128     Result r;
00129     if (info().get_boundary_property(UPPER, NORMALIZED)
00130         || info().get_boundary_property(UPPER, SPECIAL))
00131       r = V_EQ;
00132     else {
00133       if (info().get_boundary_property(UPPER, OPEN)) {
00134         r = info().restrict(upper(), V_LT);
00135         if (r != V_LT)
00136           w_info().set_boundary_property(UPPER, OPEN, false);
00137       }
00138       else {
00139         r = info().restrict(upper(), V_LE);
00140         if (r == V_LT)
00141           w_info().set_boundary_property(UPPER, OPEN);
00142       }
00143       w_info().set_boundary_property(UPPER, NORMALIZED);
00144     }
00145     return r;
00146   }

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_load (  )  [inline]

Definition at line 155 of file Interval.defs.hh.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit().

00155                     {
00156 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
00157     lower_loaded = 1;
00158 #endif
00159   }

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_load (  )  [inline]

Definition at line 161 of file Interval.defs.hh.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit().

00161                     {
00162 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
00163     upper_loaded = 1;
00164 #endif
00165   }

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init (  )  [inline]

Definition at line 167 of file Interval.defs.hh.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::assign().

00167                        {
00168 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
00169     assert(lower_loaded);
00170     assert(upper_loaded);
00171     completed = 1;
00172 #endif
00173   }

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal (  )  [inline]

template<typename Boundary, typename Info>
template<typename T>
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 185 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign().

00185                         {
00186     assign(x);
00187     return *this;
00188   }

template<typename Boundary, typename Info>
template<typename T>
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 192 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign().

00192                          {
00193     add_assign(*this, x);
00194     return *this;
00195   }

template<typename Boundary, typename Info>
template<typename T>
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 198 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::sub_assign().

00198                          {
00199     sub_assign(*this, x);
00200     return *this;
00201   }

template<typename Boundary, typename Info>
template<typename T>
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 204 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign().

00204                          {
00205     mul_assign(*this, x);
00206     return *this;
00207   }

template<typename Boundary, typename Info>
template<typename T>
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 210 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign().

00210                          {
00211     div_assign(*this, x);
00212     return *this;
00213   }

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::swap ( Interval< Boundary, Info > &  y  )  [inline]

template<typename Boundary, typename Info>
Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::info (  )  [inline]

Definition at line 218 of file Interval.defs.hh.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), 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 >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign(), 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_cached(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_cached(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_shrink(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_widen(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), 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_existential(), 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 >::sub_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::swap(), Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_widen().

00218                {
00219     return *this;
00220   }

template<typename Boundary, typename Info>
const Info& Parma_Polyhedra_Library::Interval< Boundary, Info >::info (  )  const [inline]

Definition at line 222 of file Interval.defs.hh.

00222                            {
00223     return *this;
00224   }

template<typename Boundary, typename Info>
Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::lower (  )  [inline]

Definition at line 226 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), 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 >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign(), 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_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_shrink(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_widen(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), 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 >::sub_assign(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::swap().

00226                     {
00227     return lower_;
00228   }

template<typename Boundary, typename Info>
const Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::lower (  )  const [inline]

Definition at line 230 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_.

00230                                 {
00231     return lower_;
00232   }

template<typename Boundary, typename Info>
Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::upper (  )  [inline]

Definition at line 234 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_.

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), 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 >::contains(), Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::div_assign(), 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_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), 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 >::sub_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::swap(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_widen().

00234                     {
00235     return upper_;
00236   }

template<typename Boundary, typename Info>
const Boundary& Parma_Polyhedra_Library::Interval< Boundary, Info >::upper (  )  const [inline]

Definition at line 238 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_.

00238                                 {
00239     return upper_;
00240   }

template<typename Boundary, typename Info>
Ternary Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty_cached (  )  const [inline]

template<typename Boundary, typename Info>
Ternary Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_cached (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::has_restriction (  )  const [inline]

template<typename Boundary, typename Info>
I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open (  )  const [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_shrink (  )  [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink (  )  [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_unbounded (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_unbounded (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_unbounded (  )  const [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe (  )  const [inline]

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache (  )  const [inline]

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit ( const Unbounded &   )  [inline]

Definition at line 372 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 >::lower_load().

00372                                             {
00373     info().clear_boundary_properties(LOWER);
00374     Result rl = set_unbounded(LOWER, lower(), info());
00375     lower_load();
00376     return rl;
00377   }

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set ( const Unbounded &   )  [inline]

Definition at line 389 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::OK().

00389                                      {
00390     assert(OK());
00391     info().clear_boundary_properties(LOWER);
00392     Result rl = set_unbounded(LOWER, lower(), info());
00393     invalidate_cardinality_cache();
00394     assert(OK());
00395     return rl;
00396   }

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_narrow ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_widen ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_widen ( const Unbounded &   )  [inline]

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit ( const Unbounded &   )  [inline]

Definition at line 432 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_load().

00432                                             {
00433     info().clear_boundary_properties(UPPER);
00434     Result rl = set_unbounded(UPPER, upper(), info());
00435     upper_load();
00436     return rl;
00437   }

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set ( const Unbounded &   )  [inline]

Definition at line 449 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

00449                                      {
00450     assert(OK());
00451     info().clear_boundary_properties(UPPER);
00452     Result rl = set_unbounded(UPPER, upper(), info());
00453     invalidate_cardinality_cache();
00454     assert(OK());
00455     return rl;
00456   }

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_narrow ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
template<typename T>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_widen ( const T &  x,
bool  open = false 
) [inline]

template<typename Boundary, typename Info>
Result Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_widen ( const Unbounded &   )  [inline]

template<typename Boundary, typename Info>
I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::assign ( Degenerate_Element  e  )  [inline]

Definition at line 485 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval_NS::CARDINALITY_0, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_1, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_IS, Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init(), Parma_Polyhedra_Library::EMPTY, Parma_Polyhedra_Library::I_EMPTY, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set_uninit(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), Parma_Polyhedra_Library::UNIVERSE, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set_uninit().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::difference_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::div_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 >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::operator=(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::sub_assign().

00485                                         {
00486     I_Result r;
00487     Result rl, ru;
00488     info().clear();
00489     switch (e) {
00490     case EMPTY:
00491       info().set_interval_property(CARDINALITY_IS);
00492       info().set_interval_property(CARDINALITY_0);
00493       lower_set_uninit(1);
00494       upper_set_uninit(0);
00495       r = I_EMPTY;
00496       break;
00497     case UNIVERSE:
00498       info().set_interval_property(CARDINALITY_0, true);
00499       info().set_interval_property(CARDINALITY_1, true);
00500       rl = lower_set_uninit(UNBOUNDED);
00501       ru = upper_set_uninit(UNBOUNDED);
00502       r = combine(rl, ru);
00503       break;
00504     default:
00505       assert(0);
00506       r = I_EMPTY;
00507       break;
00508     }
00509     complete_init();
00510     assert(OK());
00511     return r;
00512   }

template<typename To_Boundary, typename To_Info>
template<typename From>
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 515 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval_NS::CARDINALITY_0, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_1, Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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().

00515                                                                               {
00516     info().clear();
00517     info().set_interval_property(CARDINALITY_0, true);
00518     info().set_interval_property(CARDINALITY_1, true);
00519     Result rl, ru;
00520     switch (From::code) {
00521     case VC_MINUS_INFINITY:
00522       rl = Boundary_NS::set_minus_infinity(LOWER, lower(), info());
00523       ru = Boundary_NS::set_minus_infinity(UPPER, upper(), info());
00524       break;
00525     case VC_PLUS_INFINITY:
00526       rl = Boundary_NS::set_plus_infinity(LOWER, lower(), info());
00527       ru = Boundary_NS::set_plus_infinity(UPPER, upper(), info());
00528       break;
00529     default:
00530       assert(0);
00531       rl = VC_NAN;
00532       ru = VC_NAN;
00533     }
00534     complete_init_internal();
00535     assert(OK());
00536     return combine(rl, ru);
00537   }

template<typename Boundary, typename Info>
I_Result Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities (  )  [inline]

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_topologically_closed (  )  const [inline]

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::topological_closure_assign (  )  [inline]

Assigns to *this its topological closure.

Definition at line 560 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_unbounded(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_unbounded().

00560                                     {
00561     if (!Info::store_open || is_empty())
00562       return;
00563 
00564     if (!lower_is_unbounded())
00565       info().set_boundary_property(LOWER, OPEN, false);
00566 
00567     if (!upper_is_unbounded())
00568       info().set_boundary_property(UPPER, OPEN, false);
00569   }

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::is_infinity (  )  const [inline]

Definition at line 571 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().

00571                            {
00572     assert(OK());
00573     if (is_reverse_infinity(LOWER, lower(), info()))
00574       return 1;
00575     else if (is_reverse_infinity(UPPER, upper(), info()))
00576       return -1;
00577     else
00578       return 0;
00579   }

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::contains_integer_point (  )  const [inline]

Definition at line 581 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_unbounded(), 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().

00581                                       {
00582     assert(OK());
00583     if (is_empty())
00584       return false;
00585     if (is_unbounded())
00586       return true;
00587     Boundary l;
00588     if (lower_is_open()) {
00589       add_assign_r(l, lower(), Boundary(1), ROUND_DOWN);
00590       floor_assign_r(l, l, ROUND_DOWN);
00591     }
00592     else
00593       ceil_assign_r(l, lower(), ROUND_DOWN);
00594     Boundary u;
00595     if (upper_is_open()) {
00596       sub_assign_r(u, upper(), Boundary(1), ROUND_UP);
00597       ceil_assign_r(u, u, ROUND_UP);
00598     }
00599     else
00600       floor_assign_r(u, upper(), ROUND_UP);
00601     return u >= l;
00602   }

template<typename Boundary, typename Info>
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 37 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes().

00037                                                       {
00038   return sizeof(*this) + external_memory_in_bytes();
00039 }

template<typename Boundary, typename Info>
memory_size_type Parma_Polyhedra_Library::Interval< Boundary, Info >::external_memory_in_bytes (  )  const [inline]

template<typename Boundary, typename Info>
void Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_dump ( std::ostream &  s  )  const [inline]

Definition at line 1166 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().

01166                                                         {
01167   using Parma_Polyhedra_Library::ascii_dump;
01168   s << "info ";
01169   info().ascii_dump(s);
01170   s << " lower ";
01171   ascii_dump(s, lower());
01172   s << " upper ";
01173   ascii_dump(s, upper());
01174   s << '\n';
01175 }

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::ascii_load ( std::istream &  s  )  [inline]

Definition at line 1179 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::ascii_load(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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().

01179                                                   {
01180   using Parma_Polyhedra_Library::ascii_load;
01181   std::string str;
01182   if (!(s >> str) || str != "info")
01183     return false;
01184   if (!info().ascii_load(s))
01185     return false;
01186   if (!(s >> str) || str != "lower")
01187     return false;
01188   if (!ascii_load(s, lower()))
01189     return false;
01190   if (!(s >> str) || str != "upper")
01191     return false;
01192   if (!ascii_load(s, upper()))
01193     return false;
01194 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
01195   complete_init_internal();
01196 #endif
01197   assert(OK());
01198   return true;
01199 }

template<typename Boundary, typename Info>
bool Parma_Polyhedra_Library::Interval< Boundary, Info >::OK (  )  const [inline]

Definition at line 613 of file Interval.defs.hh.

References Parma_Polyhedra_Library::Interval_NS::CARDINALITY_0, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_1, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_IS, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty_cached(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_empty_nocache(), 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 >::is_singleton_cached(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_singleton_nocache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::T_NO, Parma_Polyhedra_Library::T_YES, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::add_assign(), 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 >::div_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), 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_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::is_universe(), Parma_Polyhedra_Library::Interval< Boundary, Info >::join_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_shrink(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_widen(), Parma_Polyhedra_Library::Interval< Boundary, Info >::mul_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::neg_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::normalize(), Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), 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 >::sub_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_open(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_is_unbounded(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_narrow(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_set(), Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_widen().

00613                   {
00614 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
00615     if (!completed) {
00616         std::cerr << "The interval initialization has not been completed."
00617                   << std::endl;
00618         return false;
00619     }
00620 #endif
00621 #if 0
00622     if (!Info::may_be_empty && is_empty()) {
00623 #ifndef NDEBUG
00624         std::cerr << "The interval is unexpectedly empty.\n";
00625 #endif
00626         return false;
00627     }
00628 #endif
00629 
00630     if (is_open(LOWER, lower(), info())) {
00631       if (is_plus_infinity(LOWER, lower(), info())) {
00632 #ifndef NDEBUG
00633         std::cerr << "The lower boundary is +inf open.\n";
00634 #endif
00635       }
00636     }
00637     else if (!Info::may_contain_infinity
00638              && (is_minus_infinity(LOWER, lower(), info())
00639                  || is_plus_infinity(LOWER, lower(), info()))) {
00640 #ifndef NDEBUG
00641       std::cerr << "The lower boundary is unexpectedly infinity.\n";
00642 #endif
00643       return false;
00644     }
00645     if (!info().get_boundary_property(LOWER, SPECIAL)) {
00646       if (is_not_a_number(lower())) {
00647 #ifndef NDEBUG
00648         std::cerr << "The lower boundary is not a number.\n";
00649 #endif
00650         return false;
00651       }
00652 #if 0
00653       if (info().get_boundary_property(LOWER, NORMALIZED)
00654           && !info().is_restricted(lower())) {
00655 #ifndef NDEBUG
00656         std::cerr << "The lower boundary is marked to be normalized, "
00657                   << "but it is not.\n";
00658 #endif
00659         return false;
00660       }
00661 #endif
00662     }
00663 
00664     if (is_open(UPPER, upper(), info())) {
00665       if (is_minus_infinity(UPPER, upper(), info())) {
00666 #ifndef NDEBUG
00667         std::cerr << "The upper boundary is -inf open.\n";
00668 #endif
00669       }
00670     }
00671     else if (!Info::may_contain_infinity
00672              && (is_minus_infinity(UPPER, upper(), info())
00673                  || is_plus_infinity(UPPER, upper(), info()))) {
00674 #ifndef NDEBUG
00675       std::cerr << "The upper boundary is unexpectedly infinity."
00676                 << std::endl;
00677 #endif
00678       return false;
00679     }
00680     if (!info().get_boundary_property(UPPER, SPECIAL)) {
00681       if (is_not_a_number(upper())) {
00682 #ifndef NDEBUG
00683         std::cerr << "The upper boundary is not a number.\n";
00684 #endif
00685         return false;
00686       }
00687 #if 0
00688       if (info().get_boundary_property(UPPER, NORMALIZED)
00689           && !info().is_restricted(upper())) {
00690 #ifndef NDEBUG
00691         std::cerr << "The upper boundary is marked to be normalized, "
00692                   << "but it is not.\n";
00693 #endif
00694         return false;
00695       }
00696 #endif
00697     }
00698 
00699     Ternary t;
00700 
00701     t = is_empty_cached();
00702     if (t == T_YES) {
00703       if (!is_empty_nocache()) {
00704 #ifndef NDEBUG
00705         std::cerr << "The interval is marked to be empty, "
00706                   << "but actually it is not empty.\n";
00707 #endif
00708         return false;
00709       }
00710     }
00711     else if (t == T_NO) {
00712       if (is_empty_nocache()) {
00713 #ifndef NDEBUG
00714         std::cerr << "The interval is marked to be not empty, "
00715                   << "but actually it is empty.\n";
00716 #endif
00717         return false;
00718       }
00719     }
00720 
00721     t = is_singleton_cached();
00722     if (t == T_YES) {
00723       if (!is_singleton_nocache()) {
00724 #ifndef NDEBUG
00725         std::cerr << "The interval is marked to be singleton, "
00726                   << "but actually it is not singleton.\n";
00727 #endif
00728         return false;
00729       }
00730     }
00731     else if (t == T_NO) {
00732       if (is_singleton_nocache()) {
00733 #ifndef NDEBUG
00734         std::cerr << "The interval is marked to be not singleton, "
00735                   << "but actually it is singleton.\n";
00736 #endif
00737         return false;
00738       }
00739     }
00740 
00741     if (info().get_interval_property(CARDINALITY_IS) &&
00742         info().get_interval_property(CARDINALITY_0)
00743         == info().get_interval_property(CARDINALITY_1)) {
00744 #ifndef NDEBUG
00745       std::cerr << "The interval is marked to know its cardinality, "
00746                 << "but this is unspecified or ambiguous.\n";
00747 #endif
00748       return false;
00749     }
00750 
00751     // Everything OK.
00752     return true;
00753   }

template<typename Boundary, typename Info>
template<typename T>
Enable_If< Is_Singleton< T >::value||Is_Interval< T >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::contains ( const T &  y  )  const [inline]

template<typename Boundary, typename Info>
template<typename T>
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]

template<typename Boundary, typename Info>
template<typename T>
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]

template<typename To_Boundary, typename To_Info>
template<typename From1, typename From2>
I_Result Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::assign ( const From1 &  l,
const From2 &  u 
) [inline]

template<typename Boundary, typename Info>
template<typename From>
Enable_If<Is_Singleton<From>::value || Is_Interval<From>::value, I_Result>::type Parma_Polyhedra_Library::Interval< Boundary, Info >::assign ( const From &  x  )  [inline]

template<typename To_Boundary, typename To_Info>
template<typename From>
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 309 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval_NS::CARDINALITY_0, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_1, Parma_Polyhedra_Library::Interval_NS::CARDINALITY_IS, 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(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

00309                                                          {
00310   assert(f_OK(x));
00311   if (check_empty_arg(*this))
00312     return assign(x);
00313   if (check_empty_arg(x))
00314     return combine(V_EQ, V_EQ);
00315   if (!join_restriction(info(), *this, x))
00316     return assign(EMPTY);
00317   info().set_interval_property(CARDINALITY_IS, false);
00318   info().set_interval_property(CARDINALITY_0);
00319   info().set_interval_property(CARDINALITY_1, false);
00320   Result rl, ru;
00321   rl = min_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
00322   ru = max_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
00323   assert(OK());
00324   return combine(rl, ru);
00325 }

template<typename To_Boundary, typename To_Info>
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 Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::join_assign ( const From1 &  x,
const From2 &  y 
) [inline]

Definition at line 333 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::Interval_NS::CARDINALITY_0, Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

00333                                                                           {
00334   assert(f_OK(x));
00335   assert(f_OK(y));
00336   if (check_empty_arg(x))
00337     return assign(y);
00338   if (check_empty_arg(y))
00339     return assign(x);
00340   DIRTY_TEMP(To_Info, to_info);
00341   to_info.clear();
00342   if (!join_restriction(to_info, x, y))
00343     return assign(EMPTY);
00344   to_info.set_interval_property(CARDINALITY_0);
00345   Result rl, ru;
00346   rl = min_assign(LOWER, lower(), to_info,
00347                   LOWER, f_lower(x), f_info(x),
00348                   LOWER, f_lower(y), f_info(y));
00349   ru = max_assign(UPPER, upper(), to_info,
00350                   UPPER, f_upper(x), f_info(x),
00351                   UPPER, f_upper(y), f_info(y));
00352   assign_or_swap(info(), to_info);
00353   complete_init_internal();
00354   assert(OK());
00355   return combine(rl, ru);
00356 }

template<typename To_Boundary, typename To_Info>
template<typename From>
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 362 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_result(), 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::intersect_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::max_assign(), Parma_Polyhedra_Library::min_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_existential(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::refine_universal().

00362                                                               {
00363   assert(f_OK(x));
00364   if (!intersect_restriction(info(), *this, x))
00365     return assign(EMPTY);
00366   // FIXME: more accurate?
00367   invalidate_cardinality_cache();
00368   Result rl, ru;
00369   rl = max_assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
00370   ru = min_assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
00371   assert(OK());
00372   // The following Parma_Polyhedra_Library:: qualification is to work
00373   // around a bug in version 10.0 of the Intel C/C++ compiler.
00374   return Parma_Polyhedra_Library::check_empty_result(*this, combine(rl, ru));
00375 }

template<typename To_Boundary, typename To_Info>
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 Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::intersect_assign ( const From1 &  x,
const From2 &  y 
) [inline]

Definition at line 383 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_result(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

00384                                                                  {
00385   assert(f_OK(x));
00386   assert(f_OK(y));
00387   DIRTY_TEMP(To_Info, to_info);
00388   to_info.clear();
00389   if (!intersect_restriction(to_info, x, y))
00390     return assign(EMPTY);
00391   Result rl, ru;
00392   rl = max_assign(LOWER, lower(), to_info,
00393                   LOWER, f_lower(x), f_info(x),
00394                   LOWER, f_lower(y), f_info(y));
00395   ru = min_assign(UPPER, upper(), to_info,
00396                   UPPER, f_upper(x), f_info(x),
00397                   UPPER, f_upper(y), f_info(y));
00398   assign_or_swap(info(), to_info);
00399   complete_init_internal();
00400   assert(OK());
00401   // The following Parma_Polyhedra_Library:: qualification is to work
00402   // around a bug in version 10.0 of the Intel C/C++ compiler.
00403   return Parma_Polyhedra_Library::check_empty_result(*this, combine(rl, ru));
00404 }

template<typename To_Boundary, typename To_Info>
template<typename From>
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 410 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::Interval< Boundary, Info >::invalidate_cardinality_cache(), 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().

00410                                                                {
00411   assert(f_OK(x));
00412   // FIXME: restrictions
00413   if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)) ||
00414       gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
00415     return combine(V_EQ, V_EQ);
00416   bool nl = ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
00417   bool nu = le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
00418   Result rl = V_EQ, ru = V_EQ;
00419   if (nl) {
00420     if (nu)
00421       return assign(EMPTY);
00422     else {
00423       invalidate_cardinality_cache();
00424       info().clear_boundary_properties(LOWER);
00425       rl = complement(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x));
00426     }
00427   }
00428   else if (nu) {
00429     invalidate_cardinality_cache();
00430     info().clear_boundary_properties(UPPER);
00431     ru = complement(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x));
00432   }
00433   assert(OK());
00434   return combine(rl, ru);
00435 }

template<typename To_Boundary, typename To_Info>
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 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 443 of file Interval.inlines.hh.

References assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

00444                                                                   {
00445   assert(f_OK(x));
00446   assert(f_OK(y));
00447   DIRTY_TEMP(To_Info, to_info);
00448   to_info.clear();
00449   // FIXME: restrictions
00450   if (lt(UPPER, f_upper(x), f_info(x), LOWER, f_lower(y), f_info(y)) ||
00451       gt(LOWER, f_lower(x), f_info(x), UPPER, f_upper(y), f_info(y)))
00452     return assign(x);
00453   bool nl = ge(LOWER, f_lower(x), f_info(x), LOWER, f_lower(y), f_info(y));
00454   bool nu = le(UPPER, f_upper(x), f_info(x), UPPER, f_upper(y), f_info(y));
00455   Result rl = V_EQ, ru = V_EQ;
00456   if (nl) {
00457     if (nu)
00458       return assign(EMPTY);
00459     else {
00460       rl = complement(LOWER, lower(), info(), UPPER, f_upper(y), f_info(y));
00461       ru = Boundary_NS::assign(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x));
00462     }
00463   }
00464   else if (nu) {
00465     ru = complement(UPPER, upper(), info(), LOWER, f_lower(y), f_info(y));
00466     rl = Boundary_NS::assign(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x));
00467   }
00468   assign_or_swap(info(), to_info);
00469   complete_init_internal();
00470   assert(OK());
00471   return combine(rl, ru);
00472 }

template<typename To_Boundary, typename To_Info>
template<typename From>
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

\[ \{\, a \in \mathtt{to} \mid \exists b \in \mathtt{x} \st a \mathrel{\mathtt{rel}} b \,\}. \]

Returns:
???

Definition at line 479 of file Interval.inlines.hh.

References assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::check_empty_result(), 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::I_EMPTY, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache(), 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::Interval< Boundary, Info >::lower_shrink(), 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 >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink().

00479                                                        {
00480   assert(OK());
00481   assert(f_OK(x));
00482   if (check_empty_arg(x))
00483     return assign(EMPTY);
00484   switch (rel) {
00485   case LESS_THAN:
00486     {
00487       if (lt(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
00488         return combine(V_EQ, V_EQ);
00489       info().clear_boundary_properties(UPPER);
00490       Result ru = Boundary_NS::assign(UPPER, upper(), info(),
00491                                       UPPER, f_upper(x), f_info(x), true);
00492       invalidate_cardinality_cache();
00493       normalize();
00494       // The following Parma_Polyhedra_Library:: qualification is to work
00495       // around a bug in version 10.0 of the Intel C/C++ compiler.
00496       return Parma_Polyhedra_Library::check_empty_result(*this,
00497                                                          combine(V_EQ, ru));
00498     }
00499   case LESS_OR_EQUAL:
00500     {
00501       if (le(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
00502         return combine(V_EQ, V_EQ);
00503       info().clear_boundary_properties(UPPER);
00504       Result ru = Boundary_NS::assign(UPPER, upper(), info(),
00505                                       UPPER, f_upper(x), f_info(x));
00506       invalidate_cardinality_cache();
00507       normalize();
00508       // The following Parma_Polyhedra_Library:: qualification is to work
00509       // around a bug in version 10.0 of the Intel C/C++ compiler.
00510       return Parma_Polyhedra_Library::check_empty_result(*this,
00511                                                          combine(V_EQ, ru));
00512     }
00513   case GREATER_THAN:
00514     {
00515       if (gt(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
00516         return combine(V_EQ, V_EQ);
00517       info().clear_boundary_properties(LOWER);
00518       Result rl = Boundary_NS::assign(LOWER, lower(), info(),
00519                                       LOWER, f_lower(x), f_info(x), true);
00520       invalidate_cardinality_cache();
00521       normalize();
00522       // The following Parma_Polyhedra_Library:: qualification is to work
00523       // around a bug in version 10.0 of the Intel C/C++ compiler.
00524       return Parma_Polyhedra_Library::check_empty_result(*this,
00525                                                          combine(rl, V_EQ));
00526     }
00527   case GREATER_OR_EQUAL:
00528     {
00529       if (ge(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
00530         return combine(V_EQ, V_EQ);
00531       info().clear_boundary_properties(LOWER);
00532       Result rl = Boundary_NS::assign(LOWER, lower(), info(),
00533                                       LOWER, f_lower(x), f_info(x));
00534       invalidate_cardinality_cache();
00535       normalize();
00536       // The following Parma_Polyhedra_Library:: qualification is to work
00537       // around a bug in version 10.0 of the Intel C/C++ compiler.
00538       return Parma_Polyhedra_Library::check_empty_result(*this,
00539                                                          combine(rl, V_EQ));
00540     }
00541   case EQUAL:
00542     return intersect_assign(x);
00543   case NOT_EQUAL:
00544     {
00545       if (!f_is_singleton(x))
00546         return combine(V_EQ, V_EQ);
00547       if (check_empty_arg(*this))
00548         return I_EMPTY;
00549       if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
00550         lower_shrink();
00551       if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
00552         upper_shrink();
00553       invalidate_cardinality_cache();
00554       normalize();
00555       // The following Parma_Polyhedra_Library:: qualification is to work
00556       // around a bug in version 10.0 of the Intel C/C++ compiler.
00557       return Parma_Polyhedra_Library::check_empty_result(*this,
00558                                                          combine(V_EQ, V_EQ));
00559     }
00560   default:
00561     assert(false);
00562     return I_EMPTY;
00563   }
00564 }

template<typename To_Boundary, typename To_Info>
template<typename From>
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

\[ \{\, a \in \mathtt{to} \mid \forall b \in \mathtt{x} \itc a \mathrel{\mathtt{rel}} b \,\}. \]

Returns:
???

Definition at line 570 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::check_empty_result(), 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::I_EMPTY, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::Interval< Boundary, Info >::intersect_assign(), Parma_Polyhedra_Library::Interval< Boundary, Info >::invalidate_cardinality_cache(), 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::Interval< Boundary, Info >::lower_shrink(), 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_NS::SCALAR_INFO, Parma_Polyhedra_Library::Interval< Boundary, Info >::upper(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_shrink().

00571                                                                 {
00572   assert(OK());
00573   assert(f_OK(x));
00574   if (check_empty_arg(x))
00575     return combine(V_EQ, V_EQ);
00576   switch (rel) {
00577   case LESS_THAN:
00578     {
00579       if (lt(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)))
00580         return combine(V_EQ, V_EQ);
00581       info().clear_boundary_properties(UPPER);
00582       Result ru = Boundary_NS::assign(UPPER, upper(), info(),
00583                                       LOWER, f_lower(x), SCALAR_INFO, !is_open(LOWER, f_lower(x), f_info(x)));
00584       invalidate_cardinality_cache();
00585       normalize();
00586       // The following Parma_Polyhedra_Library:: qualification is to work
00587       // around a bug in version 10.0 of the Intel C/C++ compiler.
00588       return Parma_Polyhedra_Library::check_empty_result(*this,
00589                                                          combine(V_EQ, ru));
00590     }
00591   case LESS_OR_EQUAL:
00592     {
00593       if (le(UPPER, upper(), info(), LOWER, f_lower(x), f_info(x)))
00594         return combine(V_EQ, V_EQ);
00595       info().clear_boundary_properties(UPPER);
00596       Result ru = Boundary_NS::assign(UPPER, upper(), info(),
00597                                       LOWER, f_lower(x), SCALAR_INFO);
00598       invalidate_cardinality_cache();
00599       normalize();
00600       // The following Parma_Polyhedra_Library:: qualification is to work
00601       // around a bug in version 10.0 of the Intel C/C++ compiler.
00602       return Parma_Polyhedra_Library::check_empty_result(*this,
00603                                                          combine(V_EQ, ru));
00604     }
00605   case GREATER_THAN:
00606     {
00607       if (gt(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
00608         return combine(V_EQ, V_EQ);
00609       info().clear_boundary_properties(LOWER);
00610       Result rl = Boundary_NS::assign(LOWER, lower(), info(),
00611                                       UPPER, f_upper(x), SCALAR_INFO, !is_open(UPPER, f_upper(x), f_info(x)));
00612       invalidate_cardinality_cache();
00613       normalize();
00614       // The following Parma_Polyhedra_Library:: qualification is to work
00615       // around a bug in version 10.0 of the Intel C/C++ compiler.
00616       return Parma_Polyhedra_Library::check_empty_result(*this,
00617                                                          combine(rl, V_EQ));
00618     }
00619   case GREATER_OR_EQUAL:
00620     {
00621       if (ge(LOWER, lower(), info(), UPPER, f_upper(x), f_info(x)))
00622         return combine(V_EQ, V_EQ);
00623       info().clear_boundary_properties(LOWER);
00624       Result rl = Boundary_NS::assign(LOWER, lower(), info(),
00625                                       UPPER, f_upper(x), SCALAR_INFO);
00626       invalidate_cardinality_cache();
00627       normalize();
00628       // The following Parma_Polyhedra_Library:: qualification is to work
00629       // around a bug in version 10.0 of the Intel C/C++ compiler.
00630       return Parma_Polyhedra_Library::check_empty_result(*this,
00631                                                          combine(rl, V_EQ));
00632     }
00633   case EQUAL:
00634     if (!f_is_singleton(x))
00635       return assign(EMPTY);
00636     return intersect_assign(x);
00637   case NOT_EQUAL:
00638     {
00639       if (check_empty_arg(*this))
00640         return I_EMPTY;
00641       if (eq(LOWER, lower(), info(), LOWER, f_lower(x), f_info(x)))
00642         lower_shrink();
00643       if (eq(UPPER, upper(), info(), UPPER, f_upper(x), f_info(x)))
00644         upper_shrink();
00645       invalidate_cardinality_cache();
00646       normalize();
00647       // The following Parma_Polyhedra_Library:: qualification is to work
00648       // around a bug in version 10.0 of the Intel C/C++ compiler.
00649       return Parma_Polyhedra_Library::check_empty_result(*this,
00650                                                          combine(V_EQ, V_EQ));
00651     }
00652   default:
00653     assert(false);
00654     return I_EMPTY;
00655   }
00656 }

template<typename To_Boundary, typename To_Info>
template<typename From>
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]

template<typename To_Boundary, typename To_Info>
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 Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::add_assign ( const From1 &  x,
const From2 &  y 
) [inline]

Definition at line 687 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::add_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::assign(), Parma_Polyhedra_Library::check_empty_arg(), Parma_Polyhedra_Library::combine(), Parma_Polyhedra_Library::Interval< Boundary, Info >::complete_init_internal(), 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::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), MINUS_INFINITY, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), PLUS_INFINITY, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::operator+(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator+=().

00687                                                                          {
00688   assert(f_OK(x));
00689   assert(f_OK(y));
00690   if (check_empty_arg(x) || check_empty_arg(y))
00691     return assign(EMPTY);
00692   int inf = Parma_Polyhedra_Library::is_infinity(x);
00693   if (inf) {
00694     if (Parma_Polyhedra_Library::is_infinity(y) == -inf)
00695       return assign(EMPTY);
00696   }
00697   else
00698     inf = Parma_Polyhedra_Library::is_infinity(y);
00699   if (inf < 0)
00700     return assign(MINUS_INFINITY);
00701   else if (inf > 0)
00702     return assign(PLUS_INFINITY);
00703   DIRTY_TEMP(To_Info, to_info);
00704   to_info.clear();
00705   if (!add_restriction(to_info, x, y))
00706     return assign(EMPTY);
00707   Result rl = Boundary_NS::add_assign(LOWER, lower(), to_info,
00708                                       LOWER, f_lower(x), f_info(x),
00709                                       LOWER, f_lower(y), f_info(y));
00710   Result ru = Boundary_NS::add_assign(UPPER, upper(), to_info,
00711                                       UPPER, f_upper(x), f_info(x),
00712                                       UPPER, f_upper(y), f_info(y));
00713   assign_or_swap(info(), to_info);
00714   complete_init_internal();
00715   assert(OK());
00716   return combine(rl, ru);
00717 }

template<typename To_Boundary, typename To_Info>
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 Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::sub_assign ( const From1 &  x,
const From2 &  y 
) [inline]

Definition at line 725 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::Interval< Boundary, Info >::complete_init_internal(), 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::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), MINUS_INFINITY, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), PLUS_INFINITY, Parma_Polyhedra_Library::sub_restriction(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::operator-(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator-=().

00725                                                                          {
00726   assert(f_OK(x));
00727   assert(f_OK(y));
00728   if (check_empty_arg(x) || check_empty_arg(y))
00729     return assign(EMPTY);
00730   int inf = Parma_Polyhedra_Library::is_infinity(x);
00731   if (inf) {
00732     if (Parma_Polyhedra_Library::is_infinity(y) == inf)
00733       return assign(EMPTY);
00734   }
00735   else
00736     inf = -Parma_Polyhedra_Library::is_infinity(y);
00737   if (inf < 0)
00738     return assign(MINUS_INFINITY);
00739   else if (inf > 0)
00740     return assign(PLUS_INFINITY);
00741 
00742   DIRTY_TEMP(To_Info, to_info);
00743   to_info.clear();
00744   if (!sub_restriction(to_info, x, y))
00745     return assign(EMPTY);
00746   Result rl, ru;
00747   DIRTY_TEMP(To_Boundary, to_lower);
00748   rl = Boundary_NS::sub_assign(LOWER, to_lower, to_info,
00749                                LOWER, f_lower(x), f_info(x),
00750                                UPPER, f_upper(y), f_info(y));
00751   ru = Boundary_NS::sub_assign(UPPER, upper(), to_info,
00752                                UPPER, f_upper(x), f_info(x),
00753                                LOWER, f_lower(y), f_info(y));
00754   assign_or_swap(lower(), to_lower);
00755   assign_or_swap(info(), to_info);
00756   complete_init_internal();
00757   assert(OK());
00758   return combine(rl, ru);
00759 }

template<typename To_Boundary, typename To_Info>
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 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 779 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::Interval< Boundary, Info >::complete_init_internal(), 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::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), Parma_Polyhedra_Library::Checked::lt(), MINUS_INFINITY, Parma_Polyhedra_Library::mul_restriction(), Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), PLUS_INFINITY, Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::operator*(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator*=().

00779                                                                          {
00780   assert(f_OK(x));
00781   assert(f_OK(y));
00782   if (check_empty_arg(x) || check_empty_arg(y))
00783     return assign(EMPTY);
00784   int xls = sgn_b(LOWER, f_lower(x), f_info(x));
00785   int xus = xls > 0 ? 1 : sgn_b(UPPER, f_upper(x), f_info(x));
00786   int yls = sgn_b(LOWER, f_lower(y), f_info(y));
00787   int yus = yls > 0 ? 1 : sgn_b(UPPER, f_upper(y), f_info(y));
00788   int inf = Parma_Polyhedra_Library::is_infinity(x);
00789   int ls, us;
00790   if (inf) {
00791     ls = yls;
00792     us = yus;
00793     goto inf;
00794   }
00795   else {
00796     inf = Parma_Polyhedra_Library::is_infinity(y);
00797     if (inf) {
00798       ls = xls;
00799       us = xus;
00800     inf:
00801       if (ls == 0 && us == 0)
00802         return assign(EMPTY);
00803       if (ls == -us)
00804         return set_infinities();
00805       if (ls < 0 || us < 0)
00806         inf = -inf;
00807       if (inf < 0)
00808         return assign(MINUS_INFINITY);
00809       else
00810         return assign(PLUS_INFINITY);
00811     }
00812   }
00813 
00814   DIRTY_TEMP(To_Info, to_info);
00815   to_info.clear();
00816   if (!mul_restriction(to_info, x, y))
00817     return assign(EMPTY);
00818   Result rl, ru;
00819   DIRTY_TEMP(To_Boundary, to_lower);
00820 
00821   if (xls >= 0) {
00822     if (yls >= 0) {
00823       // 0 <= xl <= xu, 0 <= yl <= yu
00824       rl = mul_assign_z(LOWER, to_lower, to_info,
00825                         LOWER, f_lower(x), f_info(x), xls,
00826                         LOWER, f_lower(y), f_info(y), yls);
00827       ru = mul_assign_z(UPPER, upper(), to_info,
00828                         UPPER, f_upper(x), f_info(x), xus,
00829                         UPPER, f_upper(y), f_info(y), yus);
00830     }
00831     else if (yus <= 0) {
00832       // 0 <= xl <= xu, yl <= yu <= 0
00833       rl = mul_assign_z(LOWER, to_lower, to_info,
00834                         UPPER, f_upper(x), f_info(x), xus,
00835                         LOWER, f_lower(y), f_info(y), yls);
00836       ru = mul_assign_z(UPPER, upper(), to_info,
00837                         LOWER, f_lower(x), f_info(x), xls,
00838                         UPPER, f_upper(y), f_info(y), yus);
00839     }
00840     else {
00841       // 0 <= xl <= xu, yl < 0 < yu
00842       rl = mul_assign_z(LOWER, to_lower, to_info,
00843                         UPPER, f_upper(x), f_info(x), xus,
00844                         LOWER, f_lower(y), f_info(y), yls);
00845       ru = mul_assign_z(UPPER, upper(), to_info,
00846                         UPPER, f_upper(x), f_info(x), xus,
00847                         UPPER, f_upper(y), f_info(y), yus);
00848     }
00849   }
00850   else if (xus <= 0) {
00851     if (yls >= 0) {
00852       // xl <= xu <= 0, 0 <= yl <= yu
00853       rl = mul_assign_z(LOWER, to_lower, to_info,
00854                         LOWER, f_lower(x), f_info(x), xls,
00855                         UPPER, f_upper(y), f_info(y), yus);
00856       ru = mul_assign_z(UPPER, upper(), to_info,
00857                         UPPER, f_upper(x), f_info(x), xus,
00858                         LOWER, f_lower(y), f_info(y), yls);
00859     }
00860     else if (yus <= 0) {
00861       // xl <= xu <= 0, yl <= yu <= 0
00862       rl = mul_assign_z(LOWER, to_lower, to_info,
00863                         UPPER, f_upper(x), f_info(x), xus,
00864                         UPPER, f_upper(y), f_info(y), yus);
00865       ru = mul_assign_z(UPPER, upper(), to_info,
00866                         LOWER, f_lower(x), f_info(x), xls,
00867                         LOWER, f_lower(y), f_info(y), yls);
00868     }
00869     else {
00870       // xl <= xu <= 0, yl < 0 < yu
00871       rl = mul_assign_z(LOWER, to_lower, to_info,
00872                         LOWER, f_lower(x), f_info(x), xls,
00873                         UPPER, f_upper(y), f_info(y), yus);
00874       ru = mul_assign_z(UPPER, upper(), to_info,
00875                         LOWER, f_lower(x), f_info(x), xls,
00876                         LOWER, f_lower(y), f_info(y), yls);
00877     }
00878   }
00879   else if (yls >= 0) {
00880     // xl < 0 < xu, 0 <= yl <= yu
00881     rl = mul_assign_z(LOWER, to_lower, to_info,
00882                       LOWER, f_lower(x), f_info(x), xls,
00883                       UPPER, f_upper(y), f_info(y), yus);
00884     ru = mul_assign_z(UPPER, upper(), to_info,
00885                       UPPER, f_upper(x), f_info(x), xus,
00886                       UPPER, f_upper(y), f_info(y), yus);
00887   }
00888   else if (yus <= 0) {
00889     // xl < 0 < xu, yl <= yu <= 0
00890     rl = mul_assign_z(LOWER, to_lower, to_info,
00891                       UPPER, f_upper(x), f_info(x), xus,
00892                       LOWER, f_lower(y), f_info(y), yls);
00893     ru = mul_assign_z(UPPER, upper(), to_info,
00894                       LOWER, f_lower(x), f_info(x), xls,
00895                       LOWER, f_lower(y), f_info(y), yls);
00896   }
00897   else {
00898     // xl < 0 < xu, yl < 0 < yu
00899     DIRTY_TEMP(To_Boundary, tmp);
00900     DIRTY_TEMP(To_Info, tmp_info);
00901     tmp_info.clear();
00902     Result tmp_r;
00903     tmp_r = Boundary_NS::mul_assign(LOWER, tmp, tmp_info,
00904                                     UPPER, f_upper(x), f_info(x),
00905                                     LOWER, f_lower(y), f_info(y));
00906     rl = Boundary_NS::mul_assign(LOWER, to_lower, to_info,
00907                                  LOWER, f_lower(x), f_info(x),
00908                                  UPPER, f_upper(y), f_info(y));
00909     if (gt(LOWER, to_lower, to_info, LOWER, tmp, tmp_info)) {
00910       to_lower = tmp;
00911       rl = tmp_r;
00912     }
00913     tmp_info.clear();
00914     tmp_r = Boundary_NS::mul_assign(UPPER, tmp, tmp_info,
00915                                     UPPER, f_upper(x), f_info(x),
00916                                     UPPER, f_upper(y), f_info(y));
00917     ru = Boundary_NS::mul_assign(UPPER, upper(), to_info,
00918                                  LOWER, f_lower(x), f_info(x),
00919                                  LOWER, f_lower(y), f_info(y));
00920     if (lt(UPPER, upper(), to_info, UPPER, tmp, tmp_info)) {
00921       upper() = tmp;
00922       ru = tmp_r;
00923     }
00924   }
00925   assign_or_swap(lower(), to_lower);
00926   assign_or_swap(info(), to_info);
00927   complete_init_internal();
00928   assert(OK());
00929   return combine(rl, ru);
00930 }

template<typename To_Boundary, typename To_Info>
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 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 949 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::Interval< Boundary, Info >::complete_init_internal(), 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::I_SINGULARITIES, Parma_Polyhedra_Library::Interval< Boundary, Info >::info(), Parma_Polyhedra_Library::is_infinity(), Parma_Polyhedra_Library::Interval< Boundary, Info >::lower(), MINUS_INFINITY, Parma_Polyhedra_Library::Interval< Boundary, Info >::OK(), PLUS_INFINITY, Parma_Polyhedra_Library::Interval< Boundary, Info >::set_infinities(), Parma_Polyhedra_Library::UNIVERSE, and Parma_Polyhedra_Library::Interval< Boundary, Info >::upper().

Referenced by Parma_Polyhedra_Library::operator/(), and Parma_Polyhedra_Library::Interval< Boundary, Info >::operator/=().

00949                                                                          {
00950   assert(f_OK(x));
00951   assert(f_OK(y));
00952   if (check_empty_arg(x) || check_empty_arg(y))
00953     return assign(EMPTY);
00954   int yls = sgn_b(LOWER, f_lower(y), f_info(y));
00955   int yus = yls > 0 ? 1 : sgn_b(UPPER, f_upper(y), f_info(y));
00956   if (yls == 0 && yus == 0)
00957     return assign(EMPTY);
00958   int inf = Parma_Polyhedra_Library::is_infinity(x);
00959   if (inf) {
00960     if (Parma_Polyhedra_Library::is_infinity(y))
00961       return assign(EMPTY);
00962     if (yls == -yus)
00963       return set_infinities();
00964     if (yls < 0 || yus < 0)
00965       inf = -inf;
00966     if (inf < 0)
00967       return assign(MINUS_INFINITY);
00968     else
00969       return assign(PLUS_INFINITY);
00970   }
00971   int xls = sgn_b(LOWER, f_lower(x), f_info(x));
00972   int xus = xls > 0 ? 1 : sgn_b(UPPER, f_upper(x), f_info(x));
00973 
00974   DIRTY_TEMP(To_Info, to_info);
00975   to_info.clear();
00976   if (!div_restriction(to_info, x, y))
00977     return assign(EMPTY);
00978   Result rl, ru;
00979   DIRTY_TEMP(To_Boundary, to_lower);
00980   if (yls >= 0) {
00981     if (xls >= 0) {
00982       rl = div_assign_z(LOWER, to_lower, to_info,
00983                         LOWER, f_lower(x), f_info(x), xls,
00984                         UPPER, f_upper(y), f_info(y), yus);
00985       ru = div_assign_z(UPPER, upper(), to_info,
00986                         UPPER, f_upper(x), f_info(x), xus,
00987                         LOWER, f_lower(y), f_info(y), yls);
00988     }
00989     else if (xus <= 0) {
00990       rl = div_assign_z(LOWER, to_lower, to_info,
00991                         LOWER, f_lower(x), f_info(x), xls,
00992                         LOWER, f_lower(y), f_info(y), yls);
00993       ru = div_assign_z(UPPER, upper(), to_info,
00994                         UPPER, f_upper(x), f_info(x), xus,
00995                         UPPER, f_upper(y), f_info(y), yus);
00996     }
00997     else {
00998       rl = div_assign_z(LOWER, to_lower, to_info,
00999                         LOWER, f_lower(x), f_info(x), xls,
01000                         LOWER, f_lower(y), f_info(y), yls);
01001       ru = div_assign_z(UPPER, upper(), to_info,
01002                         UPPER, f_upper(x), f_info(x), xus,
01003                         LOWER, f_lower(y), f_info(y), yls);
01004     }
01005   }
01006   else if (yus <= 0) {
01007     if (xls >= 0) {
01008       rl = div_assign_z(LOWER, to_lower, to_info,
01009                         UPPER, f_upper(x), f_info(x), xus,
01010                         UPPER, f_upper(y), f_info(y), yus);
01011       ru = div_assign_z(UPPER, upper(), to_info,
01012                         LOWER, f_lower(x), f_info(x), xls,
01013                         LOWER, f_lower(y), f_info(y), yls);
01014     }
01015     else if (xus <= 0) {
01016       rl = div_assign_z(LOWER, to_lower, to_info,
01017                         UPPER, f_upper(x), f_info(x), xus,
01018                         LOWER, f_lower(y), f_info(y), yls);
01019       ru = div_assign_z(UPPER, upper(), to_info,
01020                         LOWER, f_lower(x), f_info(x), xls,
01021                         UPPER, f_upper(y), f_info(y), yus);
01022     }
01023     else {
01024       rl = div_assign_z(LOWER, to_lower, to_info,
01025                         UPPER, f_upper(x), f_info(x), xus,
01026                         UPPER, f_upper(y), f_info(y), yus);
01027       ru = div_assign_z(UPPER, upper(), to_info,
01028                         LOWER, f_lower(x), f_info(x), xls,
01029                         UPPER, f_upper(y), f_info(y), yus);
01030     }
01031   }
01032   else {
01033     // FIXME: restrictions
01034     return static_cast<I_Result>(assign(UNIVERSE) | I_SINGULARITIES);
01035   }
01036   assign_or_swap(lower(), to_lower);
01037   assign_or_swap(info(), to_info);
01038   complete_init_internal();
01039   assert(OK());
01040   return combine(rl, ru);
01041 }

template<typename Boundary, typename Info>
template<typename From, typename Iterator>
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]


Friends And Related Function Documentation

template<typename Boundary, typename Info>
void swap ( Parma_Polyhedra_Library::Interval< Boundary, Info > &  x,
Parma_Polyhedra_Library::Interval< Boundary, Info > &  y 
) [related]

Definition at line 1270 of file Interval.inlines.hh.

References Parma_Polyhedra_Library::Interval< Boundary, Info >::swap().

01271                                                          {
01272   x.swap(y);
01273 }


Member Data Documentation

template<typename Boundary, typename Info>
Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::lower_ [private]

template<typename Boundary, typename Info>
Boundary Parma_Polyhedra_Library::Interval< Boundary, Info >::upper_ [private]


The documentation for this class was generated from the following files:

Generated on Sat Oct 11 10:41:13 2008 for PPL by  doxygen 1.5.6