Parma_Polyhedra_Library::Determinate< PS > 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< PS >:

Collaboration graph
[legend]

List of all members.

Member Functions that Do Not Modify the Domain Element

const PS & 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.
static bool has_nontrivial_weakening ()

Public Member Functions

Constructors and Destructor
 Determinate (const PS &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 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 weakening_assign (const Determinate &y)
 Assigns to *this the result of weakening *this with y.
void concatenate_assign (const Determinate &y)
 Assigns to *this the concatenation of *this and y, taken in this order.
PS & 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< PS > &x, const Determinate< PS > &y)
 Returns true if and only if x and y are the same domain element.
bool operator!= (const Determinate< PS > &x, const Determinate< PS > &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 PS>
std::ostream & operator<< (std::ostream &, const Determinate< PS > &)
 Output operator.
template<typename PS>
void swap (Parma_Polyhedra_Library::Determinate< PS > &x, Parma_Polyhedra_Library::Determinate< PS > &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 PS>
class Parma_Polyhedra_Library::Determinate< PS >

Wraps a PPL class into a determinate constraint system interface.

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


Constructor & Destructor Documentation

template<typename PS>
Parma_Polyhedra_Library::Determinate< PS >::Determinate ( const PS &  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< PS >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PS >::prep.

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

template<typename PS>
Parma_Polyhedra_Library::Determinate< PS >::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< PS >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PS >::prep.

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

template<typename PS>
Parma_Polyhedra_Library::Determinate< PS >::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< PS >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PS >::prep.

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

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

Copy constructor.

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

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

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

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

Destructor.

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

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

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


Member Function Documentation

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

template<typename PS>
bool Parma_Polyhedra_Library::Determinate< PS >::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 212 of file Determinate.inlines.hh.

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

00212                               {
00213   return prep->ph.is_universe();
00214 }

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

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

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

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

Referenced by Parma_Polyhedra_Library::Pointset_Powerset< PS >::concatenate_assign().

00218                                  {
00219   return prep->ph.is_empty();
00220 }

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

Returns true if and only if *this entails y.

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

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

00200                                                               {
00201   return prep == y.prep || y.prep->ph.contains(prep->ph);
00202 }

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

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

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

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

00206                                                                        {
00207   return prep == y.prep || prep->ph == y.prep->ph;
00208 }

template<typename PS>
memory_size_type Parma_Polyhedra_Library::Determinate< PS >::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 230 of file Determinate.inlines.hh.

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

00230                                              {
00231   return sizeof(*this) + external_memory_in_bytes();
00232 }

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

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

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

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

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

00224                                                 {
00225   return prep->total_memory_in_bytes();
00226 }

template<typename PS>
bool Parma_Polyhedra_Library::Determinate< PS >::has_nontrivial_weakening (  )  [inline, static]

Returns true if and only if this domain has a nontrivial weakening operator.

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

00180                                           {
00181   // FIXME
00182   return true;
00183 }

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

Checks if all the invariants are satisfied.

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

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

00236                           {
00237   return prep->ph.OK();
00238 }

template<typename PS>
void Parma_Polyhedra_Library::Determinate< PS >::upper_bound_assign ( const Determinate< PS > &  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< PS >::element().

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

template<typename PS>
void Parma_Polyhedra_Library::Determinate< PS >::meet_assign ( const Determinate< PS > &  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< PS >::element().

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

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

Assigns to *this the result of weakening *this with y.

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

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

00187                                                       {
00188   // FIXME
00189   element().difference_assign(y.element());
00190 }

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

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

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

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

Referenced by Parma_Polyhedra_Library::Pointset_Powerset< PS >::concatenate_assign().

00194                                                         {
00195   element().concatenate_assign(y.element());
00196 }

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

Returns a reference to the embedded element.

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

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

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

template<typename PS>
void Parma_Polyhedra_Library::Determinate< PS >::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< PS >::Rep::del_reference(), Parma_Polyhedra_Library::Determinate< PS >::Rep::is_shared(), Parma_Polyhedra_Library::Determinate< PS >::Rep::new_reference(), Parma_Polyhedra_Library::Determinate< PS >::Rep::ph, and Parma_Polyhedra_Library::Determinate< PS >::prep.

Referenced by Parma_Polyhedra_Library::Determinate< PS >::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 PS>
Determinate< PS > & Parma_Polyhedra_Library::Determinate< PS >::operator= ( const Determinate< PS > &  y  )  [inline]

Assignment operator.

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

References Parma_Polyhedra_Library::Determinate< PS >::Rep::del_reference(), Parma_Polyhedra_Library::Determinate< PS >::Rep::new_reference(), and Parma_Polyhedra_Library::Determinate< PS >::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 PS>
void Parma_Polyhedra_Library::Determinate< PS >::swap ( Determinate< PS > &  y  )  [inline]

Swaps *this with y.

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

References Parma_Polyhedra_Library::Determinate< PS >::prep, and Parma_Polyhedra_Library::swap().

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

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

template<typename PS>
template<typename Binary_Operator_Assign>
Determinate< PS >::Binary_Operator_Assign_Lifter< Binary_Operator_Assign > Parma_Polyhedra_Library::Determinate< PS >::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 286 of file Determinate.inlines.hh.

Referenced by Parma_Polyhedra_Library::Pointset_Powerset< PS >::intersection_assign(), and Parma_Polyhedra_Library::Pointset_Powerset< PS >::time_elapse_assign().

00286                                                                 {
00287   return Binary_Operator_Assign_Lifter<Binary_Operator_Assign>(op_assign);
00288 }


Friends And Related Function Documentation

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

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

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

00255                                                                {
00256   return x.prep == y.prep || x.prep->ph == y.prep->ph;
00257 }

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

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

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

00262                                                                {
00263   return x.prep != y.prep && x.prep->ph != y.prep->ph;
00264 }

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

Output operator.

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

00245                                                     {
00246   s << x.element();
00247   return s;
00248 }

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

Specializes std::swap.

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

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

00299                                                 {
00300   x.swap(y);
00301 }


Member Data Documentation

template<typename PS>
Rep* Parma_Polyhedra_Library::Determinate< PS >::prep [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