21 #include "SheafSystem/poset_crg_state.impl.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/deep_size.h" 25 #include "SheafSystem/explicit_crg_interval.h" 26 #include "SheafSystem/factory.h" 27 #include "SheafSystem/implicit_crg_interval.h" 28 #include "SheafSystem/interval_index_space_handle.h" 29 #include "SheafSystem/interval_index_space_state.h" 30 #include "SheafSystem/list_index_space_handle.h" 31 #include "SheafSystem/list_index_space_state.h" 32 #include "SheafSystem/primary_index_space_handle.h" 33 #include "SheafSystem/poset_path.h" 34 #include "SheafSystem/std_iomanip.h" 35 #include "SheafSystem/std_iostream.h" 36 #include "SheafSystem/std_set.h" 37 #include "SheafSystem/std_string.h" 57 _begin.put(hub_id_space(), 0);
61 _end.put(hub_id_space(), 0);
66 _standard_member_ct = 0;
71 ensure(begin().is_hub_scope());
73 ensure(end().is_hub_scope());
74 ensure(standard_member_ct() == 0);
75 ensure(member_ct() == 0);
76 ensure(jim_edit_depth() == 0);
88 interval_map_type::iterator li_itr;
90 for(li_itr = _interval_map.begin();
91 li_itr != _interval_map.end();
94 if(li_itr->second != 0)
96 delete li_itr->second;
129 define_old_variable(
size_type old_member_ct = _member_ct);
135 _end = hub_id_space().end();
143 initialize_member_covers(result);
149 ensure(end() >= old_end);
150 ensure(member_ct() == old_member_ct + 1);
151 ensure(contains_explicit_member(result));
152 ensure(cover_is_empty(
LOWER, result));
153 ensure(cover_is_empty(
UPPER, result));
166 require(!contains_member(xid));
167 require(id_spaces().is_valid_reserved_id(xid));
172 define_old_variable(
size_type old_member_ct = _member_ct);
174 _id_spaces.new_id(xid);
178 _end = hub_id_space().end();
186 initialize_member_covers(xid);
192 ensure(end() >= old_end);
193 ensure(member_ct() == old_member_ct + 1);
194 ensure(contains_explicit_member(xid));
195 ensure(cover_is_empty(
LOWER, xid));
196 ensure(cover_is_empty(
UPPER, xid));
208 require((xid == BOTTOM_INDEX) || (xid == TOP_INDEX));
212 define_old_variable(
size_type old_member_ct = _member_ct);
224 initialize_member_covers(xid,
true);
230 ensure(end() >= xid + 1);
231 ensure(member_ct() == old_member_ct + 1);
232 ensure(contains_explicit_member(xid));
233 ensure(cover_is_empty(
LOWER, xid));
234 ensure(cover_is_empty(
UPPER, xid));
245 require(crg_interval::interval_factory().contains_prototype(xinterval_type));
251 define_old_variable(
size_type old_member_ct = _member_ct);
262 _end = hub_id_space().end();
271 crg_interval* linterval = crg_interval::new_interval(xinterval_type);
283 _interval_map[hub_id_space().end()] = linterval;
288 if(_interval_map.find(result) == _interval_map.end())
290 _interval_map[result] = 0;
293 interval_map_type::const_iterator itr = _interval_map.
begin();
294 while(itr != _interval_map.end())
301 ensure(end() >= old_end + xsize);
302 ensure(member_ct() == old_member_ct + xsize);
303 ensure(
interval(result).id_spaces_initialized());
304 ensure(
interval(result).local_id_space_initialized());
305 ensure_for_range(
pod_index_type i = result, i < end().pod(), ++i, contains_member(i));
306 ensure(unexecutable(
"atoms not in upper cover of bottom"));
318 require_for_range(
pod_index_type i=0, i<xsize, ++i, !contains_member(xid + i));
319 require(crg_interval::interval_factory().contains_prototype(xinterval_type));
325 define_old_variable(
size_type old_member_ct = _member_ct);
329 _id_spaces.new_primary_state(xid, xsize);
333 _end = hub_id_space().end();
342 crg_interval* linterval = crg_interval::new_interval(xinterval_type);
353 _interval_map[xid + xsize] = linterval;
358 if(_interval_map.find(xid) == _interval_map.end())
360 _interval_map[xid] = 0;
365 ensure(end() >= old_end);
366 ensure(member_ct() == old_member_ct + xsize);
367 ensure(
interval(xid).id_spaces_initialized());
368 ensure(
interval(xid).local_id_space_initialized());
369 ensure_for_range(
pod_index_type i=0, i<xsize, ++i, contains_member(xid + i));
370 ensure(unexecutable(
"atoms not in upper cover of bottom"));
381 require(contains_member(xid));
385 define_old_variable(
size_type old_member_ct = _member_ct);
403 _explicit_dof_tuple_map.erase(xid);
407 _member_name_map.delete_index(xid);
411 _id_spaces.delete_id(xid);
415 _end = !hub_id_space().is_empty() ? hub_id_space().end() : 0;
424 ensure(member_ct() == old_member_ct - 1);
425 ensure(!contains_member(xid));
438 require(contains_member(xid));
442 define_old_variable(
size_type old_member_ct = _member_ct);
454 define_old_variable(
size_type old_interval_size = linterval.
size());
460 _id_spaces.delete_primary_state(hub_id_space().term_id(xid));
464 _end = !hub_id_space().is_empty() ? hub_id_space().end() : 0;
468 _member_ct -= linterval.
size();
472 _interval_map.erase(linterval_end);
477 ensure(member_ct() == old_member_ct - old_interval_size);
478 ensure_for_range(
pod_index_type i = old_interval_begin, i < old_interval_end, ++i, !contains_member(i));
496 return _standard_member_ct;
503 return _standard_member_ct;
514 _standard_member_ct = xct;
518 ensure(standard_member_ct() == xct);
547 bool result = hub_id_space().contains(xid);
560 return contains_member(xid) && (implicit_member(xid) != 0);
569 return contains_member(xid) && (implicit_member(xid) == 0);
578 require(contains_member(xid));
587 return *_interval_map.upper_bound(xid)->second;
596 require(contains_member(xid));
605 return *_interval_map.upper_bound(xid)->second;
614 require(contains_member(xid));
620 crg_interval* linterval = _interval_map.upper_bound(xid)->second;
621 if(dynamic_cast<implicit_crg_interval*>(linterval) != 0)
641 require(contains_member(xid));
649 interval_map_type::iterator litr = _interval_map.upper_bound(xid);
651 if((litr == _interval_map.end()) || (litr->second == 0))
657 string lclass_name = xstandard_member_hack ?
658 "standard_member_hack_crg_interval" :
"explicit_crg_interval";
664 (crg_interval::new_interval(lclass_name));
675 _interval_map[linterval->
end()] = linterval;
680 if(_interval_map.find(linterval->
begin()) == _interval_map.end())
682 _interval_map[linterval->
begin()] = 0;
689 assertion(dynamic_cast<explicit_crg_interval*>(litr->second));
697 list_index_space_state::new_space(_id_spaces, llower_cover_id,
698 crg_interval::explicit_cover_name(
LOWER, xid),
false);
704 list_index_space_state::new_space(_id_spaces, lupper_cover_id,
705 crg_interval::explicit_cover_name(
UPPER, xid),
false);
709 ensure(cover_is_empty(
LOWER, xid));
710 ensure(cover_is_empty(
UPPER, xid));
773 ensure(result.
pod() == xid);
786 require(!has_gathered_hub_id_space());
791 _id_spaces.new_gathered_hub_id_space(xexclude_bottom);
795 ensure(has_gathered_hub_id_space());
796 ensure(gathered_hub_id_space().is_gathered());
797 ensure(xexclude_bottom == gathered_hub_id_space_excludes_bottom());
810 require(has_gathered_hub_id_space());
814 _id_spaces.update_gathered_hub_id_space();
818 ensure(gathered_hub_id_space().is_gathered());
831 require(has_gathered_hub_id_space());
839 ensure(is_basic_query);
854 bool result = _id_spaces.has_gathered_hub_id_space();
858 ensure(is_basic_query);
873 bool result = _id_spaces.gathered_hub_id_space_excludes_bottom();
877 ensure(is_basic_query);
899 return _member_name_map;
906 return _member_name_map;
924 return _jim_edit_depth > 0;
936 define_old_variable(
int old_jim_edit_depth = _jim_edit_depth);
942 ensure(jim_edit_depth() == old_jim_edit_depth + 1);
955 require(jim_edit_mode());
959 define_old_variable(
int old_jim_edit_depth = _jim_edit_depth);
965 ensure(jim_edit_depth() == old_jim_edit_depth - 1);
966 ensure(jim_edit_depth() >= 0);
979 return _jim_edit_depth;
999 require(contains_member(xmbr_index));
1003 return interval(xmbr_index).cover_is_explicit(xlower, xmbr_index);
1013 return contains_implicit_member(xmbr_index);
1022 require(contains_member(xmbr_index));
1047 _id_spaces.release_id_space(xcover_id_space);
1064 require(contains_member(xmbr_index));
1085 require(contains_member(xmbr_index));
1109 _id_spaces.release_id_space_iterator(xcover_itr);
1128 require(contains_member(xmbr_index));
1136 release_cover_id_space(lcover);
1151 require(contains_member(xmbr_index));
1157 bool result = _id_spaces.is_empty(lid);
1172 require(contains_member(xmbr_index));
1178 bool result = (_id_spaces.ct(lid) == 1);
1193 require(contains_member(xmbr_index));
1216 require(contains_member(xmbr_index));
1222 bool result = _id_spaces.contains_hub(lid, xother_mbr_index);
1239 require(contains_member(xmbr_index));
1240 require(contains_member(xother_mbr_index));
1248 set< pod_index_type > lmbr_set;
1251 lmbr_set.insert(litr.
hub_pod());
1255 release_cover_id_space_iterator(litr);
1261 set< pod_index_type > lother_set;
1264 lother_set.insert(lother_itr.
hub_pod());
1268 release_cover_id_space_iterator(lother_itr);
1272 bool result = (lmbr_set == lother_set);
1287 require(contains_member(xmbr_index));
1288 require(!cover_is_empty(xlower, xmbr_index));
1311 require(contains_member(xmbr_index));
1312 require(!cover_contains_member(xlower, xmbr_index, xother_mbr_index));
1322 _id_spaces.release_id_space(lcover);
1326 ensure(cover_contains_member(xlower, xmbr_index, xother_mbr_index));
1343 require(contains_member(xmbr_index));
1344 require(!cover_contains_member(xlower, xmbr_index, xother_mbr_index));
1355 lcover.
push(xitr, xother_mbr_index);
1357 _id_spaces.release_id_space(lcover);
1361 ensure(cover_contains_member(xlower, xmbr_index, xother_mbr_index));
1362 ensure(xitr.
pod() == old_itr_pod + 1);
1363 ensure(xitr.
hub_pod() == old_itr_hub_pod);
1378 require(contains_member(xmbr_index));
1388 _id_spaces.release_id_space(lcover);
1392 ensure(!cover_contains_member(xlower, xmbr_index, xother_mbr_index));
1408 require(contains_member(xmbr_index));
1419 lcover.
remove(xitr,
true);
1421 _id_spaces.release_id_space(lcover);
1425 ensure(!cover_contains_member(xlower, xmbr_index, old_itr_hub_pod));
1434 ensure(unexecutable(
"xitr.hub_pod() == old_next_itr_hub_pod"));
1451 require(contains_member(xmbr_index));
1452 require((xnew_other_mbr_index != xold_other_mbr_index) ? !cover_contains_member(xlower, xmbr_index, xnew_other_mbr_index) :
true);
1456 define_old_variable(
bool old_cover_contains_old_other_mbr_index = cover_contains_member(xlower, xmbr_index, xold_other_mbr_index));
1472 if(cover_contains_member(xlower, xmbr_index, xold_other_mbr_index))
1481 _id_spaces.release_id_space(lcover);
1487 ensure((xnew_other_mbr_index != xold_other_mbr_index) ? !cover_contains_member(xlower, xmbr_index, xold_other_mbr_index) :
true);
1488 ensure(old_cover_contains_old_other_mbr_index ? cover_contains_member(xlower, xmbr_index, xnew_other_mbr_index) :
true);
1501 require(contains_member(xmbr_index));
1511 _id_spaces.release_id_space(lcover);
1515 ensure(cover_is_empty(xlower, xmbr_index));
1528 require(contains_member(xmbr_index));
1529 require(contains_member(xother_mbr_index));
1546 release_cover_id_space_iterator(litr);
1548 _id_spaces.release_id_space(lcover);
1552 ensure(cover_is_equal(xlower, xmbr_index, xother_mbr_index));
1564 require(xmbr_end > xmbr_begin);
1565 require(cover_is_empty(
UPPER, BOTTOM_INDEX) || id_spaces().handle_conforms_to_state<interval_index_space_handle>(cover_id_space_id(
UPPER, BOTTOM_INDEX)));
1566 require_for_range(
pod_index_type i=xmbr_begin, i<xmbr_end, ++i, contains_member(i));
1572 if(cover_is_empty(
UPPER, BOTTOM_INDEX))
1587 _id_spaces.delete_space(lspace_id);
1591 interval_index_space_state::new_space(_id_spaces, lspace_id,
1592 crg_interval::explicit_cover_name(
UPPER, BOTTOM_INDEX),
1600 assertion(id_spaces().handle_conforms_to_state<interval_index_space_handle>(lspace_id));
1604 id_spaces().release_id_space(lcover);
1608 ensure(id_spaces().handle_conforms_to_state<interval_index_space_handle>(cover_id_space_id(
UPPER, BOTTOM_INDEX)));
1609 ensure_for_range(
pod_index_type i=xmbr_begin, i<xmbr_end, ++i, cover_contains_member(
UPPER, BOTTOM_INDEX, i));
1624 require(contains_member(xmbr_index));
1629 interval(xmbr_index).force_explicit_cover(xlower, xmbr_index, xinitialize);
1633 ensure(id_spaces().contains(result));
1634 ensure(id_spaces().handle_conforms_to_state<list_index_space_handle>(result));
1656 require(contains_member(xmbr_index));
1660 explicit_dof_tuple_map_type::const_iterator le_itr =
1661 _explicit_dof_tuple_map.find(xmbr_index);
1662 if(le_itr != _explicit_dof_tuple_map.end())
1664 return le_itr->second;
1688 require(contains_member(xmbr_index));
1692 _explicit_dof_tuple_map[xmbr_index] = xdof_tuple_id;
1696 ensure(member_dof_tuple_id(xmbr_index) == xdof_tuple_id);
1716 require(contains_member(xmbr_index));
1732 set<pod_index_type>& result)
const 1739 crg_interval::explicit_cover_map_type::const_iterator lcover_map_itr;
1740 for(lcover_map_itr = lcover_map.begin();
1741 lcover_map_itr != lcover_map.end();
1745 _id_spaces.get_id_space_iterator(lcover_map_itr->second);
1757 result.insert(lmbr_id);
1761 explicit_down_set_members(lmbr_id, result);
1767 _id_spaces.release_id_space_iterator(lcover_itr);
1782 set<pod_index_type>& result)
const 1786 require(contains_member(xmbr_index));
1801 result.insert(lmbr_id);
1805 explicit_down_set_members(lmbr_id, result);
1810 release_cover_id_space_iterator(itr);
1861 ensure(result != 0);
1878 if(invariant_check())
1880 disable_invariant_check();
1882 invariance(begin().is_hub_scope());
1883 invariance(begin() == BOTTOM_INDEX);
1884 invariance(end().is_hub_scope());
1886 invariance(member_ct() >= standard_member_ct());
1887 invariance(standard_member_ct() >= 0);
1888 invariance(jim_edit_depth() >= 0);
1890 enable_invariant_check();
1919 <<
"ROW GRAPH" << endl
1920 <<
"---------" << endl
1923 os <<
"Members and Covering Relation" << endl
1924 <<
"-----------------------------" << endl
1927 os <<
" member_ct = " 1935 typedef name_map_type::name_list_type name_list_type;
1936 typedef name_map_type::const_name_iterator name_itr_type;
1940 int lname_width = 0;
1946 for(name_itr_type lname_itr = lname_list.begin(); lname_itr != lname_list.end(); ++lname_itr)
1948 int lname_len = lname_itr->size();
1949 lname_width = (lname_width >= lname_len) ? lname_width : lname_len;
1964 os <<
"index: " << setw(5) << i.hub_pod();
1967 typedef name_map_type::name_list_type name_list_type;
1968 typedef name_map_type::const_name_iterator name_itr_type;
1970 const name_list_type lname_list =
1972 name_itr_type lname_itr = lname_list.begin();
1975 if(lname_itr != lname_list.end())
1977 lfirst_name = *lname_itr;
1981 os <<
" " << setw(lname_width) << left << lfirst_name << right;
1984 << setw(2*
sizeof(
int)+3)
1987 os <<
" upper_cover:";
1991 os <<
" " << uc_itr.
hub_pod();
1998 int ltab_ct = 3 - (3*
static_cast<int>(p.
cover_ct(
UPPER, i.hub_pod())))/8;
2000 for(
int ltab = 0; ltab < ltab_ct; ltab++)
2005 os <<
"lower_cover:";
2009 os <<
" " << lc_itr.
hub_pod();
2016 while(lname_itr != lname_list.end())
2019 os <<
" " << setw(lname_width) << left << *lname_itr << right << endl;
2029 <<
"Member Id Space Family" << endl
2030 <<
"----------------------" << endl
2048 size_t id_space_result;
2054 result = xinclude_shallow ?
sizeof(xp) : 0;
2056 typedef unordered_map<pod_index_type, pod_index_type> implicit_member_map_type;
2059 typedef map<pod_index_type, crg_interval*> crg_interval_map_type;
2064 id_space_result = deep_size(xp._id_spaces,
false);
2066 crg_result = deep_size<pod_index_type, pod_index_type, implicit_member_map_policy_type>(xp._explicit_dof_tuple_map,
false);
2067 crg_result += deep_size<pod_index_type, crg_interval*, crg_interval_map_policy_type>(xp._interval_map,
false);
2068 crg_result += deep_size(xp._member_name_map,
false);
2070 xresults[0] = crg_result;
2071 xresults[1] = id_space_result;
2072 result = id_space_result + crg_result;
2076 ensure(result >= 0);
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
virtual pod_index_type dof_tuple_id(pod_index_type xmbr_index) const =0
The dof tuple id of the member with index xmbr_index.
pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize)
Create an implicit interval of type xinterval_type with size xsize.
pod_index_type member_dof_tuple_id(pod_index_type xmbr_index) const
The dof tuple index of the member with index xmbr_index; invalid if xmbr_index has not dof tuple...
The data structure representing the cover relation graph of a poset.
index_space_handle & get_cover_id_space(bool xlower, pod_index_type xmbr_index) const
Allocates an handle for the lower (xlower true) or upper (xlower false) cover of member with index xm...
const scoped_index & hub_id() const
A id in the hub id space; intended for copying to initialize ids to the hub id space.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
poset_crg_state()
Creates an instance.
An abstract iterator over the ids of an id space.
bool contains_member(pod_index_type xid) const
True if and only if there exists a member with index xid.
implicit_crg_interval * implicit_member(pod_index_type xid) const
The implicit interval for the member with index xid. Returns null, if no implicit interval exists...
pod_type pod() const
The current id in the iteration.
standard_member_index
Ids for standard poset members.
void delete_interval(pod_index_type xid)
Delete the entire implicit interval that contains the implicit member with index xid.
bool cover_contains_member(bool xlower, pod_index_type xmbr_index, pod_index_type xother_mbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
virtual poset_crg_state * clone() const
Make a new instance of the same type as this.
const index_space_handle & gathered_hub_id_space() const
The gathered hub id space.
const name_list_type & all_names(index_type xindex) const
All names associated with index xindex.
size_type remove(const scoped_index &xid, bool update_extrema)
Removes the equivalence associated with xid.hub_pod(). synonym for remove_hub(xid.hub_pod(), xupdate_extrema). Returns the number of entries actually removed, either 0 or 1.
member_name_map_type & member_name_map()
Bi-directional map between member names and indices.
void explicit_down_set_members(const implicit_crg_interval &xinterval, std::set< pod_index_type > &result) const
The explicit members in the downset of the interval xinterval.
explicit_cover_map_type & explicit_cover_map(bool xlower)
The lower (xlower true) or upper (xlower false) map to explicit cover id spaces.
void initialize_covers()
Initialize the upper and lower covers for this interval.
void clear()
Delete all ids.
An map implementation of class scattered_insertion_index_space_handle. This representation is intende...
void release_cover_id_space(index_space_handle &xcover_id_space) const
Returns cover handle xcover_id_space to the pool of id spaces.
A partial multi-valued relation with total injective inverse between names and indices of type index_...
Call deep_size on the dereferenced pointer of the value.
pod_index_type new_member()
Create a new member with explicit lower and upper cover.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
void initialize_member_covers(pod_index_type xid, bool xstandard_member_hack=false)
Initialize the upper and lower covers for member with index xid.
pod_index_type begin() const
The beginning of the member interval; this emulates members in the interval [begin(), end()), includes interval member.
const index_space_handle & new_gathered_hub_id_space(bool xexclude_bottom)
Create a new gathered id space from the hub id space. If xexclude_bottom, construct the id space with...
virtual bool invariant() const
Class invariant.
virtual index_space_handle & get_id_space() const =0
Allocates an id space handle from the handle pool attached to the same id space.
virtual void next()=0
Makes id() the next id in the iteration.
void delete_member(pod_index_type xid)
Delete member with index xid.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to current.
virtual bool is_attached() const =0
True if this handle is attached to a state.
void copy_cover(bool xlower, pod_index_type xmbr_index, pod_index_type xother_mbr_index)
Copies the lower (xlower true) or upper (xlower false) cover from the member with index xmbr_index to...
void initialize_local_id_space(const index_space_handle &xlocal_id_space)
Sets the local id space to xlocal_id_space and initializes local ids.
An implementation of class sum_index_space_handle that has a primary sum id space state...
pod_index_type cover_id_space_id(bool xlower, pod_index_type xmbr_index) const
The id for the lower (xlower true) or upper (xlower false) cover id space with index xmbr_index...
const hub_index_space_handle & hub_id_space() const
The hub id space.
const hub_index_space_handle & hub_id_space() const
Hub id space for this poset.
void initialize_id_spaces(index_space_family &xid_spaces)
Set the index space family to xid_spaces.
Abstract implementation of crg_interval for an interval of implicit cover relation graph members...
An implementation of class explicit_index_space_handle that has a primary id space state...
const scoped_index & begin() const
The beginning of the member interval; members have indices in the interval [begin(), end()).
void new_standard_member_hack(standard_member_index xid)
Create a new bottom or top member.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
pod_index_type force_explicit_cover(bool xlower, pod_index_type xmbr_index, bool xinitialize=true)
The explicit lower (xlower true) or upper (xlower false) cover id space of the member with index xmbr...
Abstract base class with useful features for all objects.
pod_index_type first_cover_member(bool xlower, pod_index_type xmbr_index) const
The first member of the lower (xlower true) or upper (xlower false) cover of the member with index xm...
bool contains_implicit_member(pod_index_type xid) const
True if and only if there exists an implicit member with index xid. A member is implicit if it has im...
Abstract emulator for an interval of cover relation graph members.
Struct representing the closed interval [_begin, _end].
bool is_done() const
True if iteration is finished.
pod_index_type end() const
The end of the member interval.
virtual index_space_handle & get_id_space() const
Allocates an id space handle from the handle pool.
void append_upper_cover_of_bottom(pod_index_type xmbr_begin, pod_index_type xmbr_end)
Appends the interval of ids [xbegin, xend) to the upper cover of bottom. This function is intended to...
Do not call deep_size on either the key or value.
bool cover_is_implicit(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
pod_index_type cover_id_space_id(bool xlower, pod_index_type xmbr_index) const
The id for the lower (xlower true) or upper (xlower false) cover id space with index xmbr_index...
An index within the external ("client") scope of a given id space.
bool contains_explicit_member(pod_index_type xid) const
True if and only if there exists an fully explicit member with index xid. A member is fully explicit ...
const scoped_index & end() const
The end of the member interval; members have indices in the interval [begin(), end()).
bool has_gathered_hub_id_space() const
True if there is a gathered hub id space.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
bool cover_is_empty(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
~poset_crg_state()
Destructor.
void request_jim_edit_mode()
Request jim editing be enabled.
bool gathered_hub_id_space_excludes_bottom() const
True, if the gathered hub id space excludes BOTTOM_INDEX.
size_type member_ct() const
The number of members.
const bool UPPER
Selector for upper cover.
size_type remove_hub(pod_type xhub_id, bool update_extrema)
Removes the equivalence associated with hub id xhub_id. Returns the number of entries actually remove...
size_type cover_ct(bool xlower, pod_index_type xmbr_index) const
The number of members in the lower (xlower true) or upper (xlower false) cover of the member with ind...
void push_interval(const scoped_index &xhub_begin, const scoped_index &xhub_end)
Push the closed interval [xhub_begin.hub_pod(), xhub_end.hub_pod()] to the end of this space...
void insert_cover_member(pod_index_type xother_mbr_index, bool xlower, pod_index_type xmbr_index)
Inserts xother_mbr_index in the lower (xlower true) or upper (xlower false) cover of the member with ...
void update_gathered_hub_id_space()
Updates the gathered hub id space.
bool cover_is_equal(bool xlower, pod_index_type xmbr_index, pod_index_type xother_mbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
const index_space_family & id_spaces() const
Collection of id spaces for this poset.
index_space_iterator & get_cover_id_space_iterator(bool xlower, pod_index_type xmbr_index) const
Allocates an iterator for for the lower (xlower true) or upper (xlower false) cover of member with in...
virtual bool allocated_iterator(const index_space_iterator &xitr) const =0
True if and only if id space iterator xitr was allocated by the iterator pool.
const bool LOWER
Selector for lower cover.
void remove_cover_member(pod_index_type xother_mbr_index, bool xlower, pod_index_type xmbr_index)
Removes xother_mbr_index from the lower (xlower true) or upper (xlower false) cover of the member wit...
size_type size() const
The number of members in the member interval.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
size_type standard_member_ct()
The number of standard members automatically allocated by the poset handle constructor (mutable versi...
void release_jim_edit_mode()
Request jim editing be disabled.
bool cover_is_singleton(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
int_type pod_index_type
The plain old data index type.
bool cover_contains_iterator(bool xlower, pod_index_type xmbr_index, const index_space_iterator &xitr) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
void put_standard_member_ct(size_type xct)
Put the number of standard members automatically allocated by the poset handle constructor.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
bool cover_is_explicit(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of the member with index xm...
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
void clear_cover(bool xlower, pod_index_type xmbr_index)
Clears the lower (xlower true) or upper (xlower false) cover of the member with index xmbr_index...
void replace_cover_member(pod_index_type xold_other_mbr_index, pod_index_type xnew_other_mbr_index, bool xlower, pod_index_type xmbr_index)
Replaces xold_other_mbr_index with xnew_other_mbr_index in the lower (xlower true) or upper (xlower f...
void replace_range_id(pod_type xold_range_id, pod_type xnew_range_id)
Replaces xold_range_id with xnew_range_id.
Factory and container for a family of id spaces.
void put_member_dof_tuple_id(pod_index_type xmbr_index, pod_index_type xdof_tuple_id)
Sets the dof tuple index of the member with index xmbr_index to xdof_tuple_id.
bool cover_is_explicit(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover with index xmbr_index is ex...
unordered::unordered_map< pod_index_type, pod_index_type > explicit_cover_map_type
The type of the explicit cover maps..
int jim_edit_depth() const
Jim edit mode depth counter.
pod_type offset() const
The offset into the hub id space.
void clean_cover(bool xlower, pod_index_type xmbr_index)
Removes members of the cover that are no longer members of the crg.
const crg_interval & interval(pod_index_type xid) const
The interval for the member with index xid (const version).
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
void push(index_space_iterator &xitr, const scoped_index &xhub_id)
Makes id xitr.id() in this id space equivalent to xhub_id in the hub id space. Increments all ids gre...
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
bool jim_edit_mode() const
True if jim editing is enabled.
Implementation of crg_interval for explicit members of the poset.
void release_cover_id_space_iterator(index_space_iterator &xcover_itr) const
Returns cover iterator xcover_itr to the pool of id spaces.