SheafSystem
0.0.0.0
|
An STL set representation for a set of integers. More...
#include <int_set.h>
Public Member Functions | |
int_set () | |
Default constructor. More... | |
int_set (const int_set &other) | |
Copy constructor. More... | |
int_set (const int *xmbrs, int xct) | |
Constructs an instance with the xct members given in xmbrs. More... | |
~int_set () | |
Destructor. More... | |
void | insert_member (int xmbr) |
Insert member with index xmbr; just for consistency with subposet. More... | |
void | remove_member (int xmbr) |
Remove member with index xmbr; just for consistency with subposet. More... | |
void | insert_members (const int *xmbrs, int xct) |
Insert the members with indices in xmbrs. More... | |
void | insert_members (const subposet *xmbrs) |
Insert the members with indices in xmbrs. More... | |
bool | contains (int xindex) const |
True if this set contains xindex Deprecated - use contains_member(int xindex) More... | |
bool | contains_member (int xindex) const |
True if this set contains xindex True if this set contains xindex. More... | |
bool | is_singleton () const |
True if set contains only a single member. More... | |
bool | set_includes (const int_set *other, bool this_is_much_larger=false) const |
True if this cover set includes other; If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm. More... | |
int_set * | set_union (const int_set *other) const |
union of this with other, auto-allocated version. More... | |
void | set_union_pa (const int_set *other, int_set *result) const |
union of this with other, pre-allocated version. More... | |
void | set_union_sa (const int_set *other) |
union of this with other, self-allocated version. More... | |
int_set * | set_intersection (const int_set *other) const |
Intersection of this with other, auto-allocated version. More... | |
void | set_intersection_pa (const int_set *other, int_set *result) const |
Intersection of this with other, pre-allocated version. More... | |
void | set_intersection_sa (const int_set *other) |
Intersection of this with other, self-allocated version. More... | |
int_set * | set_difference (const int_set *other) const |
Difference of this and other (this minus other), auto-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm. More... | |
void | set_difference_pa (const int_set *other, int_set *result) const |
Difference of this and other (this minus other), pre-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm. More... | |
void | set_difference_sa (int_set *other, bool this_is_much_larger=false) |
Difference of this and other (this minus other), self-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm. More... | |
void | print () const |
Prints membership to cout. Intended for debugging. More... | |
sheaf::int_set::int_set | ( | ) |
Default constructor.
Definition at line 31 of file int_set.cc.
Referenced by int_set(), set_difference(), set_intersection(), and set_union().
sheaf::int_set::int_set | ( | const int_set & | other | ) |
sheaf::int_set::int_set | ( | const int * | xmbrs, |
int | xct | ||
) |
Constructs an instance with the xct members given in xmbrs.
Definition at line 64 of file int_set.cc.
References ~int_set().
sheaf::int_set::~int_set | ( | ) |
Destructor.
Definition at line 92 of file int_set.cc.
References insert_members().
Referenced by int_set().
|
inline |
True if this set contains xindex Deprecated - use contains_member(int xindex)
Definition at line 104 of file int_set.h.
Referenced by tool::visualization_iterator_1_1::next(), and tool::visualization_iterator_1_3::next().
|
inline |
|
inline |
void sheaf::int_set::insert_members | ( | const int * | xmbrs, |
int | xct | ||
) |
Insert the members with indices in xmbrs.
Definition at line 108 of file int_set.cc.
Referenced by ~int_set().
void sheaf::int_set::insert_members | ( | const subposet * | xmbrs | ) |
Insert the members with indices in xmbrs.
Definition at line 137 of file int_set.cc.
References sheaf::index_iterator::index(), sheaf::subposet::indexed_member_iterator(), sheaf::index_iterator::is_done(), is_singleton(), sheaf::index_iterator::next(), and sheaf::scoped_index::pod().
bool sheaf::int_set::is_singleton | ( | ) | const |
True if set contains only a single member.
Definition at line 169 of file int_set.cc.
References set_includes().
Referenced by insert_members().
void sheaf::int_set::print | ( | ) | const |
Prints membership to cout. Intended for debugging.
Definition at line 561 of file int_set.cc.
References sheaf::operator<<().
Referenced by set_difference_sa().
|
inline |
sheaf::int_set * sheaf::int_set::set_difference | ( | const int_set * | other | ) | const |
Difference of this and other (this minus other), auto-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm.
Definition at line 439 of file int_set.cc.
References int_set(), and set_difference_pa().
Referenced by set_difference_pa(), and set_intersection_sa().
Difference of this and other (this minus other), pre-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm.
Definition at line 467 of file int_set.cc.
References set_difference(), and set_difference_sa().
Referenced by set_difference().
void sheaf::int_set::set_difference_sa | ( | int_set * | other, |
bool | this_is_much_larger = false |
||
) |
Difference of this and other (this minus other), self-allocated version. If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm.
Definition at line 490 of file int_set.cc.
References print().
Referenced by set_difference_pa().
bool sheaf::int_set::set_includes | ( | const int_set * | other, |
bool | this_is_much_larger = false |
||
) | const |
True if this cover set includes other; If this_is_much_larger then assume this cover set is much larger than other and use an other->size()*log(size()) algorithm rather than a other->size()+ size() algorithm.
Definition at line 201 of file int_set.cc.
References set_union().
Referenced by is_singleton().
sheaf::int_set * sheaf::int_set::set_intersection | ( | const int_set * | other | ) | const |
Intersection of this with other, auto-allocated version.
Definition at line 329 of file int_set.cc.
References int_set(), and set_intersection_pa().
Referenced by set_intersection_pa(), and set_union_sa().
Intersection of this with other, pre-allocated version.
Definition at line 357 of file int_set.cc.
References set_intersection(), and set_intersection_sa().
Referenced by set_intersection().
void sheaf::int_set::set_intersection_sa | ( | const int_set * | other | ) |
Intersection of this with other, self-allocated version.
Definition at line 380 of file int_set.cc.
References set_difference().
Referenced by set_intersection_pa().
sheaf::int_set * sheaf::int_set::set_union | ( | const int_set * | other | ) | const |
union of this with other, auto-allocated version.
Definition at line 246 of file int_set.cc.
References int_set(), and set_union_pa().
Referenced by set_includes(), and set_union_pa().
union of this with other, pre-allocated version.
Definition at line 274 of file int_set.cc.
References set_union(), and set_union_sa().
Referenced by set_union().
void sheaf::int_set::set_union_sa | ( | const int_set * | other | ) |
union of this with other, self-allocated version.
Definition at line 297 of file int_set.cc.
References set_intersection().
Referenced by set_union_pa().