|
dReal4
|
Represents a set of variables. More...
Public Types | |
| typedef std::set< Variable >::size_type | size_type |
| typedef std::set< Variable >::iterator | iterator |
| typedef std::set< Variable >::const_iterator | const_iterator |
| typedef std::set< Variable >::reverse_iterator | reverse_iterator |
| typedef std::set< Variable >::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
| Variables (const Variables &)=default | |
| Variables & | operator= (const Variables &)=default |
| Variables (Variables &&)=default | |
| Variables & | operator= (Variables &&)=default |
| Variables ()=default | |
| Default constructor. More... | |
| ~Variables ()=default | |
| Default destructor. More... | |
| Variables (std::initializer_list< Variable > init) | |
| List constructor. More... | |
| size_t | get_hash () const |
| Returns hash value. More... | |
| size_type | size () const |
| Returns the number of elements. More... | |
| bool | empty () const |
| Checks if this set is empty or not. More... | |
| std::string | to_string () const |
| Returns string representation of Variables. More... | |
| iterator | begin () |
| Returns an iterator to the beginning. More... | |
| iterator | end () |
| Returns an iterator to the end. More... | |
| const_iterator | begin () const |
| Returns an iterator to the beginning. More... | |
| const_iterator | end () const |
| Returns an iterator to the end. More... | |
| const_iterator | cbegin () const |
| Returns a const iterator to the beginning. More... | |
| const_iterator | cend () const |
| Returns a const iterator to the end. More... | |
| reverse_iterator | rbegin () |
| Returns a reverse iterator to the beginning. More... | |
| reverse_iterator | rend () |
| Returns a reverse iterator to the end. More... | |
| const_reverse_iterator | rbegin () const |
| Returns a reverse iterator to the beginning. More... | |
| const_reverse_iterator | rend () const |
| Returns a reverse iterator to the end. More... | |
| const_reverse_iterator | crbegin () const |
| Returns a const reverse-iterator to the beginning. More... | |
| const_reverse_iterator | crend () const |
| Returns a const reverse-iterator to the end. More... | |
| void | insert (const Variable &var) |
Inserts a variable var into a set. More... | |
| template<class InputIt > | |
| void | insert (InputIt first, InputIt last) |
Inserts variables in [first, last) into a set. More... | |
| void | insert (const Variables &vars) |
Inserts variables in vars into a set. More... | |
| size_type | erase (const Variable &key) |
Erases key from a set. More... | |
| size_type | erase (const Variables &vars) |
Erases variables in vars from a set. More... | |
| iterator | find (const Variable &key) |
| Finds element with specific key. More... | |
| const_iterator | find (const Variable &key) const |
| bool | include (const Variable &key) const |
Return true if key is included in the Variables. More... | |
| bool | IsSubsetOf (const Variables &vars) const |
Return true if vars is a subset of the Variables. More... | |
| bool | IsSupersetOf (const Variables &vars) const |
Return true if vars is a superset of the Variables. More... | |
| bool | IsStrictSubsetOf (const Variables &vars) const |
Return true if vars is a strict subset of the Variables. More... | |
| bool | IsStrictSupersetOf (const Variables &vars) const |
Return true if vars is a strict superset of the Variables. More... | |
Friends | |
| bool | operator== (const Variables &vars1, const Variables &vars2) |
| bool | operator< (const Variables &vars1, const Variables &vars2) |
| std::ostream & | operator<< (std::ostream &, const Variables &vars) |
| Variables | intersect (const Variables &vars1, const Variables &vars2) |
Returns the intersection of vars1 and vars2. More... | |
Represents a set of variables.
This class is based on std::set<Variable>. The intent is to add things that we need including set-union (Variables::insert, operator+, operator+=), set-minus (Variables::erase, operator-, operator-=), and subset/superset checking functions (Variables::IsSubsetOf, Variables::IsSupersetOf, Variables::IsStrictSubsetOf, Variables::IsStrictSupersetOf).
|
default |
Default constructor.
|
default |
Default destructor.
|
inline |
Returns an iterator to the beginning.
|
inline |
Returns an iterator to the beginning.
|
inline |
Returns a const iterator to the beginning.
|
inline |
Returns a const iterator to the end.
|
inline |
Returns a const reverse-iterator to the beginning.
|
inline |
Returns a const reverse-iterator to the end.
|
inline |
Checks if this set is empty or not.
|
inline |
Returns an iterator to the end.
|
inline |
Returns an iterator to the end.
|
inline |
Erases key from a set.
Return number of erased elements (0 or 1).
| Variables::size_type erase | ( | const Variables & | vars | ) |
Erases variables in vars from a set.
Return number of erased elements ([0, vars.size()]).
|
inline |
Finds element with specific key.
| size_t get_hash | ( | ) | const |
Returns hash value.
|
inline |
Inserts a variable var into a set.
|
inline |
Inserts variables in [first, last) into a set.
|
inline |
Inserts variables in vars into a set.
| bool IsStrictSubsetOf | ( | const Variables & | vars | ) | const |
Return true if vars is a strict subset of the Variables.
| bool IsStrictSupersetOf | ( | const Variables & | vars | ) | const |
Return true if vars is a strict superset of the Variables.
| bool IsSupersetOf | ( | const Variables & | vars | ) | const |
Return true if vars is a superset of the Variables.
|
inline |
Returns a reverse iterator to the beginning.
|
inline |
Returns a reverse iterator to the beginning.
|
inline |
Returns a reverse iterator to the end.
|
inline |
Returns a reverse iterator to the end.
|
inline |
Returns the number of elements.
| string to_string | ( | ) | const |
Returns string representation of Variables.
Returns the intersection of vars1 and vars2.
This function has a time complexity of O(N₁ + N₂) where N₁ and N₂ are the size of vars1 and vars2 respectively.