libDAI
Public Member Functions | Private Attributes | List of all members
dai::Region Class Reference

A Region is a set of variables with a counting number. More...

#include <dai/regiongraph.h>

Inheritance diagram for dai::Region:
dai::VarSet dai::SmallSet< Var >

Public Member Functions

 Region ()
 Default constructor. More...
 
 Region (const VarSet &x, Real c)
 Construct from a set of variables and a counting number. More...
 
const Realc () const
 Returns constant reference to counting number. More...
 
Realc ()
 Returns reference to counting number. More...
 
- Public Member Functions inherited from dai::VarSet
 VarSet ()
 Default constructor (constructs an empty set) More...
 
 VarSet (const SmallSet< Var > &x)
 Construct from SmallSet<Var> x. More...
 
 VarSet (const Var &v)
 Construct a VarSet with one element, v. More...
 
 VarSet (const Var &v1, const Var &v2)
 Construct a VarSet with two elements, v1 and v2. More...
 
template<typename VarIterator >
 VarSet (VarIterator begin, VarIterator end, size_t sizeHint=0)
 Construct a VarSet from the range between begin and end. More...
 
BigInt nrStates () const
 Calculates the number of states of this VarSet, which is simply the number of possible joint states of the variables in *this. More...
 
std::string toString () const
 Formats a VarSet as a string. More...
 
- Public Member Functions inherited from dai::SmallSet< Var >
 SmallSet ()
 Default constructor (constructs an empty set) More...
 
 SmallSet (const Var &t)
 Construct a set consisting of one element. More...
 
 SmallSet (const Var &t1, const Var &t2)
 Construct a set consisting of two elements. More...
 
 SmallSet (TIterator begin, TIterator end, size_t sizeHint)
 Construct a SmallSet from a range of elements. More...
 
SmallSetinsert (const Var &t)
 Inserts t into *this. More...
 
SmallSeterase (const Var &t)
 Erases t from *this. More...
 
SmallSet operator/ (const SmallSet &x) const
 Set-minus operator: returns all elements in *this, except those in x. More...
 
SmallSet operator| (const SmallSet &x) const
 Set-union operator: returns all elements in *this, plus those in x. More...
 
SmallSet operator& (const SmallSet &x) const
 Set-intersection operator: returns all elements in *this that are also contained in x. More...
 
SmallSetoperator/= (const SmallSet &x)
 Erases from *this all elements in x. More...
 
SmallSetoperator/= (const Var &t)
 Erases one element. More...
 
SmallSetoperator|= (const SmallSet &x)
 Adds to *this all elements in x. More...
 
SmallSetoperator|= (const Var &t)
 Adds one element. More...
 
SmallSetoperator&= (const SmallSet &x)
 Erases from *this all elements not in x. More...
 
bool operator<< (const SmallSet &x) const
 Returns true if *this is a subset of x. More...
 
bool operator>> (const SmallSet &x) const
 Returns true if x is a subset of *this. More...
 
bool intersects (const SmallSet &x) const
 Returns true if *this and x have elements in common. More...
 
bool contains (const Var &t) const
 Returns true if *this contains the element t. More...
 
std::vector< Var >::size_type size () const
 Returns number of elements. More...
 
bool empty () const
 Returns whether *this is empty. More...
 
std::vector< Var > & elements ()
 Returns reference to the elements. More...
 
const std::vector< Var > & elements () const
 Returns constant reference to the elements. More...
 
iterator begin ()
 Returns iterator that points to the first element. More...
 
const_iterator begin () const
 Returns constant iterator that points to the first element. More...
 
iterator end ()
 Returns iterator that points beyond the last element. More...
 
const_iterator end () const
 Returns constant iterator that points beyond the last element. More...
 
reverse_iterator rbegin ()
 Returns reverse iterator that points to the last element. More...
 
const_reverse_iterator rbegin () const
 Returns constant reverse iterator that points to the last element. More...
 
reverse_iterator rend ()
 Returns reverse iterator that points beyond the first element. More...
 
const_reverse_iterator rend () const
 Returns constant reverse iterator that points beyond the first element. More...
 
Varfront ()
 Returns reference to first element. More...
 
const Varfront () const
 Returns constant reference to first element. More...
 
Varback ()
 Returns reference to last element. More...
 
const Varback () const
 Returns constant reference to last element. More...
 
std::string toString () const
 Formats a SmallSet as a string. More...
 

Private Attributes

Real _c
 Counting number. More...
 

Additional Inherited Members

- Public Types inherited from dai::SmallSet< Var >
typedef std::vector< Var >::const_iterator const_iterator
 Constant iterator over the elements. More...
 
typedef std::vector< Var >::iterator iterator
 Iterator over the elements. More...
 
typedef std::vector< Var >::const_reverse_iterator const_reverse_iterator
 Constant reverse iterator over the elements. More...
 
typedef std::vector< Var >::reverse_iterator reverse_iterator
 Reverse iterator over the elements. More...
 

Detailed Description

A Region is a set of variables with a counting number.

Constructor & Destructor Documentation

dai::Region::Region ( )
inline

Default constructor.

dai::Region::Region ( const VarSet x,
Real  c 
)
inline

Construct from a set of variables and a counting number.

Member Function Documentation

const Real& dai::Region::c ( ) const
inline

Returns constant reference to counting number.

Real& dai::Region::c ( )
inline

Returns reference to counting number.

Member Data Documentation

Real dai::Region::_c
private

Counting number.


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