PPL  1.2
Parma_Polyhedra_Library::Poly_Gen_Relation Class Reference

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

#include <Poly_Gen_Relation_defs.hh>

Public Member Functions

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

Static Public Member Functions

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

Private Types

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

Private Member Functions

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

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. More...
 

Private Attributes

flags_t flags
 This holds the current bitset. More...
 

Static Private Attributes

static const flags_t EVERYTHING = SUBSUMES
 All assertions together. More...
 
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)
 
bool operator!= (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
Poly_Gen_Relation operator&& (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
Poly_Gen_Relation operator- (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
std::ostream & Parma_Polyhedra_Library::IO_Operators::operator<< (std::ostream &s, const Poly_Gen_Relation &r)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &s, const Poly_Gen_Relation &r)
 
bool operator== (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 True if and only if x and y are logically equivalent. More...
 
bool operator!= (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 True if and only if x and y are not logically equivalent. More...
 
Poly_Gen_Relation operator&& (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 Yields the logical conjunction of x and y. More...
 
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. More...
 
std::ostream & operator<< (std::ostream &s, const Poly_Gen_Relation &r)
 Output operator. More...
 
bool operator== (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
bool operator!= (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
Poly_Gen_Relation operator&& (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 
Poly_Gen_Relation operator- (const Poly_Gen_Relation &x, const Poly_Gen_Relation &y)
 

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 73 of file Poly_Gen_Relation_defs.hh.

Member Typedef Documentation

Poly_Gen_Relation is implemented by means of a finite bitset.

Definition at line 76 of file Poly_Gen_Relation_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::Poly_Gen_Relation::Poly_Gen_Relation ( flags_t  mask)
inlineprivate

Construct from a bit-mask.

Definition at line 30 of file Poly_Gen_Relation_inlines.hh.

Referenced by nothing(), and subsumes().

31  : flags(mask) {
32 }
flags_t flags
This holds the current bitset.

Member Function Documentation

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 33 of file Poly_Gen_Relation.cc.

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

33  {
34  flags_t f = flags;
35  if (f == NOTHING) {
36  s << "NOTHING";
37  return;
38  }
39 
40  while (true) {
41  if (implies(f, SUBSUMES)) {
42  s << "SUBSUMES";
43  f &= ~SUBSUMES;
44  }
45  if (f != NOTHING) {
46  s << " & ";
47  }
48  else {
49  break;
50  }
51  }
52 }
unsigned int flags_t
Poly_Gen_Relation is implemented by means of a finite bitset.
flags_t flags
This holds the current bitset.
static bool implies(flags_t x, flags_t y)
True if and only if the conjunction x implies the conjunction y.
Poly_Gen_Relation::flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::get_flags ( ) const
inline

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

Definition at line 35 of file Poly_Gen_Relation_inlines.hh.

References flags.

35  {
36  return flags;
37 }
flags_t flags
This holds the current bitset.
bool Parma_Polyhedra_Library::Poly_Gen_Relation::implies ( flags_t  x,
flags_t  y 
)
inlinestaticprivate

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

Definition at line 50 of file Poly_Gen_Relation_inlines.hh.

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

50  {
51  return (x & y) == y;
52 }
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 55 of file Poly_Gen_Relation_inlines.hh.

References flags, and implies().

55  {
56  return implies(flags, y.flags);
57 }
flags_t flags
This holds the current bitset.
static bool implies(flags_t x, flags_t y)
True if and only if the conjunction x implies the conjunction y.
bool Parma_Polyhedra_Library::Poly_Gen_Relation::OK ( ) const

Checks if all the invariants are satisfied.

Definition at line 64 of file Poly_Gen_Relation.cc.

64  {
65  return true;
66 }
void Parma_Polyhedra_Library::Poly_Gen_Relation::print ( ) const

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

Friends And Related Function Documentation

bool operator!= ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

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

bool operator!= ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

Definition at line 67 of file Poly_Gen_Relation_inlines.hh.

References flags.

67  {
68  return x.flags != y.flags;
69 }
bool operator!= ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
friend
Poly_Gen_Relation operator&& ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

Yields the logical conjunction of x and y.

Poly_Gen_Relation operator&& ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

Definition at line 73 of file Poly_Gen_Relation_inlines.hh.

References flags.

73  {
74  return Poly_Gen_Relation(x.flags | y.flags);
75 }
Poly_Gen_Relation(flags_t mask)
Construct from a bit-mask.
Poly_Gen_Relation operator&& ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
friend
Poly_Gen_Relation operator- ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

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

Poly_Gen_Relation operator- ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

Definition at line 79 of file Poly_Gen_Relation_inlines.hh.

References flags.

79  {
80  return Poly_Gen_Relation(x.flags & ~y.flags);
81 }
Poly_Gen_Relation(flags_t mask)
Construct from a bit-mask.
Poly_Gen_Relation operator- ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
friend
std::ostream & operator<< ( std::ostream &  s,
const Poly_Gen_Relation r 
)
related

Definition at line 58 of file Poly_Gen_Relation.cc.

58  {
59  r.ascii_dump(s);
60  return s;
61 }
std::ostream & operator<< ( std::ostream &  s,
const Poly_Gen_Relation r 
)
related

Output operator.

bool operator== ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

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

bool operator== ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
related

Definition at line 61 of file Poly_Gen_Relation_inlines.hh.

References flags.

61  {
62  return x.flags == y.flags;
63 }
bool operator== ( const Poly_Gen_Relation x,
const Poly_Gen_Relation y 
)
friend
std::ostream& Parma_Polyhedra_Library::IO_Operators::operator<< ( std::ostream &  s,
const Poly_Gen_Relation r 
)
friend

Member Data Documentation

const flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::EVERYTHING = SUBSUMES
staticprivate

All assertions together.

Definition at line 86 of file Poly_Gen_Relation_defs.hh.

flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::flags
private

This holds the current bitset.

Definition at line 89 of file Poly_Gen_Relation_defs.hh.

Referenced by ascii_dump(), get_flags(), implies(), operator!=(), operator&&(), operator-(), and operator==().

const flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::NOTHING = 0U
staticprivate

Definition at line 80 of file Poly_Gen_Relation_defs.hh.

Referenced by ascii_dump(), and nothing().

const flags_t Parma_Polyhedra_Library::Poly_Gen_Relation::SUBSUMES = 1U << 0
staticprivate

Definition at line 81 of file Poly_Gen_Relation_defs.hh.

Referenced by ascii_dump(), and subsumes().


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