20 #include "SheafSystem/int_set.h" 21 #include "SheafSystem/assert_contract.h" 22 #include "SheafSystem/subposet.h" 23 #include "SheafSystem/index_iterator.h" 24 #include "SheafSystem/std_iostream.h" 25 #include "SheafSystem/std_algorithm.h" 75 for(
int i=0;i<xct;i++)
82 ensure(unexecutable(
"for all i in xmbrs: this find(i) != end()"));
119 for(
int i=0;i<xct;i++)
126 ensure(unexecutable(
"for all i in xmbrs: this find(i) != end()")) ;
155 ensure(unexecutable(
"for all i in xmbrs: this find(i) != end()"));
181 const_iterator itr = begin();
182 result = !empty() ? ++itr == end() :
false;
211 if(this_is_much_larger)
213 int_set::const_iterator itr = other->begin();
214 int_set::const_iterator other_end = other->end();
215 int_set::const_iterator this_end = end();
218 while(result && itr != other_end)
220 result = (find(*itr) != this_end);
226 result = includes(begin(), end(), other->begin(), other->end());
280 require(result != 0);
284 ::set_union(begin(), end(), other->begin(), other->end(), inserter(*result, result->begin()));
306 const_iterator oitr = other->begin();
308 while(oitr != other->end())
363 require(result != 0);
367 ::set_intersection(begin(), end(), other->begin(), other->end(), inserter(*result, result->begin()));
390 iterator sitr = begin();
391 const_iterator oitr = other->begin();
397 while(sitr != end() && oitr != other->end())
410 else if( smbr == ombr )
473 require(result != 0);
477 ::set_difference(begin(), end(), other->begin(), other->end(), inserter(*result, result->begin()));
500 iterator sitr = begin();
501 iterator oitr = other->begin();
504 if(this_is_much_larger)
508 while(oitr != other->end())
521 while(sitr != end() && oitr != other->end())
530 else if( smbr == ombr )
578 copy(c.begin(), c.end(), ostream_iterator<int>(os,
" "));
void set_intersection_sa(const int_set *other)
Intersection of this with other, self-allocated version.
An STL set representation for a set of integers.
A client handle for a subposet.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
void set_union_sa(const int_set *other)
union of this with other, self-allocated version.
bool is_singleton() const
True if set contains only a single member.
const scoped_index & index() const
The current item in the subset.
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 larg...
void next()
Makes item the next member of the subset.
void print() const
Prints membership to cout. Intended for debugging.
int_set * set_intersection(const int_set *other) const
Intersection of this with other, auto-allocated version.
void set_union_pa(const int_set *other, int_set *result) const
union of this with other, pre-allocated version.
int_set * set_union(const int_set *other) const
union of this with other, auto-allocated version.
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 ...
void set_intersection_pa(const int_set *other, int_set *result) const
Intersection of this with other, pre-allocated version.
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 ...
Iterates over the subset of Zn defined by the characteristic function host().
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 a...
bool is_done() const
True if iteration finished.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
void insert_members(const int *xmbrs, int xct)
Insert the members with indices in xmbrs.
int_set()
Default constructor.
virtual index_iterator indexed_member_iterator() const
An iterator for members of this poset; index version.