Parma_Polyhedra_Library::Poly_Gen_Relation Class Reference
[C++ Language Interface]

The relation between a polyhedron and a generator. More...

#include <Poly_Gen_Relation.defs.hh>

List of all members.

Public Member Functions

flags_t get_flags () const
 Access the internal flags: this is needed for some foreign language interfaces.
void ascii_dump () const
 Writes to std::cerr an ASCII representation of *this.
void ascii_dump (std::ostream &s) const
 Writes to s an ASCII representation of *this.
void print () const
 Prints *this to std::cerr using operator<<.
bool implies (const Poly_Gen_Relation &y) const
 True if and only if *this implies y.
bool OK () const
 Checks if all the invariants are satisfied.

Static Public Member Functions

static Poly_Gen_Relation nothing ()
 The assertion that says nothing.
static Poly_Gen_Relation subsumes ()
 Adding the generator would not change the polyhedron.

Private Types

typedef unsigned int flags_t
 Poly_Gen_Relation is implemented by means of a finite bitset.

Private Member Functions

 Poly_Gen_Relation (flags_t mask)
 Construct from a bit-mask.

Static Private Member Functions

static bool implies (flags_t x, flags_t y)
 True if and only if the conjunction x implies the conjunction y.

Private Attributes

flags_t flags
 This holds the current bitset.

Static Private Attributes

static const flags_t EVERYTHING = SUBSUMES
 All assertions together.
Bit-masks for the individual assertions
static const flags_t NOTHING = 0U
static const flags_t SUBSUMES = 1U << 0

Friends

bool operator== (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 True if and only if x and y are logically equivalent.
bool operator!= (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 True if and only if x and y are not logically equivalent.
Poly_Gen_Relation operator && (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 Yields the logical conjunction of x and y.
Poly_Gen_Relation operator- (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 Yields the assertion with all the conjuncts of x that are not in y.
std::ostream & operator<< (std::ostream &s, const Poly_Gen_Relation &r)
 Output operator.


Detailed Description

The relation between a polyhedron and a generator.

This class implements conjunctions of assertions on the relation between a polyhedron and a generator.

Definition at line 72 of file Poly_Gen_Relation.defs.hh.


Member Typedef Documentation

Poly_Gen_Relation is implemented by means of a finite bitset.

Definition at line 75 of file Poly_Gen_Relation.defs.hh.


Constructor & Destructor Documentation

Parma_Polyhedra_Library::Poly_Gen_Relation::Poly_Gen_Relation ( flags_t  mask  )  [inline, private]

Construct from a bit-mask.

Definition at line 29 of file Poly_Gen_Relation.inlines.hh.

Referenced by nothing(), and subsumes().

00030   : flags(mask) {
00031 }


Member Function Documentation

bool Parma_Polyhedra_Library::Poly_Gen_Relation::implies ( flags_t  x,
flags_t  y 
) [inline, static, private]

True if and only if the conjunction x implies the conjunction y.

Definition at line 49 of file Poly_Gen_Relation.inlines.hh.

Referenced by ascii_dump(), implies(), and Parma_Polyhedra_Library::Pointset_Powerset< PS >::relation_with().

00049                                                {
00050   return (x & y) == y;
00051 }

Poly_Gen_Relation::flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::get_flags (  )  const [inline]

Access the internal flags: this is needed for some foreign language interfaces.

Definition at line 34 of file Poly_Gen_Relation.inlines.hh.

References flags.

00034                                    {
00035   return flags;
00036 }

Poly_Gen_Relation Parma_Polyhedra_Library::Poly_Gen_Relation::nothing (  )  [inline, static]

Poly_Gen_Relation Parma_Polyhedra_Library::Poly_Gen_Relation::subsumes (  )  [inline, static]

void Parma_Polyhedra_Library::Poly_Gen_Relation::ascii_dump (  )  const

Writes to std::cerr an ASCII representation of *this.

void Parma_Polyhedra_Library::Poly_Gen_Relation::ascii_dump ( std::ostream &  s  )  const

Writes to s an ASCII representation of *this.

Definition at line 34 of file Poly_Gen_Relation.cc.

References flags, implies(), NOTHING, and SUBSUMES.

00034                                                     {
00035   flags_t f = flags;
00036   if (f == NOTHING) {
00037     s << "NOTHING";
00038     return;
00039   }
00040 
00041   while (true) {
00042     if (implies(f, SUBSUMES)) {
00043       s << "SUBSUMES";
00044       f &= ~SUBSUMES;
00045     }
00046     if (f != NOTHING)
00047       s << " & ";
00048     else
00049       break;
00050   }
00051 }

void Parma_Polyhedra_Library::Poly_Gen_Relation::print (  )  const

Prints *this to std::cerr using operator<<.

bool Parma_Polyhedra_Library::Poly_Gen_Relation::implies ( const Poly_Gen_Relation y  )  const [inline]

True if and only if *this implies y.

Definition at line 54 of file Poly_Gen_Relation.inlines.hh.

References flags, and implies().

00054                                                            {
00055   return implies(flags, y.flags);
00056 }

bool Parma_Polyhedra_Library::Poly_Gen_Relation::OK (  )  const

Checks if all the invariants are satisfied.

Definition at line 63 of file Poly_Gen_Relation.cc.

00063                                {
00064   return true;
00065 }


Friends And Related Function Documentation

bool operator== ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
) [friend]

True if and only if x and y are logically equivalent.

Definition at line 60 of file Poly_Gen_Relation.inlines.hh.

00060                                                                    {
00061   return x.flags == y.flags;
00062 }

bool operator!= ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
) [friend]

True if and only if x and y are not logically equivalent.

Definition at line 66 of file Poly_Gen_Relation.inlines.hh.

00066                                                                    {
00067   return x.flags != y.flags;
00068 }

Poly_Gen_Relation operator && ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
) [friend]

Yields the logical conjunction of x and y.

Definition at line 72 of file Poly_Gen_Relation.inlines.hh.

00072                                                                    {
00073   return Poly_Gen_Relation(x.flags | y.flags);
00074 }

Poly_Gen_Relation operator- ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
) [friend]

Yields the assertion with all the conjuncts of x that are not in y.

Definition at line 78 of file Poly_Gen_Relation.inlines.hh.

00078                                                                   {
00079   return Poly_Gen_Relation(x.flags & ~y.flags);
00080 }

std::ostream & operator<< ( std::ostream &  s,
const Poly_Gen_Relation r 
) [friend]

Output operator.

Definition at line 57 of file Poly_Gen_Relation.cc.

00057                                                                      {
00058   r.ascii_dump(s);
00059   return s;
00060 }


Member Data Documentation

Definition at line 79 of file Poly_Gen_Relation.defs.hh.

Referenced by ascii_dump(), and nothing().

Definition at line 80 of file Poly_Gen_Relation.defs.hh.

Referenced by ascii_dump(), and subsumes().

All assertions together.

Definition at line 85 of file Poly_Gen_Relation.defs.hh.

This holds the current bitset.

Definition at line 88 of file Poly_Gen_Relation.defs.hh.

Referenced by ascii_dump(), get_flags(), and implies().


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

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