Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

gbdd::StructureRelation Class Reference

Typed Structure objects. More...

#include <structure-relation.h>

Inheritance diagram for gbdd::StructureRelation:

gbdd::SpecializedRelation< StructureT, RelationT, SetT > gbdd::SpecializedRelation< Bdd, BddRelation, BddSet > gbdd::StructureSetView< StructureConstraint, StructureRelation, StructureSet > gbdd::BddRelation gbdd::StructureSet gbdd::StructureBinaryView< Bdd, BddRelation, BddSet > gbdd::StructureSetView< Bdd, BddRelation, BddSet > gbdd::BddSet List of all members.

Public Member Functions

 StructureRelation ()
 Constructor for uninitialized value.

 StructureRelation (const StructureRelation &r)
 Copy constructor.

 StructureRelation (const Domains &ds, const StructureConstraint &bb)
 Create new relation from domains and a structure object.

 StructureRelation (const Domains &ds, StructureConstraint *bb)
 Create new relation from domains and a structure object.

 StructureRelation (const Domains &ds, const StructureRelation &r)
 Changes the domain of a relation with automatic renaming.

StructureRelationoperator= (const StructureRelation &r)
 Assignment.

virtual ~StructureRelation ()
 Destructor.

const Domainsget_domains () const
 Get domains for relation.

const Domainget_domain (unsigned int domain_index) const
 Get domain with specified index.

unsigned int arity () const
 Get arity of relation.

const StructureConstraintget_bdd_based () const
 Get structure object.

StructureRelation extend_domain (unsigned int domain_index, const Domain &to, bool new_vars_value=false) const
 Extends domain with new variables with some value.

StructureRelation reduce_domain (unsigned int domain_index, const Domain &to) const
 Reduces domain by projecting remaining variables.

StructureRelation compose (unsigned int domain_index, const StructureRelation &compose_rel) const
 Composes relation with another relation.

StructureRelation product (const StructureRelation &r2, bool(*fn)(bool v1, bool v2)) const
 Product.

bool operator== (const StructureRelation &rel2) const
 Equality.

StructureRelationoperator &= (const StructureRelation &rel2)
 AND product.

StructureRelationoperator|= (const StructureRelation &rel2)
 OR product.

StructureRelationoperator-= (const StructureRelation &rel2)
 MINUS product.

StructureRelation operator! () const
 Negation.

StructureSet project_on (unsigned int domain_index) const
StructureRelation project (unsigned int domain_index) const
 Projects away one component.

StructureRelation restrict (unsigned int domain_index, const StructureSet &to) const
 Restricts relation.


Static Public Member Functions

StructureRelation cross_product (const Domains &domains, const vector< StructureSet > &sets)
 Obtain new relation using cross product of sets.

StructureRelation iff (const StructureRelation &rel1, const StructureRelation &rel2)
 IFF product.

StructureRelation implies (const StructureRelation &rel1, const StructureRelation &rel2)
 IMPLIES product.


Protected Member Functions

void reset (const Domains &ds, const StructureConstraint &bb)

Friends

StructureRelation operator & (const StructureRelation &rel1, const StructureRelation &rel2)
 AND product.

StructureRelation operator| (const StructureRelation &rel1, const StructureRelation &rel2)
 OR product.

StructureRelation operator- (const StructureRelation &rel1, const StructureRelation &rel2)
 MINUS product.


Detailed Description

Typed Structure objects.

A structure relation is a typed gbdd::StructureConstraint object. Any gbdd::StructureConstraint object is based on representing a structure which is based on variables. By typing, we associate with the object gbdd::Domains, a vector of gbdd::Domain, i.e. a set of variables. The gbdd::StructureConstraint object is interpreted with the domains as a relation of arity the number of domains.

This is an implementation class, inheriting classes are specializations to this class, adding only specialized operations implemented with existing methods in this class.


Constructor & Destructor Documentation

gbdd::StructureRelation::StructureRelation  ) 
 

Constructor for uninitialized value.

gbdd::StructureRelation::StructureRelation const StructureRelation r  ) 
 

Copy constructor.

Parameters:
r Relation to copy

gbdd::StructureRelation::StructureRelation const Domains ds,
const StructureConstraint bb
 

Create new relation from domains and a structure object.

Parameters:
ds Domains for relation
bb structure object denoting the relation, using the variables in domains

gbdd::StructureRelation::StructureRelation const Domains ds,
StructureConstraint bb
 

Create new relation from domains and a structure object.

Parameters:
ds Domains for relation
bb structure object denoting the relation, using the variables in domains

gbdd::StructureRelation::StructureRelation const Domains ds,
const StructureRelation r
 

Changes the domain of a relation with automatic renaming.

Parameters:
ds New domains for relation
r Relation to adapt

gbdd::StructureRelation::~StructureRelation  )  [virtual]
 

Destructor.


Member Function Documentation

unsigned int gbdd::StructureRelation::arity  )  const
 

Get arity of relation.

Returns:
Arity of relation

StructureRelation gbdd::StructureRelation::compose unsigned int  compose_domain_index,
const StructureRelation compose_rel
const
 

Composes relation with another relation.

Parameters:
compose_domain_index Index of domain to compose with
compose_rel Binary relation to compose with
Returns:
The relation obtained by applying compose_rel in the component of this relation given by compose_domain_index.

StructureRelation gbdd::StructureRelation::cross_product const Domains domains,
const vector< StructureSet > &  contents
[static]
 

Obtain new relation using cross product of sets.

The domain of set in contents must have the same number of variables as the corresponding domain in domains.

