Parma_Polyhedra_Library::Determinate< PH > Class Template Reference
[C++ Language Interface]

Wraps a PPL class into a determinate constraint system interface. More...

#include <Determinate.defs.hh>

Collaboration diagram for Parma_Polyhedra_Library::Determinate< PH >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructors and Destructor
 Determinate (const PH &p)
 Injection operator: builds the determinate constraint system element corresponding to the base-level element p.
 Determinate (const Constraint_System &cs)
 Injection operator: builds the determinate constraint system element corresponding to the base-level element represented by cs.
 Determinate (const Congruence_System &cgs)
 Injection operator: builds the determinate constraint system element corresponding to the base-level element represented by cgs.
 Determinate (const Determinate &y)
 Copy constructor.
 ~Determinate ()
 Destructor.
Member Functions that Do Not Modify the Domain Element
const PH & element () const
 Returns a const reference to the embedded element.
bool is_top () const
 Returns true if and only if *this is the top of the determinate constraint system (i.e., the whole vector space).
bool is_bottom () const
 Returns true if and only if *this is the bottom of the determinate constraint system.
bool definitely_entails (const Determinate &y) const
 Returns true if and only if *this entails y.
bool is_definitely_equivalent_to (const Determinate &y) const
 Returns true if and only if *this and y are equivalent.
memory_size_type total_memory_in_bytes () const
 Returns a lower bound to the total size in bytes of the memory occupied by *this.
memory_size_type external_memory_in_bytes () const
 Returns a lower bound to the size in bytes of the memory managed by *this.
bool OK () const
 Checks if all the invariants are satisfied.
Member Functions that May Modify the Domain Element
void upper_bound_assign (const Determinate &y)
 Assigns to *this the upper bound of *this and y.
void meet_assign (const Determinate &y)
 Assigns to *this the meet of *this and y.
void concatenate_assign (const Determinate &y)
 Assigns to *this the concatenation of *this and y, taken in this order.
PH & element ()
 Returns a reference to the embedded element.
void mutate ()
 On return from this method, the representation of *this is not shared by different Determinate objects.
Determinateoperator= (const Determinate &y)
 Assignment operator.
void swap (Determinate &y)
 Swaps *this with y.

Static Public Member Functions

template<typename Binary_Operator_Assign>
static
Binary_Operator_Assign_Lifter
< Binary_Operator_Assign > 
lift_op_assign (Binary_Operator_Assign op_assign)
 Helper function returning a Binary_Operator_Assign_Lifter object, also allowing for the deduction of template arguments.

Private Attributes

Repprep
 A pointer to the possibly shared representation of the base-level domain element.

Friends

bool operator== (const Determinate< PH > &x, const Determinate< PH > &y)
 Returns true if and only if x and y are the same domain element.
bool operator!= (const Determinate< PH > &x, const Determinate< PH > &y)
 Returns true if and only if x and y are different domain elements.

Related Functions

(Note that these are not member functions.)

template<typename PH>
std::ostream & operator<< (std::ostream &, const Determinate< PH > &)
 Output operator.
template<typename PH>
void swap (Parma_Polyhedra_Library::Determinate< PH > &x, Parma_Polyhedra_Library::Determinate< PH > &y)
 Specializes std::swap.

Classes

class  Binary_Operator_Assign_Lifter
 A function adapter for the Determinate class. More...
class  Rep
 The possibly shared representation of a Determinate object. More...


Detailed Description

template<typename PH>
class Parma_Polyhedra_Library::Determinate< PH >

Wraps a PPL class into a determinate constraint system interface.

Definition at line 69 of file Determinate.defs.hh.


Constructor & Destructor Documentation

template<typename PH>
Parma_Polyhedra_Library::Determinate< PH >::Determinate ( const PH &  p  )  [inline]

Injection operator: builds the determinate constraint system element corresponding to the base-level element p.

Definition at line 93 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00094   : prep(new Rep(ph)) {
00095   prep->new_reference();
00096 }

template<typename PH>
Parma_Polyhedra_Library::Determinate< PH >::Determinate ( const Constraint_System cs  )  [inline]

Injection operator: builds the determinate constraint system element corresponding to the base-level element represented by cs.

Definition at line 100 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00101   : prep(new Rep(cs)) {
00102   prep->new_reference();
00103 }

