21 #include "SheafSystem/abstract_poset_member.impl.h" 22 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/array_poset_dof_map.h" 25 #include "SheafSystem/array_index_space_state.h" 26 #include "SheafSystem/dof_descriptor_array.h" 27 #include "SheafSystem/error_message.h" 28 #include "SheafSystem/index_space_iterator.h" 29 #include "SheafSystem/scattered_insertion_index_space_handle.h" 30 #include "SheafSystem/namespace_poset.h" 31 #include "SheafSystem/pool.h" 32 #include "SheafSystem/poset.h" 33 #include "SheafSystem/poset_crg_state.h" 34 #include "SheafSystem/poset_dof_map.h" 35 #include "SheafSystem/poset_joiner.h" 36 #include "SheafSystem/poset_path.h" 37 #include "SheafSystem/poset_slicer.h" 38 #include "SheafSystem/poset_state.h" 39 #include "SheafSystem/poset_state_handle.h" 40 #include "SheafSystem/postorder_itr.h" 41 #include "SheafSystem/preorder_itr.h" 42 #include "SheafSystem/primitives_poset.h" 43 #include "SheafSystem/primitives_poset_dof_map.h" 44 #include "SheafSystem/primitives_poset_schema.h" 45 #include "SheafSystem/schema_poset_member.h" 46 #include "SheafSystem/sheaves_namespace.h" 47 #include "SheafSystem/hub_index_space_handle.h" 48 #include "SheafSystem/std_set.h" 49 #include "SheafSystem/std_vector.h" 50 #include "SheafSystem/stop_watch.h" 51 #include "SheafSystem/subposet.h" 52 #include "SheafSystem/subposet_member_iterator.h" 53 #include "SheafSystem/subposet_state.h" 54 #include "SheafSystem/tern.h" 55 #include "SheafSystem/triorder_itr.h" 56 #include "SheafSystem/zn_to_bool.h" 76 return reinterpret_cast<dof_type*
>(
this)[xi];
83 return reinterpret_cast<const dof_type*
>(
this)[xi];
112 return reinterpret_cast<dof_type*
>(
this)[xi];
119 return reinterpret_cast<const dof_type*
>(
this)[xi];
154 require(!xhost_path.
empty());
157 require(xschema_path.
full());
163 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xauto_access);
167 ensure(xns.
owns(result, xauto_access));
168 ensure(result.path(
true) == xhost_path);
169 ensure(result.state_is_not_read_accessible());
170 ensure(result.schema(
true).path(xauto_access) == xschema_path);
197 attach_to_state(&xother);
201 ensure(is_same_state(&xother));
226 clone(
bool xnew_state,
bool xauto_access)
const 231 require(is_attached());
232 require(xauto_access || (xnew_state ? host()->in_jim_edit_mode() :
233 host()->state_is_read_accessible()));
250 host()->get_read_access();
255 host()->release_access();
261 ensure(is_same_type(result));
276 require(!xauto_access ? host()->in_jim_edit_mode() :
true);
284 host()->begin_jim_edit_mode();
290 require(xdof_map != 0 ? host()->row_dof_map_conforms(xdof_map) :
true);
291 require(xdof_map != 0 ? dof_map_is_ancestor_of(xdof_map) :
true);
301 pod_index_type lindex = _host->new_member(
true, xdof_map, xcopy_dof_map);
302 attach_to_state(lindex);
307 ensure(is_attached());
308 ensure(!is_restricted());
314 host()->end_jim_edit_mode();
331 require(!xauto_access ? host()->in_jim_edit_mode() :
true);
337 host()->begin_jim_edit_mode();
339 require(host()->contains_row_dof_tuple(xtuple_id));
349 attach_to_state(lindex);
354 ensure(is_attached());
355 ensure(!is_restricted());
356 ensure(dof_tuple_id(
false) == xtuple_id);
361 host()->end_jim_edit_mode();
374 require(!xauto_access ? host()->in_jim_edit_mode() :
true);
380 host()->begin_jim_edit_mode();
382 require(host()->contains_row_dof_tuple(xtuple_id));
386 new_jim_state(xtuple_id.
hub_pod(), xauto_access);
391 ensure(is_attached());
392 ensure(!is_restricted());
393 ensure(dof_tuple_id(
false) == xtuple_id.
hub_pod());
398 host()->end_jim_edit_mode();
426 require(host_is_ancestor_of(xhost));
428 require(xdof_map != 0 ? dof_map_is_ancestor_of(xdof_map) :
true);
437 attach_to_state(xhost, lindex);
441 ensure(abstract_poset_member::invariant());
442 ensure(unexecutable(host()->member_ct() == old host->member_ct() + 1));
443 ensure(is_attached());
444 ensure(!is_restricted());
476 require(host_is_ancestor_of(xhost));
485 attach_to_state(xhost, lindex);
489 ensure(abstract_poset_member::invariant());
490 ensure(unexecutable(host()->member_ct() == old host->member_ct() + 1));
491 ensure(is_attached());
492 ensure(!is_restricted());
493 ensure(dof_tuple_id(
false) == xtuple_id);
520 require(host_is_ancestor_of(xhost));
525 new_jim_state(xhost, xtuple_id.
hub_pod(),
false);
529 ensure(abstract_poset_member::invariant());
530 ensure(unexecutable(host()->member_ct() == old host->member_ct() + 1));
531 ensure(is_attached());
532 ensure(!is_restricted());
533 ensure(dof_tuple_id(
false) == xtuple_id.
hub_pod());
551 require(xauto_access ? is_attached() : state_is_read_write_accessible());
557 host()->get_read_write_access(
true);
566 attach_to_state(host()->new_member(
false));
570 ensure(abstract_poset_member::invariant());
571 ensure(is_attached());
572 ensure(!is_restricted());
578 host()->release_access();
593 require(host_is_ancestor_of(xhost));
612 attach_to_state(xhost, lmbr_id);
616 ensure(abstract_poset_member::invariant());
617 ensure(is_attached());
618 ensure(!is_restricted());
636 const tern& xgreatest,
641 require(xauto_access ? is_attached() : state_is_read_write_accessible());
642 require(precondition_of(new_jrm_state(host(), xexpansion, xexpansion_ct, xgreatest, xauto_access)));
646 new_jrm_state(host(), xexpansion, xexpansion_ct, xgreatest,
false);
650 ensure(postcondition_of(new_jrm_state(host(), xexpansion, xexpansion_ct, xgreatest, xauto_access)));
662 const tern& xgreatest,
668 require(host_is_ancestor_of(xhost));
670 require(xexpansion != 0);
689 joiner.join(xexpansion, xexpansion_ct, xgreatest, *
this);
694 ensure(is_attached());
695 ensure(!is_restricted());
696 ensure(host() == xhost);
697 ensure(unexecutable(is_jim() ==
this is
max member of xexpansion));
717 require(xother != 0);
719 require(precondition_of(new_jem_state(xother->
host(), xother->
index(), xgreatest, xauto_access)));
723 new_jem_state(xother->
host(), xother->
index(), xgreatest, xauto_access);
727 require(postcondition_of(new_jem_state(xother->
host(), xother->
index(), xgreatest, xauto_access)));
745 require(host_is_ancestor_of(xhost));
769 attach_to_state(xhost, lindex);
774 ensure(is_attached());
775 ensure(!is_restricted());
776 ensure(host()->is_jem(xhub_id, index().pod()));
782 (host()->greatest_jem(xhub_id) == index().pod() ||
783 host()->greatest_jem(xhub_id) == TOP_INDEX) :
784 (host()->least_jem(xhub_id) == index().pod() ||
785 host()->is_jim(host()->least_jem(xhub_id)) ||
786 host()->least_jem(xhub_id) == BOTTOM_INDEX));
809 require(precondition_of(new_jem_state(xhost, xindex.hub_pod(), xgreatest, xauto_access)));
813 new_jem_state(xhost, xid.
hub_pod(), xgreatest, xauto_access);
817 ensure(postcondition_of(new_jem_state(xhost, xindex.hub_pod(), xgreatest, xauto_access)));
836 ensure(!is_attached());
845 require(state_is_read_accessible());
846 require(unexecutable(data members created));
861 ensure(!is_restricted());
874 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
878 char* result = host()->table_dof_map(xrequire_write_access).dofs();
897 require(xrequire_write_access ? state_is_read_write_accessible() : state_is_read_accessible());
902 reinterpret_cast<char*
>(dof_map(xrequire_write_access).dof_tuple());
931 require(state_is_read_accessible());
935 result = host()->is_jim(index(), xin_current_version);
952 require(state_is_read_accessible());
956 result = host()->is_atom(index());
982 require(state_is_read_accessible());
997 ensure(result.
le(&(unrestricted_schema())));
1010 require(state_is_read_accessible());
1025 ensure(result.
le(&(unrestricted_schema())));
1038 require(xauto_access || state_is_read_accessible());
1057 ensure(postcondition_of(schema()));
1070 require(xauto_access || state_is_read_accessible());
1088 ensure(postcondition_of(schema()));
1101 require(state_is_read_accessible());
1118 ensure(result.
leqv(host()->schema().index()));
1131 require(state_is_read_accessible());
1148 ensure(result.
leqv(host()->schema().index()));
1163 require(state_is_read_accessible());
1167 result = schema().name() == xschema_name;
1184 require(state_is_read_accessible());
1185 require(xother != 0);
1191 result = schema().is_same_state(&(xother->
schema()));
1219 require(is_attached() ? state_is_read_accessible() :
true);
1223 result = ( is_attached() && !schema().is_same_state(&(unrestricted_schema())) );
1227 ensure(result == ( is_attached() && !schema().is_same_state(&(unrestricted_schema())) ));
1242 require(is_attached() ? state_is_read_accessible() :
true);
1243 require(xother != 0);
1259 ensure(unexecutable(result ==
this and xother are attached and have the same schema or both are unattached));
1283 require(xrequire_write_access ?
1284 state_is_read_write_accessible() :
1285 state_is_read_accessible());
1286 require(is_jim(
false));
1290 return _host->member_dof_map(_index.pod(), xrequire_write_access);
1299 require(xrequire_write_access ?
1300 state_is_read_write_accessible() :
1301 state_is_read_accessible());
1302 require(is_jim(
false));
1306 return _host->member_dof_map(_index.pod(), xrequire_write_access);
1317 require(xdof_map != 0);
1339 require(state_is_read_accessible());
1340 require(!is_restricted());
1342 require(unexecutable(xbuf points to a buffer of
length xbuflen));
1343 require(xbuflen >= dof_map().dof_tuple_ub());
1347 dof_map().get_dof_tuple(const_cast<void*>(xbuf), xbuflen);
1351 ensure(unexecutable(xbuf contains copy of dof
tuple));
1364 require(state_is_read_write_accessible());
1365 require(!is_restricted());
1367 require(unexecutable(xbuf points to a buffer of
length xbuflen));
1368 require(xbuflen >= dof_map().dof_tuple_ub());
1369 require(unexecutable(xbuf contains copy of dof
tuple));
1373 dof_map().put_dof_tuple(xbuf, xbuflen);
1377 ensure(unexecutable(dof tuple has been copied to
internal storage));
1390 require(state_is_auto_read_accessible(xauto_access));
1394 pod_index_type result = host()->member_dof_tuple_id(index().pod(), xauto_access);
1398 ensure(host()->contains_row_dof_tuple(result) || (!
is_valid(result)));
1411 require(state_is_auto_read_accessible(xauto_access));
1415 host()->member_dof_tuple_id(index(), result, xauto_access);
1419 ensure(host()->contains_row_dof_tuple(result) || (!result.
is_valid()));
1432 require(state_is_auto_read_write_accessible(xauto_access));
1433 require(host()->contains_row_dof_tuple(xtuple_index) || !
is_valid(xtuple_index));
1437 host()->put_member_dof_tuple_id(_index.pod(), xtuple_index, xauto_access);
1441 ensure(dof_tuple_id(xauto_access) == xtuple_index);
1454 require(state_is_auto_read_write_accessible(xauto_access));
1455 require(host()->contains_row_dof_tuple(xtuple_index) || !xtuple_index.
is_valid());
1459 host()->put_member_dof_tuple_id(_index, xtuple_index, xauto_access);
1463 ensure(dof_tuple_id(xauto_access) == xtuple_index.
hub_pod());
1476 require(state_is_read_write_accessible());
1480 void* result = _host->table_dof_map(
true).dof_tuple();
1495 require(state_is_read_accessible());
1499 const void* result = _host->table_dof_map(
false).dof_tuple();
1514 require(state_is_auto_read_write_accessible(xauto_access));
1520 get_read_write_access(
true);
1543 require(state_is_auto_read_accessible(xauto_access));
1572 require(state_is_read_write_accessible());
1576 void* result = _host->member_dof_map(_index.pod(),
true).dof_tuple();
1591 require(state_is_read_accessible());
1595 const void* result = _host->member_dof_map(_index.pod(),
false).dof_tuple();
1610 require(state_is_auto_read_write_accessible(xauto_access));
1616 get_read_write_access(
true);
1639 require(state_is_auto_read_accessible(xauto_access));
1679 require(state_is_read_accessible());
1680 require(schema().row_dof_id_space().contains(xdof_id));
1699 require(state_is_auto_read_accessible(xauto_access));
1700 require(schema(xauto_access).row_dof_id_space(xauto_access).contains(xdof_id));
1729 require(state_is_read_write_accessible());
1730 require(schema().row_dof_id_space().contains(xdof_id));
1731 require(xdof.
id() == schema().type(xdof_id,
false));
1735 dof_map(
true).put_dof(xdof_id, xdof);
1739 ensure(dof(xdof_id) == xdof);
1752 require(state_is_auto_read_write_accessible(xauto_access));
1753 require(schema(xauto_access).row_dof_id_space(xauto_access).contains(xdof_id));
1754 require(xdof.
id() == schema(xauto_access).type(xdof_id,
false, xauto_access));
1760 get_read_write_access(
true);
1763 dof_map(
true).put_dof(xdof_id, xdof);
1772 ensure(dof(xdof_id.
hub_pod()) == xdof);
1785 require(state_is_read_accessible());
1786 require(schema().row_dof_id_space().contains(xdof_id));
1787 require(unexecutable(
"xdof points to buffer of size xdof_size"));
1788 require(xdof_size >= schema().size(xdof_id,
false));
1792 dof_map(
false).get_dof(xdof_id, xdof, xdof_size);
1807 require(state_is_auto_read_accessible(xauto_access));
1808 require(schema(xauto_access).row_dof_id_space(xauto_access).contains(xdof_id));
1809 require(unexecutable(
"xdof points to buffer of size xdof_size"));
1810 require(xdof_size >= schema(xauto_access).size(xdof_id,
false, xauto_access));
1819 dof_map(
false).get_dof(xdof_id, xdof, xdof_size);
1839 require(state_is_read_write_accessible());
1840 require(schema().row_dof_id_space().contains(xdof_id));
1841 require(unexecutable(
"xdof points to buffer of size xdof_size"));
1842 require(xdof_size >= schema().size(xdof_id,
false));
1846 dof_map(
true).put_dof(xdof_id, xdof, xdof_size);
1861 require(state_is_auto_read_write_accessible(xauto_access));
1862 require(schema(xauto_access).row_dof_id_space(xauto_access).contains(xdof_id));
1863 require(unexecutable(
"xdof points to buffer of size xdof_size"));
1864 require(xdof_size >= schema(xauto_access).size(xdof_id,
false, xauto_access));
1870 get_read_write_access(
true);
1873 dof_map(
true).put_dof(xdof_id, xdof, xdof_size);
1906 require(state_is_read_accessible());
1907 require(host()->contains_member(xother_index));
1911 result = _host->le(xother_index, _index.pod());
1915 ensure(unexecutable(other is in the up
set 1931 require(state_is_read_accessible());
1932 require(host()->contains_member(xother_index));
1936 result = le(xother_index.
hub_pod());
1940 ensure(unexecutable(other is in the up
set 1956 require(state_is_read_accessible());
1960 result = has_same_host(other) && _host->le(other->
index().
pod(),
1965 ensure(unexecutable(other is in the up
set 1981 require(state_is_read_accessible());
1982 require(host()->contains_member(xother_index));
1986 result = _host->leqv(xother_index, _index.pod());
1990 ensure(unexecutable(
"other is in the up set of this or other is_jem(this)"));
2005 require(state_is_read_accessible());
2006 require(host()->contains_member(xother_index));
2010 result = leqv(xother_index.
hub_pod());
2014 ensure(unexecutable(
"other is in the up set of this or other is_jem(this)"));
2029 require(state_is_read_accessible());
2030 require(host()->contains_member(xother_index));
2034 result = le(xother_index) && (_index.pod() != xother_index);
2038 ensure(result == (le(xother_index) && (index().pod() != xother_index)));
2053 require(state_is_read_accessible());
2054 require(host()->contains_member(xother_index));
2058 result = lt(xother_index.
hub_pod());
2062 ensure(result == (le(xother_index) && (index() !=~ xother_index)));
2077 require(state_is_read_accessible());
2081 result = le(other) && (_index != other->
index());
2085 ensure(result == (le(other) && (index() != other->
index())));
2100 require(state_is_read_accessible());
2101 require(host()->contains_member(xother_index));
2107 result = _host->le(_index.pod(), xother_index);
2111 ensure(unexecutable(other is in the up
set 2127 require(state_is_read_accessible());
2128 require(host()->contains_member(xother_index));
2132 result = ge(xother_index.
hub_pod());
2136 ensure(unexecutable(other is in the up
set 2152 require(state_is_read_accessible());
2158 result = has_same_host(other) && _host->le(_index.pod(),
2163 ensure(unexecutable(other is in the up
set 2179 require(state_is_read_accessible());
2180 require(host()->contains_member(xother_index));
2186 result = _host->leqv(_index.pod(), xother_index);
2190 ensure(unexecutable(
"this is in the up set of other or this is_jem of other"));
2205 require(state_is_read_accessible());
2206 require(host()->contains_member(xother_index));
2210 result = geqv(xother_index.
hub_pod());
2214 ensure(unexecutable(
"this is in the up set of other or this is_jem of other"));
2229 require(state_is_read_accessible());
2230 require(host()->contains_member(xother_index));
2234 result = ge(xother_index) && (_index.pod() != xother_index);
2238 ensure(result == (ge(xother_index) && (index().pod() != xother_index)));
2253 require(state_is_read_accessible());
2254 require(host()->contains_member(xother_index));
2258 result = ge(xother_index.
hub_pod());
2262 ensure(result == (ge(xother_index) && (index() !=~ xother_index)));
2277 require(state_is_read_accessible());
2281 result = ge(other) && (_index != other->
index());
2285 ensure(result == (ge(other) && (index() != other->
index())));
2300 require(state_is_read_accessible());
2304 result = _host->is_jem( index(), xother->
index() );
2321 require(state_is_read_accessible());
2326 greatest_jem_pa(result);
2330 ensure(result != 0);
2345 require(state_is_read_accessible());
2367 require(state_is_read_accessible());
2372 least_jem_pa(result);
2376 ensure(result != 0);
2391 require(state_is_read_accessible());
2412 require(has_same_host(xjem));
2413 require(!xjem->
is_jem(&(host()->bottom())));
2414 require(state_is_read_write_accessible());
2416 require(!xjem->
is_jim());
2417 require(unexecutable(xjem really is join-equivalent to
this));
2421 _host->merge_jems(_index.pod(), xjem->
index().
pod());
2425 ensure(is_jem(xjem));
2426 ensure(xjem->
le(
this));
2448 bool result =
false;
2452 require(xother->
host() == host());
2453 require(state_is_read_accessible());
2457 result = host()->contains_link(_index.pod(), xother->
index().
pod());
2470 bool result =
false;
2474 require(state_is_read_accessible());
2475 require(host()->contains_member(xhub_id));
2479 result = host()->contains_link(_index.pod(), xhub_id);
2494 require(state_is_read_accessible());
2495 require(host()->contains_member(xid));
2509 require(state_is_read_write_accessible());
2510 require(host()->in_jim_edit_mode());
2511 require(has_same_host(xlesser));
2517 require(!le(xlesser) && !xlesser->
le(
this));
2522 (void) _host->new_link(_index.pod(), xlesser->
index().
pod());
2526 ensure(invariant());
2527 ensure(covers(xlesser));
2538 require(state_is_read_write_accessible());
2539 require(host()->in_jim_edit_mode());
2546 _host->delete_link(_index.pod(), xlesser->
index().
pod());
2550 ensure(invariant());
2551 ensure(!covers(xlesser));
2564 require(state_is_read_accessible());
2568 return _host->get_cover_id_space(xlower, _index.pod());
2577 require(state_is_read_accessible());
2581 _host->release_cover_id_space(xcover_id_space);
2596 require(state_is_read_accessible());
2600 return _host->get_cover_id_space_iterator(xlower, _index.pod());
2609 require(state_is_read_accessible());
2613 _host->release_cover_id_space_iterator(xitr);
2628 require(state_is_read_accessible());
2632 return _host->cover_contains_iterator(xlower, _index.pod(), xitr);
2641 require(state_is_read_accessible());
2643 return _host->cover_is_empty(xlower, _index.pod());
2654 require(state_is_read_accessible());
2656 return _host->cover_is_singleton(xlower, _index.pod());
2667 require(state_is_read_accessible());
2671 result = _host->cover_ct(xlower, _index.pod());
2675 ensure(result >= 0);
2688 require(state_is_read_accessible());
2690 return _host->cover_contains_member(xlower, _index.pod(), xother_mbr_index);
2699 require(state_is_read_accessible());
2701 return cover_contains_member(xlower, xother_mbr_index.
hub_pod());
2710 require(state_is_read_accessible());
2712 return _host->cover_is_equal(xlower, _index.pod(), xother_mbr_index);
2721 require(state_is_read_accessible());
2723 return cover_is_equal(xlower, xother_mbr_index.
hub_pod());
2732 require(state_is_read_accessible());
2734 return _host->first_cover_member(xlower, _index.pod());
2743 require(state_is_read_accessible());
2745 result.
put(_host->member_hub_id_space(
false), first_cover_member(xlower));
2754 require(state_is_read_write_accessible());
2758 _host->insert_cover_member(xother_mbr_index, xlower, _index.pod());
2762 ensure(unexecutable(cover_contains_member(xlower, xother_mbr_index)));
2775 require(state_is_read_write_accessible());
2779 insert_cover_member(xother_mbr_index.
hub_pod(), xlower);
2783 ensure(unexecutable(cover_contains_member(xlower, xother_mbr_index)));
2796 require(state_is_read_write_accessible());
2800 _host->remove_cover_member(xother_mbr_index, xlower, _index.pod());
2804 ensure(unexecutable(!cover_contains_member(xlower, xother_mbr_index)));
2817 require(state_is_read_write_accessible());
2821 remove_cover_member(xother_mbr_index.
hub_pod(), xlower);
2825 ensure(unexecutable(!cover_contains_member(xlower, xother_mbr_index)));
2838 require(state_is_read_write_accessible());
2842 _host->remove_cover_member(xitr, xlower, _index.
pod());
2846 ensure(unexecutable(!cover_contains_member(xlower, xother_mbr_index)));
2859 require(state_is_read_write_accessible());
2863 _host->clear_cover(xlower, _index.pod());
2867 ensure(cover_is_empty(xlower));
2880 require(state_is_read_write_accessible());
2881 require(host()->contains_member(xother_mbr_index));
2885 _host->copy_cover(xlower, _index.pod(), xother_mbr_index);
2889 ensure(cover_is_equal(xlower, xother_mbr_index));
2902 require(state_is_read_write_accessible());
2903 require(host()->contains_member(xother_mbr_index));
2907 copy_cover(xlower, xother_mbr_index.
hub_pod());
2911 ensure(cover_is_equal(xlower, xother_mbr_index));
2941 ensure(result > 0 );
2969 ensure(result >= 0 );
2986 result = down_ct(xfilter_index.
hub_pod());
2990 ensure(result > 0 );
3005 require(state_is_read_write_accessible());
3009 result =
new subposet(host(), 0,
false);
3015 require(result != 0);
3016 require(postcondition_of(down_pa));
3041 ensure(unexecutable(result is down
set 3055 require(state_is_read_write_accessible());
3056 require(!xenter_jim_edit_mode ? host()->in_jim_edit_mode() :
true);
3057 require(!name().empty());
3058 require(host()->contains_member(poset_path::boundary_name(name())));
3059 require(host()->includes_subposet(
"__boundary_jims"));
3066 if(!old_host_in_jim_edit_mode)
3076 subposet lelements(lhost,
"__elements");
3077 if(_host->cover_is_singleton(
LOWER, _index.pod()))
3090 create_cover_link(&lbdy);
3102 while(!down_itr.is_done())
3104 ldown_set.put(down_itr.index().pod(),
true);
3119 if(_host->cover_is_singleton(
UPPER, lindex) &&
3120 (xdelete_exterior || (lindex != lblock_bdy_index)))
3125 _host->clear_cover(
UPPER, lindex);
3130 assertion(_host->cover_is_empty(
UPPER, lindex));
3137 _host->remove_cover_member(lc_itr,
LOWER, _index.pod());
3142 _host->release_cover_id_space_iterator(lc_itr);
3149 subposet lbdy_jims(lhost,
"__boundary_jims");
3150 set<pod_index_type> lclean_up_set;
3153 bool lnot_in_down_set =
false;
3156 while(!up_itr.is_done())
3160 switch(up_itr.action())
3162 case zn_to_bool_triorder_itr::PREVISIT_ACTION:
3164 lnot_in_down_set = !ldown_set[lindex.
pod()];
3166 if(lnot_in_down_set)
3172 lin_other_down_set.
put(lindex.
pod(),
true);
3178 up_itr.next(lnot_in_down_set || (lindex ==~ lanchor));
3182 case zn_to_bool_triorder_itr::LINK_ACTION:
3194 up_itr.erase_cover();
3200 if(lin_other_down_set[up_itr.lesser_index().pod()])
3205 lin_other_down_set.put(lindex.
pod(),
true);
3213 case zn_to_bool_triorder_itr::POSTVISIT_ACTION:
3221 if(lindex != BOTTOM_INDEX)
3227 lin_other_down_set[lindex.
pod()] &&
3228 ldown_set[lindex.
pod()])
3238 lclean_up_set.insert(uc_itr.
hub_pod());
3243 _host->remove_cover_member(uc_itr,
UPPER, lindex);
3247 _host->release_cover_id_space_iterator(uc_itr);
3262 set<pod_index_type>::iterator cu_itr = lclean_up_set.begin();
3263 while(cu_itr != lclean_up_set.end())
3274 _host->remove_cover_member(lc_itr,
LOWER, *cu_itr);
3279 _host->release_cover_id_space_iterator(lc_itr);
3307 create_cover_link(&(lhost->
bottom()));
3315 if(!old_host_in_jim_edit_mode)
3324 ensure(old_host->in_jim_edit_mode() == old_host_in_jim_edit_mode);
3343 ensure(result > 0 );
3371 ensure(result > 0 );
3388 result = up_ct(xfilter_index.
hub_pod());
3392 ensure(result > 0 );
3407 require(state_is_read_write_accessible());
3411 result =
new subposet(host(), 0,
false);
3416 ensure(result != 0);
3417 ensure(postcondition_of(up_pa));
3441 ensure(unexecutable(result is up
set 3458 int result = itr.
ct();
3462 ensure(is_jem(&(host()->bottom())) ? result == 0 : result > 0 );
3477 require(state_is_read_write_accessible());
3481 result =
new subposet(host(), 0,
false);
3486 ensure(result != 0);
3487 ensure(postcondition_of(jims_pa));
3501 require(state_is_read_write_accessible());
3513 ensure(unexecutable(result is jims
set 3542 ensure(is_jem(&(host()->bottom())) ? result == 0 : result > 0 );
3560 require(state_is_read_write_accessible());
3564 result =
new subposet(host(), 0,
false);
3565 maximal_jims_pa(result);
3569 ensure(has_same_host(result));
3570 ensure(postcondition_of(maximal_jims_pa));
3584 require(has_same_host(result));
3602 slicer.
find_jims_pa( cthis, result, poset_slicer::MAXIMAL );
3608 ensure(unexecutable(result is
union of maximal_jims of
this with old result));
3628 if(host()->is_atom(itr.
index()))
3641 ensure(is_same_state(&(host()->bottom())) ? result == 0 : result > 0 );
3656 require(state_is_read_write_accessible());
3660 result =
new subposet(host(), 0,
false);
3665 ensure(result != 0);
3666 ensure(postcondition_of(atoms_pa));
3679 require(state_is_read_write_accessible());
3686 if(host()->is_atom(itr.
index()))
3700 ensure(unexecutable(
"for all members p of result: p.is_atom()"));
3726 require(has_same_host(other));
3727 require(state_is_read_accessible());
3732 p_join_pa(other, result);
3736 ensure(result != 0);
3738 ensure(postcondition_of(p_join_pa));
3751 require(has_same_host(other));
3756 require(state_is_read_accessible());
3801 ensure(unexecutable(result is least upper bound in host of
this and other));
3814 require(has_same_host(other));
3815 require(state_is_read_accessible());
3819 p_join_pa(other,
this);
3823 ensure(postcondition_of(p_join_pa));
3838 require(has_same_host(other));
3839 require(state_is_read_accessible());
3844 p_meet_pa(other, result);
3848 ensure(result != 0);
3850 ensure(postcondition_of(p_meet_pa));
3864 require(has_same_host(other));
3869 require(state_is_read_accessible());
3913 ensure(unexecutable(result is least upper bound in host of
this and other));
3926 require(has_same_host(other));
3927 require(state_is_read_accessible());
3931 p_meet_pa(other,
this);
3935 ensure(postcondition_of(p_meet_pa));
3961 require(has_same_host(other));
3962 require(state_is_read_accessible());
3967 l_join_pa(other, result, xnew_jem);
3971 ensure(result != 0);
3973 ensure(postcondition_of(l_join_pa));
3986 require(state_is_read_accessible());
3987 require(!host()->in_jim_edit_mode());
3988 require(has_same_host(other));
3998 result->
new_jrm_state(_host, larray, 2, (xnew_jem ? tern::TRUE : tern::NEITHER));
4002 ensure(unexecutable(result is least upper bound in host of
this and other));
4015 require(has_same_host(other));
4016 require(state_is_read_accessible());
4020 l_join_pa(other,
this, xgreatest);
4024 ensure(postcondition_of(l_join_pa));
4039 require(has_same_host(other));
4040 require(state_is_read_accessible());
4045 l_meet_pa(other, result, xnew_jem);
4049 ensure(result != 0);
4051 ensure(postcondition_of(l_meet_pa));
4064 require(has_same_host(other));
4069 require(state_is_read_accessible());
4098 ensure(unexecutable(result is least upper bound in host of
this and other));
4111 require(has_same_host(other));
4112 require(state_is_read_accessible());
4116 l_meet_pa(other,
this, xnew_jem);
4120 ensure(postcondition_of(l_meet_pa));
4135 require(state_is_read_accessible());
4140 l_not_pa(result, xnew_jem);
4144 ensure(result != 0);
4146 ensure(postcondition_of(l_not_pa));
4163 require(state_is_read_accessible());
4192 slicer.
find_pa(&tsp1, &(host()->jims()),
false, &tsp2);
4196 host()->jims().p_minus_pa(&tsp2, &tsp1);
4204 ensure(unexecutable(result is least upper bound in host of
this and other));
4217 require(state_is_read_accessible());
4222 l_not_pa(cthis, xnew_jem);
4226 ensure(postcondition_of(l_not_pa));
4252 require(xhost != 0);
4254 require(host_is_ancestor_of(xhost));
4271 bool result =
false;
4275 require(xhost != 0);
4277 require(host_is_ancestor_of(xhost));
4281 return is_valid_index(xhost, xid.
hub_pod(), xversion);
4290 require(state_is_read_accessible());
4309 require(state_is_read_accessible());
4328 require(state_is_read_accessible());
4349 require(state_is_read_accessible());
4358 ensure(result.
pod() == xid);
4371 require(xhost != 0);
4372 require(host_is_ancestor_of(xhost));
4374 require(!xname.empty());
4382 ensure(unexecutable(result.is_valid() implies member with index = result has name xname));
4396 require(xhost != 0);
4397 require(host_is_ancestor_of(xhost));
4399 require(!xname.empty());
4407 ensure(unexecutable(result.
is_valid() implies member with index = result has name xname));
4433 require(xauto_access || state_is_read_accessible());
4437 result = host()->member_name(index(), xauto_access);
4441 ensure(unexecutable(result.empty() implies
this has no name));
4454 require(xauto_access || state_is_read_accessible());
4458 host()->all_member_names(_index.pod(), xresult, xauto_access);
4462 ensure(xresult.
ct() == name_ct(xauto_access));
4463 ensure_for_all(i, 0, xresult.
ct(), !xresult[i].empty());
4478 require(xauto_access || state_is_read_accessible());
4482 result = host()->member_name_ct(index(), xauto_access);
4493 has_name(
const std::string& xname,
bool xauto_access)
const 4497 require(xauto_access || state_is_read_accessible());
4498 require(!xname.empty());
4502 bool result = host()->member_has_name(_index.pod(), xname, xauto_access);
4513 put_name(
const std::string& xname,
bool xunique,
bool xauto_access)
4517 require(is_attached());
4518 require(xauto_access || state_is_read_write_accessible());
4519 require(poset_path::is_valid_name(xname));
4523 host()->put_member_name(index(), xname, xunique, xauto_access);
4528 ensure(xunique ? (name(xauto_access) == xname) : has_name(xname, xauto_access));
4541 require(xauto_access || state_is_read_write_accessible());
4542 require(!xname.empty());
4552 get_read_write_access(
true);
4555 if(has_name(xname,
false))
4557 host()->delete_member_name(xname,
false);
4567 ensure(!has_name(xname, xauto_access));
4580 require(xauto_access || state_is_read_write_accessible());
4584 host()->delete_all_member_names(_index.pod(), xauto_access);
4588 ensure(name_ct(xauto_access) == 0);
4617 require(xpath.
full());
4641 ensure(invariant());
4642 ensure(name_space()->is_same_state(xns));
4643 ensure(has_path(xpath, xauto_access));
4644 ensure(postcondition_of(attach_handle_data_members()));
4667 require(xnamespace != 0);
4685 attach_to_state(&lposet, xmember_index);
4689 ensure(invariant());
4690 ensure(name_space()->is_same_state(xnamespace));
4691 ensure(host()->index() == xposet_index);
4692 ensure(index() == xmember_index);
4693 ensure(postcondition_of(attach_handle_data_members()));
4695 lposet.release_access();
4717 require(xnamespace != 0);
4723 attach_to_state(xnamespace,
4730 ensure(invariant());
4731 ensure(name_space()->is_same_state(xnamespace));
4732 ensure(host()->index() ==~ xposet_index);
4733 ensure(index() ==~ xmember_index);
4734 ensure(postcondition_of(attach_handle_data_members()));
4747 require(is_attached());
4748 require(xauto_access ||
4749 (is_jim() ? host()->in_jim_edit_mode() : state_is_read_write_accessible()));
4756 bool lis_jim = is_jim();
4767 get_read_write_access(
true);
4825 _host->release_cover_id_space_iterator(lc_itr);
4826 _host->release_cover_id_space_iterator(uc_itr);
4836 detach_from_state();
4853 ensure(!is_attached());
4854 ensure(unexecutable(
"!old host()->contains_member(old index())"));
4901 invariance(poset_component::invariant());
4903 if(invariant_check())
4907 disable_invariant_check();
4916 invariance(state_is_read_accessible() && is_jim(
false) ? dof_map_is_ancestor_of(&(dof_map())) :
true);
4923 enable_invariant_check();
4984 <<
" host = \'" << p.
host()->
name() <<
"\'" 4986 <<
" name = \'" << p.
name() <<
'\'' 4987 <<
" version= " << p.
version(
false)
4988 <<
" unaliased version= " << p.
version()
4996 os <<
"member: host = \'\'' index = -1 name = \'\''" 5017 post_fatal_error_message(
"change this call to use operator<<(ostream& abstract_poset_member&)");
void find_pa(abstract_poset_member *xanchor, subposet *xlayer, bool xdown, subposet *result, slice_mode xmode=ALL)
Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), pre-allocated.
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
poset_state_handle * host() const
The poset which this is a handle to a component of.
bool geqv(pod_index_type xother_index) const
True if this is greater than or equivalent to the member with index xother_index. ...
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
virtual subposet * up() const
The up set of this member, auto- and pre-allocated versions.
virtual bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
A client handle for a subposet.
virtual bool is_restricted() const
True if handle is a restriction of the state, that is, if schema() is not the same as host()->schema(...
virtual pod_index_type get_index_from_name(const poset_state_handle *xhost, const std::string &xname) const
Gets the index of the component in xhost with name xname.
bool is_valid() const
True if this is a valid id.
pod_index_type dof_tuple_id(bool xauto_access) const
The dof tuple index of this member.
bool is_done() const
True if iteration finished.
int down_ct() const
The number of members in the down set of this member.
virtual void new_link(pod_index_type xgreater, pod_index_type xlesser)
Insert a cover link from greater to lesser (that is, hub id xgreater covers hub id xlesser)...
bool cover_contains_member(bool xlower, pod_index_type xother_mbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of this contains xother...
void l_join_jims_pa(abstract_poset_member *result, bool xnew_jem=true)
Lattice join of the members of this, pre-allocated Requires this is a down set of jims...
virtual void create_cover_link(abstract_poset_member *xlesser)
Insert a link from this to lesser; make lesser <= this.
bool full() const
True if both poset name and member name are not empty.
virtual void p_meet_pa(abstract_poset_member *other, abstract_poset_member *result)
poset meet of this with other, pre-allocated the poset meet is the greatest lower bound in the pose...
virtual void all_names(block< std::string > &xresult, bool xauto_access=false) const
All the names for this.
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
size_type ct() const
The number of items currently in use.
virtual size_type name_ct(bool xauto_access) const
The number of names for this.
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
abstract_poset_member * p_join(abstract_poset_member *other) const
poset join of this with other, auto-allocated the poset join is the least upper bound in the poset ...
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
bool covers(const abstract_poset_member *xother) const
True if this covers other.
abstract_poset_member * greatest_jem() const
The largest member which is join-equivalent to this.
An abstract iterator over the ids of an id space.
index_space_iterator & get_cover_id_space_iterator(bool xlower, pod_index_type xmbr_hub_id) const
Allocates an iterator for the lower (xlower true) or upper (xlower false) cover id space of the membe...
virtual void attach_handle_data_members()
Initializes handle data members when attaching to a different member of the same host; intended to be...
virtual size_type cover_ct(bool lower) const
The number of members in the lower cover (xlower true) or upper cover (xlower false) of this...
subposet_member_iterator * member_iterator() const
An iterator for members of this poset; handle version.
void release_cover_id_space_iterator(index_space_iterator &xcover_itr) const
Returns xcover_itr to the pool of id spaces.
void p_join_sa(abstract_poset_member *other)
poset join of this with other, self-allocated the poset join is the least upper bound in the poset ...
virtual ~abstract_poset_member()
Destructor; deletes a poset member and its attached state, if any.
bool lt(pod_index_type xother_index) const
True if this is strictly less than the member with index xother_index.
pod_type pod() const
The current id in the iteration.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool contains_members(const scoped_index *xmbrs, int xmbrs_ct, bool xauto_access=true) const
True if this poset contains poset member(s) with indices in xmbrs.
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
void clear_cover(bool xlower, pod_index_type xmbr_hub_id)
Clears the lower (xlower true) or upper (xlower false) cover set of the member with hub id xmbr_hub_i...
virtual void maximal_jims_pa(subposet *result) const
The maximal members of the set of jims contained in this member, pre-allocated.
void maximals_pa(subposet *result)
The subposet containing the maximal members of this, pre-allocated.
virtual schema_poset_member & schema()
The schema on which this is allocated (mutable version).
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly...
A client handle for a general, abstract partially order set.
void insert_cover_member(pod_index_type xother_mbr_index, bool xlower)
Inserts xother_mbr_index in the lower (xlower true) or upper (xlower false) cover set of this...
void greatest_jem_pa(abstract_poset_member *result) const
The largest member which is join-equivalent to this.
virtual int atom_ct() const
The number of members in the set of atoms contained in the down set of this member.
virtual abstract_poset_member * clone() const =0
Virtual constructor; makes a new unattached handle of the same type as this.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
bool is_done() const
True if iteration finished.
int ct(bool xreset=false)
The number of members of the iteration set, from the current member to the end, inclusive. If xreset, reset before computing the count.
int up_ct() const
The number of members in the up set of this member.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
virtual void jims_pa(subposet *result)
The set of jims contained in the down set of this member, pre-allocated.
void dof_tuple(const void *xbuf, size_t xbuflen) const
Copies the entire dof tuple between xbuf and internal storage.
virtual abstract_poset_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
Specialization of the filtered depth-first iterator which exposes the POSTVISIT_ACTION to the client...
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool le(pod_index_type xgreater, pod_index_type xlesser) const
True if hub id xlesser is less than or equal to hub id xgreater.
virtual bool row_dof_map_conforms(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of row dof map required by this poset state a...
virtual void get_read_access() const
Get read access to the state associated with this.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
void l_join_sa(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, self-allocated the lattice join is the least upper bound in the la...
const scoped_index & index() const
The index of the component state this handle is attached to.
virtual void next()=0
Makes id() the next id in the iteration.
void clear_cover(bool xlower)
Clears the lower (xlower true) or upper (xlower false) cover set of this.
void l_not_sa(bool xnew_jem=true) const
lattice pseudo-complement of this, self-allocated The lattice pseudo-complement is the largest latt...
std::string name() const
A name for this.
The general, abstract map from dof ids to dof values.
abstract_poset_member & bottom()
The bottom member of the poset (mutable version)
void p_meet_sa(abstract_poset_member *other)
poset meet of this with other, self-allocated the poset meet is the greatest lower bound in the pos...
bool cover_is_equal(bool xlower, pod_index_type xother_mbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover of this contains the same m...
An implementation of class sum_index_space_handle that has a primary sum id space state...
void copy_cover(bool xlower, pod_index_type xother_mbr_index)
Copies the lower (xlower true) or upper (xlower false) cover of this to the member with index xother_...
void least_jem_pa(abstract_poset_member *result) const
The smallest member which is join-equivalent to this.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
bool gt(pod_index_type xother_index) const
True if this is strictly greater than the member with index xother_index.
virtual void atoms_pa(subposet *result) const
The set of atomss contained in the down set of this member, pre-allocated.
bool is_jem(const abstract_poset_member *xother) const
True if xother is join equivalent to this.
virtual pod_index_type new_member(bool xis_jim, pod_index_type xtuple_hub_id)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by hub id xtuple_hub...
void put_dof_tuple(const void *xbuf, size_t xbuflen)
Copies the entire dof tuple between xbuf and internal storage.
SHEAF_DLL_SPEC vd_value_type length(const ed &x0, bool xauto_access)
The Euclidean length (magnitude) of x0 (version for persistent types).
dof_type & operator[](size_type xi)
Xi-th byte (mutable version).
const scoped_index & index() const
The index of the current member of the iteration.
void find_jims_pa(abstract_poset_member *xanchor, subposet *result, slice_mode xmode=ALL)
Find jims in the down set of the poset member xanchor, pre-allocated.
virtual void reset()=0
Restarts the iteration.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
virtual void delete_state(bool xauto_access=false)
Detachs this from its state and then deletes the state.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
void next()
Makes this the next member of the subset.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
virtual subposet * atoms() const
The set of atomss contained in the down set of this member, auto-allocated.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
virtual schema_poset_member & unrestricted_schema()
The unrestricted schema for this poset member (mutable version).
const bool NOT_STRICT
Iteration strictness control.
const bool DOWN
Iteration directions.
dof_type & operator[](size_type xi)
Xi-th byte (mutable version).
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
bool is_done() const
True if iteration is finished.
void make_empty()
Make this subposet the empty subposet.
abstract_poset_member()
Default constructor; creates a new, unattached abstract_poset_member handle.
Specialization of the filtered depth-first iterator which exposes all three actions to the client; th...
virtual bool has_name(const std::string &xname, bool xauto_access=false) const
True if xname is a name for this.
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
A client handle for a mutable partially ordered set.
bool leqv(pod_index_type xother_index) const
True if this is less than or equivalent to the member with index xother_index.
virtual bool invariant() const
Class invariant.
void remove_cover_member(pod_index_type xother_mbr_hub_id, bool xlower, pod_index_type xmbr_hub_id)
Removes hub id xother_mbr_hub_id from the lower (xlower true) or upper (xlower false) cover set of th...
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
const index_space_family & id_spaces() const
The id space family for this member.
virtual void to_stream(std::ostream &xos=std::cout) const
Virtual stream insertion.
An index within the external ("client") scope of a given id space.
virtual const hub_index_space_handle & hub_id_space() const
The hub id space; const version.
unsigned char dof_type
The type of the dofs.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
bool cover_is_singleton(bool xlower) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of this contains exactl...
virtual void get_read_access() const
Get read access to the state associated with this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual int jim_ct() const
The number of members in the set of jims contained in the down set of this member.
void l_join_pa(abstract_poset_member *other, abstract_poset_member *result, bool xnew_jem=true)
lattice join of this with other, pre-allocated the lattice join is the least upper bound in the lat...
void * row_dofs()
The row dofs for this instance (mutable version).
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
bool cover_contains_iterator(bool xlower, const index_space_iterator &xitr) const
True if and only if the lower (xlower true) or upper (xlower false) cover id space of this is the dom...
virtual subposet * jims()
The set of jims contained in the down set of this member, auto-allocated.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
bool cover_is_empty(bool xlower, pod_index_type xmbr_hub_id) const
True if and only if the lower (xlower true) or upper (xlower false) cover set of the member with hub ...
virtual int maximal_jim_ct() const
The number of maximal members in the set of jims contained in the down set of this member...
abstract_poset_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-allocated The lattice pseudo-complement is the largest latt...
void link_least_jem(pod_index_type xjem1, pod_index_type xjem2)
Makes hub id xjem1 the least jem of hub id xjem2, unless the current least jem of xjem2 is bottom...
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
virtual void up_pa(subposet *result) const
The up set of this member, auto- and pre-allocated versions.
abstract_poset_member * least_jem() const
The smallest member which is join-equivalent to this.
const bool UPPER
Selector for upper cover.
pod_index_type first_cover_member(bool xlower) const
The first member of the lower (xlower true) or upper (xlower false) cover of this.
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
Row dofs type for class abstract_poset_member.
virtual bool is_valid_index(const poset_state_handle *xhost, pod_index_type xhub_id, int xversion=CURRENT_HOST_VERSION) const
True if there exists a component of the same type as this with hub id xhub_id in version xversion of ...
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
char * row_dof_ptr(bool xrequire_write_access=false)
Pointer to the row dofs.
void down_set_pa(abstract_poset_member *xanchor, subposet *result, slice_mode xmode=ALL)
find the down set of the poset member xanchor, pre-allocated
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
primitive_value dof(pod_index_type xdof_id) const
The dof referred to by xdof_id.
virtual std::string name() const
The name of this poset.
bool empty() const
True if both poset name and member name are empty.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
int member_ct() const
The number of members of this subposet.
const bool UP
Iteration directions.
index_space_handle & get_cover_id_space(bool xlower) const
Allocates a handle for the lower (xlower true) or upper (xlower false) cover id space of this member ...
SHEAF_DLL_SPEC void max(const vd &x0, vd_value_type &xresult, bool xauto_access)
Maximum component of x0, pre-allocated version.
void put_dof(pod_index_type xdof_id, const primitive_value &xdof)
Sets the dof referred to by xdof_id to xdof.
virtual const scoped_index & hub_id() const
A id in the hub id space for components of this type; intended for copying to initialize ids to the h...
abstract_poset_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-allocated the lattice meet is the greatest lower bound in the...
index_space_iterator & get_cover_id_space_iterator(bool xlower) const
Allocates an iterator for the lower (xlower true) or upper (xlower false) cover id space of this memb...
void delete_down(bool xdelete_exterior=false, bool xenter_jim_edit_mode=true)
Delete the strict down set of this, except for the external boundary. If xdelete_exterior, delete the external boundary as well.
virtual schema_poset_member & schema()
The schema for this poset member (mutable version).
virtual bool is_atom() const
True if this member covers the bottom.
bool cover_is_empty(bool xlower) const
True if and only if the lower (xlower true) or upper (xlower false) cover this is empty...
const bool LOWER
Selector for lower cover.
void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
void p_intersection_sa(const subposet *other)
Intersection of this with other, self-allocated.
virtual void detach_from_state()
Detach this handle from its state, if any.
bool ge(pod_index_type xother_index) const
True if this is greater than or equal to the member with index xother_index.
void next()
Makes this the next member of the subset.
virtual subposet * maximal_jims()
The maximal members of the set of jims contained in this member, auto-allocated.
virtual void delete_all_names(bool xauto_access=false)
Delete all the names for this.
void link_greatest_jem(pod_index_type xjem1, pod_index_type xjem2)
Makes hub id xjem1 the greatest jem of hub id xjem2, unless the current greatest jem of xjem2 is top...
virtual poset_state_handle * host() const
The poset which owns this.
primitive_type & id()
Type id of the primitive type.
virtual void merge_jem(const abstract_poset_member *xjem)
Merge the join-equivalence class of xjem under the join equivalence class of this.
bool schema_is(const std::string &xschema_name) const
True if the schema of this has name xname.
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
void l_not_pa(abstract_poset_member *result, bool xnew_jem=true) const
lattice pseudo-complement of this, pre-allocated The lattice pseudo-complement is the largest latti...
std::string member_name() const
The member name part of the path.
virtual scoped_index member_index_ub() const
The upper bound on the member_index;.
void * table_dofs()
The table dofs for this instance (mutable version).
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
char * table_dof_ptr(bool xrequire_write_access=false) const
Pointer to the table dofs.
void put_dof_tuple_id(pod_index_type xtuple_index, bool xauto_access)
Sets dof tuple index to xtuple_index.
void l_meet_pa(abstract_poset_member *other, abstract_poset_member *result, bool xnew_jem=true)
lattice meet of this with other, pre-allocated the lattice meet is the greatest lower bound in the ...
virtual subposet & jims()
The subset of all jims (mutable version)
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
virtual void delete_name(const std::string &xname, bool xauto_access=false)
Delete all names for this.
unsigned char dof_type
The type of the dofs.
virtual void delete_member(pod_index_type xmbr_hub_id)
Delete the member with hub id xmbr_hub_id. Warning: this routine does not delete links; it will leave...
virtual void down_pa(subposet *result) const
The down set of this, pre-allocated version.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
Abstract object wrapper for an instance of a primitive type.
pod_index_type first_cover_member(bool xlower, pod_index_type xmbr_hub_id) const
Hub id of the first member of the lower (xlower true) or upper (xlower false) cover of the member wit...
virtual bool dof_map_is_ancestor_of(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of dof map required by this handle...
void release_cover_id_space(index_space_handle &xcover_id_space) const
Returns xcover_id_space to the pool of id spaces.
virtual void get_read_access() const
Get read access to the state associated with this.
An abstract client handle for a member of a poset.
virtual poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
Factory and container for a family of id spaces.
virtual void new_jem_state(abstract_poset_member *xother, bool xgreatest, bool xauto_access)
Creates a new jrm state in host() which is the greatest jem (xgreatest true) or least jem (xgreatest ...
bool row_conforms_to(const schema_poset_member &xother) const
True if the row dofs defined by this agree in type and in order with the dofs defined by xother...
abstract_poset_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-allocated the poset meet is the greatest lower bound in the pos...
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
virtual void p_join_pa(abstract_poset_member *other, abstract_poset_member *result) const
poset join of this with other, pre-allocated the poset join is the least upper bound in the poset ...
void minimals_pa(subposet *result)
The subposet containing the minimal members of this, pre-allocated.
row_dofs_type * clone() const
Creates a new instance of the same type as this.
virtual schema_poset_member & schema()
The schema for this member (mutable version).
void remove_cover_member(pod_index_type xother_mbr_index, bool xlower)
Removes xother_mbr_index from the lower (xlower true) or upper (xlower false) cover set of this...
virtual void delete_cover_link(abstract_poset_member *lesser)
Delete the link from this to lesser; make lesser incomparable to this.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
void truncate()
Makes this the next member of the subset which is not less than old this, i.e. the depth-first descen...
Computes the join of given poset members.
virtual bool is_same_restriction(const abstract_poset_member *xother) const
True if this is the same restriction as xother, that is, if schema().is_same_state(xother.schema()).
bool is_same_type(const any *other) const
True if other is the same type as this.
Traverser to compute intersection of the down set (up set) of the anchor with a given subposet...
void enable_invariant_check() const
Enable invariant checking.
void l_meet_sa(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, self-allocated the lattice meet is the greatest lower bound in the...
bool contains_row_dof_tuple(pod_index_type xtuple_hub_id) const
True if this contains a tuple with hub id xtuple_hub_id.
Specialization of the filtered depth-first iterator which exposes the PREVISIT_ACTION to the client...
bool same_schema(const abstract_poset_member *xother) const
True if xother has the same schema (column poset) as this.
A client handle for a poset member which has been prepared for use as a schema.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
Table dofs type for class abstract_poset_member.
virtual void new_jrm_state(bool xauto_access=true)
Creates a new jrm (join-reducible member) state in host() and attaches this to it.
virtual subposet * down() const
The down set of this, auto-allocated version.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
abstract_poset_member * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-allocated the lattice join is the least upper bound in the la...
table_dofs_type * clone() const
Creates a new instance of the same type as this.
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.