The Original CHomP Software
|
A union of two hashed sets. More...
#include <setunion.h>
Public Types | |
typedef set1type::value_type | value_type |
The type of the element of each of the sets. More... | |
Public Member Functions | |
setunion (const set1type &_set1, const set2type &_set2) | |
The only allowed constructor. More... | |
setunion (const setunion< set1type, set2type > &s) | |
The copy constructor. More... | |
setunion & | operator= (const setunion< set1type, set2type > &s) |
The assignment operator. More... | |
~setunion () | |
The destructor. More... | |
const set1type & | get1 () const |
Returns a const reference to the first set in the union. More... | |
const set2type & | get2 () const |
Returns a const reference to the second set in the union. More... | |
int_t | getnumber (const typename set1type::value_type &e) const |
Finds the given element and returns its number. More... | |
bool | checknum (int_t n) const |
Checks if the given number is an index of some element in the set union. More... | |
bool | check (const typename set1type::value_type &e) const |
Checks if the given element is in the set union. More... | |
const setunion< set1type, set2type >::value_type & | operator[] (int_t n) const |
Returns the element with the given number from the set union. More... | |
const setunion< set1type, set2type >::value_type & | get (int_t n) const |
Returns the element with the given number from the set union. More... | |
int_t | size () const |
Returns the number of elements in the set union. More... | |
bool | empty () const |
Returns true if both sets are empty. Otherwise returns false. More... | |
Private Attributes | |
const set1type * | set1 |
Reference to the first set. More... | |
const set2type * | set2 |
Reference to the second set. More... | |
A union of two hashed sets.
Thanks to the template style definition, it can be used to define a union of unions of sets etc., although the efficiency of this solution decreases with the increasing recursion level.
Definition at line 60 of file setunion.h.
typedef set1type::value_type chomp::homology::setunion< set1type, set2type >::value_type |
The type of the element of each of the sets.
Definition at line 64 of file setunion.h.
|
inline |
The only allowed constructor.
Definition at line 124 of file setunion.h.
|
inline |
The copy constructor.
Definition at line 137 of file setunion.h.
|
inline |
The destructor.
Definition at line 131 of file setunion.h.
|
inline |
Checks if the given element is in the set union.
Returns true if yes, false if no.
Definition at line 185 of file setunion.h.
|
inline |
Checks if the given number is an index of some element in the set union.
That is, checks if the number is non-negative and strictly smaller than the number of elements in the set union. Returns true if yes, false if no.
Definition at line 179 of file setunion.h.
|
inline |
Returns true if both sets are empty. Otherwise returns false.
Definition at line 216 of file setunion.h.
|
inline |
Returns the element with the given number from the set union.
Definition at line 193 of file setunion.h.
|
inline |
Returns a const reference to the first set in the union.
Definition at line 153 of file setunion.h.
|
inline |
Returns a const reference to the second set in the union.
Definition at line 159 of file setunion.h.
|
inline |
Finds the given element and returns its number.
Returns -1 if the element is not in the union of the sets.
Definition at line 165 of file setunion.h.
|
inline |
The assignment operator.
Definition at line 145 of file setunion.h.
|
inline |
Returns the element with the given number from the set union.
Definition at line 204 of file setunion.h.
|
inline |
|
private |
Reference to the first set.
Definition at line 114 of file setunion.h.
|
private |
Reference to the second set.
Definition at line 117 of file setunion.h.