template<typename PH>
Parma_Polyhedra_Library::Determinate< PH >::Determinate ( const Congruence_System cgs  )  [inline]

Injection operator: builds the determinate constraint system element corresponding to the base-level element represented by cgs.

Definition at line 107 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00108   : prep(new Rep(cgs)) {
00109   prep->new_reference();
00110 }

template<typename PH>
Parma_Polyhedra_Library::Determinate< PH >::Determinate ( const Determinate< PH > &  y  )  [inline]

Copy constructor.

Definition at line 114 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00115   : prep(y.prep) {
00116   prep->new_reference();
00117 }

template<typename PH>
Parma_Polyhedra_Library::Determinate< PH >::~Determinate (  )  [inline]

Destructor.

Definition at line 121 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::del_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00121                               {
00122   if (prep->del_reference())
00123     delete prep;
00124 }


Member Function Documentation

template<typename PH>
const PH & Parma_Polyhedra_Library::Determinate< PH >::element (  )  const [inline]

template<typename PH>
bool Parma_Polyhedra_Library::Determinate< PH >::is_top (  )  const [inline]

Returns true if and only if *this is the top of the determinate constraint system (i.e., the whole vector space).

Definition at line 198 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

00198                               {
00199   return prep->ph.is_universe();
00200 }

template<typename PH>
bool Parma_Polyhedra_Library::Determinate< PH >::is_bottom (  )  const [inline]

Returns true if and only if *this is the bottom of the determinate constraint system.

Definition at line 204 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

Referenced by Parma_Polyhedra_Library::Polyhedra_Powerset< PH >::concatenate_assign().

00204                                  {
00205   return prep->ph.is_empty();
00206 }

template<typename PH>
bool Parma_Polyhedra_Library::Determinate< PH >::definitely_entails ( const Determinate< PH > &  y  )  const [inline]

Returns true if and only if *this entails y.

Definition at line 186 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

00186                                                               {
00187   return prep == y.prep || y.prep->ph.contains(prep->ph);
00188 }

template<typename PH>
bool Parma_Polyhedra_Library::Determinate< PH >::is_definitely_equivalent_to ( const Determinate< PH > &  y  )  const [inline]

Returns true if and only if *this and y are equivalent.

Definition at line 192 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

00192                                                                        {
00193   return prep == y.prep || prep->ph == y.prep->ph;
00194 }

template<typename PH>
memory_size_type Parma_Polyhedra_Library::Determinate< PH >::total_memory_in_bytes (  )  const [inline]

Returns a lower bound to the total size in bytes of the memory occupied by *this.

Definition at line 216 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::external_memory_in_bytes().

00216                                              {
00217   return sizeof(*this) + external_memory_in_bytes();
00218 }

template<typename PH>
memory_size_type Parma_Polyhedra_Library::Determinate< PH >::external_memory_in_bytes (  )  const [inline]

Returns a lower bound to the size in bytes of the memory managed by *this.

Definition at line 210 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::prep, and Parma_Polyhedra_Library::Determinate< PH >::Rep::total_memory_in_bytes().

Referenced by Parma_Polyhedra_Library::Determinate< PH >::total_memory_in_bytes().

00210                                                 {
00211   return prep->total_memory_in_bytes();
00212 }

template<typename PH>
bool Parma_Polyhedra_Library::Determinate< PH >::OK (  )  const [inline]

Checks if all the invariants are satisfied.

Definition at line 222 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

00222                           {
00223   return prep->ph.OK();
00224 }

template<typename PH>
void Parma_Polyhedra_Library::Determinate< PH >::upper_bound_assign ( const Determinate< PH > &  y  )  [inline]

Assigns to *this the upper bound of *this and y.

Definition at line 168 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::element().

00168                                                         {
00169   element().upper_bound_assign(y.element());
00170 }

template<typename PH>
void Parma_Polyhedra_Library::Determinate< PH >::meet_assign ( const Determinate< PH > &  y  )  [inline]

Assigns to *this the meet of *this and y.

Definition at line 174 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::element().

00174                                                  {
00175   element().intersection_assign(y.element());
00176 }

template<typename PH>
void Parma_Polyhedra_Library::Determinate< PH >::concatenate_assign ( const Determinate< PH > &  y  )  [inline]

Assigns to *this the concatenation of *this and y, taken in this order.

Definition at line 180 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::element().

Referenced by Parma_Polyhedra_Library::Polyhedra_Powerset< PH >::concatenate_assign().