Parameters:
domains The domains of the new relation
contents The sets to take cross product of
Returns:
A new relation having the domains domains obtained by taking the cross product of all sets in contents.

StructureRelation gbdd::StructureRelation::extend_domain unsigned int  domain_index,
const Domain to,
bool  new_vars_value = false
const
 

Extends domain with new variables with some value.

The resulting relation will have to as the new domain at index domain_index, and will contain a structure object where all the new variables are constrained to new_vars_value It is required the first variables in to is the same as in the current domain.

Parameters:
domain_index Index of domain to extend
to Domain to extend to
new_vars_value Value to constrain new variables to
Returns:
The relation with extended domain

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, and gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >.

const StructureConstraint & gbdd::StructureRelation::get_bdd_based  )  const
 

Get structure object.

Returns:
structure object

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, and gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >.

const Domain & gbdd::StructureRelation::get_domain unsigned int  domain_index  )  const
 

Get domain with specified index.

Domain indices are counted from 0

Parameters:
domain_index Index of domain to get
Returns:
Domain of relation with index domain_index

const Domains & gbdd::StructureRelation::get_domains  )  const
 

Get domains for relation.

Returns:
Domains for relation

StructureRelation gbdd::StructureRelation::iff const StructureRelation rel1,
const StructureRelation rel2
[inline, static]
 

IFF product.

Parameters:
rel1 First relation
rel2 Second relation
Returns:
IFF product of rel1 and rel2

StructureRelation gbdd::StructureRelation::implies const StructureRelation rel1,
const StructureRelation rel2
[inline, static]
 

IMPLIES product.

Parameters:
rel1 First relation
rel2 Second relation
Returns:
IMPLIES product of rel1 and rel2

StructureRelation & gbdd::StructureRelation::operator &= const StructureRelation rel2  ) 
 

AND product.

Assigns this relation to the AND product of this relation and rel2

Parameters:
rel2 Relation two
Returns:
This relation

StructureRelation gbdd::StructureRelation::operator!  )  const
 

Negation.

The universe in the negation is considered to be {0..2^n-1} for each domain

Returns:
The negation of this relation

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, gbdd::StructureBinaryView< Bdd, BddRelation, BddSet >, gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >, gbdd::StructureSetView< Bdd, BddRelation, BddSet >, and gbdd::StructureSetView< StructureConstraint, StructureRelation, StructureSet >.

StructureRelation & gbdd::StructureRelation::operator-= const StructureRelation rel2  ) 
 

MINUS product.

Assigns this relation to the MINUS product of this relation and rel2

Parameters:
rel2 Relation two
Returns:
This relation

StructureRelation & gbdd::StructureRelation::operator= const StructureRelation r  ) 
 

Assignment.

Parameters:
r Relation to assign from
Returns:
This object

bool gbdd::StructureRelation::operator== const StructureRelation rel2  )  const
 

Equality.

Checks equality of two relations. This may involve renaming of one of the relations

Parameters:
rel2 Relation to compare with
Returns:
Whether this relation is equal to rel2, interpreted over respective domains

StructureRelation & gbdd::StructureRelation::operator|= const StructureRelation rel2  ) 
 

OR product.

Assigns this relation to the OR product of this relation and rel2

Parameters:
rel2 Relation two
Returns:
This relation

StructureRelation gbdd::StructureRelation::product const StructureRelation r2,
bool(*  fn)(bool v1, bool v2)
const
 

Product.

General product function

Parameters:
r2 Relation to take product with
fn Product function
Returns:
Product relation R, such that R(x) iff fn(R1(x),R2(x)).

StructureRelation gbdd::StructureRelation::project unsigned int  domain_index  )  const
 

Projects away one component.

Parameters:
domain_index Domain to project
Projects away one component

Returns:
A relation where the domain with index domain_index is projected away

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, and gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >.

StructureSet gbdd::StructureRelation::project_on unsigned int  domain_index  )  const
 

Parameters:
domain_index Domain to project on
Returns:
The projected component of this relation

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, and gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >.

StructureRelation gbdd::StructureRelation::reduce_domain unsigned int  domain_index,
const Domain to
const
 

Reduces domain by projecting remaining variables.

Parameters:
domain_index Index of domain to reduce
to Domain to reduce to
Returns:
The relation with reduced domain

Reimplemented in gbdd::SpecializedRelation< StructureT, RelationT, SetT >, and gbdd::SpecializedRelation< Bdd, BddRelation, BddSet >.

void gbdd::StructureRelation::reset const Domains ds,
const StructureConstraint bb
[protected]
 

StructureRelation gbdd::StructureRelation::restrict unsigned int  domain_index,
const StructureSet to
const
 

Restricts relation.

Parameters:
domain_index Domain to restrict
to StructureSet to restrict to
Returns:
The relation restricted to to in the domain denoted by domain_index


Friends And Related Function Documentation

StructureRelation operator & const StructureRelation rel1,
const StructureRelation rel2
[friend]
 

AND product.

Parameters:
rel1 Relation one
rel2 Relation two
Returns:
AND product of rel1 and rel2

StructureRelation operator- const StructureRelation rel1,
const StructureRelation rel2
[friend]
 

MINUS product.

Parameters:
rel1 Relation one
rel2 Relation two
Returns:
MINUS product of rel1 and rel2

StructureRelation operator| const StructureRelation rel1,
const StructureRelation rel2
[friend]
 

OR product.

Parameters:
rel1 Relation one
rel2 Relation two
Returns:
OR product of rel1 and rel2


The documentation for this class was generated from the following files:
Generated on Thu Aug 12 13:21:43 2004 for gbdd by doxygen 1.3.6