00180                                                         {
00181   element().concatenate_assign(y.element());
00182 }

template<typename PH>
PH & Parma_Polyhedra_Library::Determinate< PH >::element (  )  [inline]

Returns a reference to the embedded element.

Definition at line 161 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::mutate(), Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

00161                          {
00162   mutate();
00163   return prep->ph;
00164 }

template<typename PH>
void Parma_Polyhedra_Library::Determinate< PH >::mutate (  )  [inline]

On return from this method, the representation of *this is not shared by different Determinate objects.

Definition at line 144 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::del_reference(), Parma_Polyhedra_Library::Determinate< PH >::Rep::is_shared(), Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), Parma_Polyhedra_Library::Determinate< PH >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PH >::prep.

Referenced by Parma_Polyhedra_Library::Determinate< PH >::element().

00144                         {
00145   if (prep->is_shared()) {
00146     Rep* new_prep = new Rep(prep->ph);
00147     (void) prep->del_reference();
00148     new_prep->new_reference();
00149     prep = new_prep;
00150   }
00151 }

template<typename PH>
Determinate< PH > & Parma_Polyhedra_Library::Determinate< PH >::operator= ( const Determinate< PH > &  y  )  [inline]

Assignment operator.

Definition at line 128 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::Rep::del_reference(), Parma_Polyhedra_Library::Determinate< PH >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PH >::prep.

00128                                                {
00129   y.prep->new_reference();
00130   if (prep->del_reference())
00131     delete prep;
00132   prep = y.prep;
00133   return *this;
00134 }

template<typename PH>
void Parma_Polyhedra_Library::Determinate< PH >::swap ( Determinate< PH > &  y  )  [inline]

Swaps *this with y.

Definition at line 138 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::prep.

Referenced by Parma_Polyhedra_Library::Determinate< PH >::swap().

00138                                     {
00139   std::swap(prep, y.prep);
00140 }

template<typename PH>
template<typename Binary_Operator_Assign>
Determinate< PH >::Binary_Operator_Assign_Lifter< Binary_Operator_Assign > Parma_Polyhedra_Library::Determinate< PH >::lift_op_assign ( Binary_Operator_Assign  op_assign  )  [inline, static]

Helper function returning a Binary_Operator_Assign_Lifter object, also allowing for the deduction of template arguments.

Definition at line 272 of file Determinate.inlines.hh.

Referenced by Parma_Polyhedra_Library::Polyhedra_Powerset< PH >::intersection_assign(), and Parma_Polyhedra_Library::Polyhedra_Powerset< PH >::time_elapse_assign().

00272                                                                 {
00273   return Binary_Operator_Assign_Lifter<Binary_Operator_Assign>(op_assign);
00274 }


Friends And Related Function Documentation

template<typename PH>
bool operator== ( const Determinate< PH > &  x,
const Determinate< PH > &  y 
) [friend]

Returns true if and only if x and y are the same domain element.

Definition at line 241 of file Determinate.inlines.hh.

00241                                                                {
00242   return x.prep == y.prep || x.prep->ph == y.prep->ph;
00243 }

template<typename PH>
bool operator!= ( const Determinate< PH > &  x,
const Determinate< PH > &  y 
) [friend]

Returns true if and only if x and y are different domain elements.

Definition at line 248 of file Determinate.inlines.hh.

00248                                                                {
00249   return x.prep != y.prep && x.prep->ph != y.prep->ph;
00250 }

template<typename PH>
std::ostream & operator<< ( std::ostream &  s,
const Determinate< PH > &  x 
) [related]

Output operator.

Definition at line 231 of file Determinate.inlines.hh.

00231                                                     {
00232   s << x.element();
00233   return s;
00234 }

template<typename PH>
void swap ( Parma_Polyhedra_Library::Determinate< PH > &  x,
Parma_Polyhedra_Library::Determinate< PH > &  y 
) [related]

Specializes std::swap.

Definition at line 284 of file Determinate.inlines.hh.

References Parma_Polyhedra_Library::Determinate< PH >::swap().

00285                                                 {
00286   x.swap(y);
00287 }


Member Data Documentation

template<typename PH>
Rep* Parma_Polyhedra_Library::Determinate< PH >::prep [private]


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

Generated on Wed Jul 16 22:55:51 2008 for PPL by  doxygen 1.5.6