21 #include "SheafSystem/subposet.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/array_index_space_handle.h" 25 #include "SheafSystem/array_index_space_state.h" 26 #include "SheafSystem/block.h" 27 #include "SheafSystem/hash_index_space_handle.h" 28 #include "SheafSystem/hash_index_space_state.h" 29 #include "SheafSystem/interval_index_space_handle.h" 30 #include "SheafSystem/interval_index_space_state.h" 31 #include "SheafSystem/list_index_space_handle.h" 32 #include "SheafSystem/list_index_space_state.h" 33 #include "SheafSystem/namespace_poset.h" 34 #include "SheafSystem/pool.h" 35 #include "SheafSystem/poset.h" 36 #include "SheafSystem/poset_member.h" 37 #include "SheafSystem/poset_powerset_state.h" 38 #include "SheafSystem/poset_slicer.h" 39 #include "SheafSystem/preorder_iterator.h" 40 #include "SheafSystem/std_sstream.h" 41 #include "SheafSystem/std_iomanip.h" 42 #include "SheafSystem/poset_joiner.h" 43 #include "SheafSystem/subposet_member_iterator.h" 44 #include "SheafSystem/subposet_state.h" 45 #include "SheafSystem/tern.h" 69 ensure( !is_attached() );
94 new_state(lother.host(),
false);
101 attach_to_state(&lother);
106 ensure( invariant() );
107 ensure( has_same_host(&xother) );
108 ensure( xdeep_copy ? is_equal_to(&xother) : is_same_state(&xother) );
109 ensure( xdeep_copy ? name().empty() :
true);
142 require(xmembers != 0 ? xhost->
contains_members(*xmembers, xauto_access) :
true);
148 new_state(xhost, *xmembers, xauto_access);
152 new_state(xhost,
true, xauto_access);
163 ensure(host() == xhost);
164 ensure(xmembers != 0 ? contains_members(*xmembers) : is_empty());
165 ensure(is_persistent());
185 require(precondition_of(new_state(same args)));
189 new_state(xhost, xmembers, xauto_access);
194 ensure(postcondition_of(new_state(same args)));
213 attach_to_state(xhost, xhub_id);
218 ensure(host() == xhost);
219 ensure(index().is_hub_scope());
220 ensure(index() == xhub_id);
221 ensure(is_attached());
234 attach_to_state(xhost, xid);
239 ensure(host() == xhost);
240 ensure(index().is_hub_scope());
241 ensure(index() ==~ xid);
242 ensure(is_attached());
253 require(!xname.empty());
258 attach_to_state(xhost, xname);
262 ensure( invariant() );
263 ensure( is_attached() );
264 ensure( host() == xhost );
265 ensure( name() == xname );
280 attach_to_state(&xother);
284 ensure(is_same_state(&xother));
299 require(precondition_of(new_state(host(), xinitialize, xauto_access)));
303 new_state(host(), xinitialize, xauto_access);
307 ensure(postcondition_of(new_state(host(), xinitialize, xauto_access)));
320 require(precondition_of(new_state(host(), xmembers, xauto_access)));
324 new_state(host(), xmembers, xauto_access);
328 ensure(postcondition_of(new_state(host(), xmembers, xauto_access)));
341 require(precondition_of(new_state(host(), xmembers, xauto_access)));
345 new_state(host(), xmembers, xauto_access);
349 ensure(postcondition_of(new_state(host(), xmembers, xauto_access)));
380 _version = CURRENT_HOST_VERSION;
385 ensure(host() == xhost);
386 ensure(is_persistent());
387 ensure(xinitialize ? is_empty() :
true);
426 _index.put(host()->subposet_hub_id_space(
false), _host->new_subposet(xmembers));
427 _version = CURRENT_HOST_VERSION;
432 ensure(host() == xhost);
433 ensure(contains_members(xmembers));
434 ensure(is_persistent());
474 _version = CURRENT_HOST_VERSION;
479 ensure(host() == xhost);
480 ensure(contains_members(xmembers));
481 ensure(is_persistent());
512 require(state_is_read_accessible());
513 require(has_id_space());
518 powerset_member(index())->id_space();
535 require(state_is_read_accessible());
536 require(has_id_space());
541 powerset_member(index())->id_space();
558 require(state_is_read_write_accessible());
559 require(!name().empty());
560 require(!has_id_space());
561 require(!host()->member_id_spaces(
false).contains(id_space_name()));
562 require(!xstate_class_name.empty());
563 require(unexecutable(
"xstate_class_name is a descendant of scattered_insertion_index_space_state"));
572 if(xstate_class_name ==
"array_index_space_state")
574 lid = array_index_space_state::new_space(host()->member_id_spaces(
false),
577 member_ct()).index();
579 else if(xstate_class_name ==
"hash_index_space_state")
581 lid = hash_index_space_state::new_space(host()->member_id_spaces(
false),
584 member_ct()).index();
586 else if(xstate_class_name ==
"interval_index_space_state")
588 lid = interval_index_space_state::new_space(host()->member_id_spaces(
false),
593 else if(xstate_class_name ==
"list_index_space_state")
595 lid = list_index_space_state::new_space(host()->member_id_spaces(
false),
597 is_persistent()).index();
601 post_fatal_error_message(
"The id space type '" + xstate_class_name +
"' is not supported.");
604 powerset_member(index())->put_id_space(host()->member_id_spaces(
false), lid);
611 ensure(has_id_space());
612 ensure(id_space() == result);
613 ensure(id_space().is_persistent() == is_persistent());
628 require(state_is_read_accessible());
632 result = powerset_member(index())->has_id_space();
636 ensure(is_basic_query);
651 require(state_is_read_accessible());
655 result = powerset_member(index())->is_persistent();
670 require(state_is_read_write_accessible());
674 powerset_member(index())->put_is_persistent(xis_persistent);
678 ensure(is_persistent() == xis_persistent);
679 ensure(has_id_space() ? id_space().is_persistent() == xis_persistent :
true);
696 require(state_is_read_accessible());
697 require(!name().empty());
705 ensure(!result.empty());
718 require(state_is_read_write_accessible());
719 require(!has_id_space());
720 require(host()->member_id_spaces(
false).contains(id_space_name()));
724 powerset_member(index())->put_id_space(host()->member_id_spaces(
false),
729 ensure(has_id_space());
753 require(state_is_read_accessible());
757 result = powerset_member(index())->is_dof_subposet();
772 require(state_is_read_write_accessible());
776 powerset_member(index())->put_is_dof_subposet(xis_dof_subposet);
780 ensure(is_dof_subposet() == xis_dof_subposet);
795 require(state_is_read_accessible());
799 result = powerset_member(index())->dof_ct();
816 require(state_is_read_write_accessible());
821 powerset_member(index())->put_dof_ct(xct);
825 ensure(dof_ct() == xct);
840 require(state_is_read_accessible());
844 result = powerset_member(index())->dof_descriptors();
859 require(state_is_read_write_accessible());
863 powerset_member(index())->put_dof_descriptors(xoffsets);
867 ensure(dof_descriptors() == xoffsets);
891 require(state_is_read_accessible());
901 int result = members()->true_ct();
918 require(state_is_read_accessible());
938 require(state_is_read_accessible());
942 index_iterator result(members(), _host->member_hub_id_space(
false));
946 ensure(!result.is_done() ? result.index().same_scope(host()->member_id(
false)) :
true);
959 require(state_is_read_accessible());
969 bool result = lmembers->
index_in_bounds(xmbr_hub_id) ? (*lmembers)[xmbr_hub_id] :
false;
984 require(state_is_read_accessible());
988 return contains_member(xmbr_id.
hub_pod());
999 require(state_is_read_accessible());
1000 require(!xname.empty());
1005 result =
is_valid(lindex) ? contains_member(lindex) :
false;
1020 require(state_is_read_accessible());
1027 while(result && i < xmbr_hub_ids.
ct())
1029 result = contains_member(xmbr_hub_ids[i]);
1035 ensure(unexecutable(
"for all i in xmbr_hub_ids: contains_member(i)")) ;
1048 require(state_is_read_accessible());
1055 while(result && i < xmbr_ids.
ct())
1057 result = contains_member(xmbr_ids[i]);
1063 ensure(unexecutable(
"for all i in xmbr_ids: contains_member(i)")) ;
1080 bool result = contains_member(xmbr->
index());
1096 require(state_is_read_write_accessible());
1100 members()->put(xmbr_hub_id,
true);
1104 ensure(invariant());
1105 ensure(contains_member(xmbr_hub_id));
1119 require(state_is_read_write_accessible());
1123 insert_member(xmbr_id.
hub_pod());
1127 ensure(invariant());
1128 ensure(contains_member(xmbr_id));
1141 require(state_is_read_write_accessible());
1145 for(
int i=0; i<xmbr_hub_ids.
ct(); i++)
1147 members()->put(xmbr_hub_ids[i],
true);
1152 ensure(invariant());
1153 ensure(contains_members(xmbr_hub_ids));
1166 require(state_is_read_write_accessible());
1170 for(
int i=0; i<xmbr_ids.
ct(); i++)
1172 members()->put(xmbr_ids[i].hub_pod(),
true);
1177 ensure(invariant());
1178 ensure(contains_members(xmbr_ids));
1191 require(state_is_read_write_accessible());
1199 ensure(invariant());
1200 ensure(contains_member(xmbr));
1213 require(state_is_read_write_accessible());
1217 members()->put(xmbr_hub_id,
false);
1221 ensure(invariant());
1222 ensure(!contains_member(xmbr_hub_id));
1235 require(state_is_read_write_accessible());
1239 remove_member(xmbr_id.
hub_pod());
1243 ensure(invariant());
1244 ensure(!contains_member(xmbr_id));
1257 require(state_is_read_write_accessible());
1265 ensure(invariant());
1266 ensure(!contains_member(xmbr));
1283 require(is_attached());
1284 require(state_is_read_accessible());
1292 result = powerset_member(index())->members();
1296 ensure(invariant());
1297 ensure(result != 0);
1312 require(is_attached());
1313 require(state_is_read_accessible());
1317 result = members()->values();
1321 ensure(invariant());
1322 ensure(result != 0);
1346 require(state_is_read_accessible());
1350 result = members()->is_false();
1366 require(state_is_read_write_accessible());
1370 members()->make_false_sa();
1387 require(state_is_read_accessible());
1388 require(other != 0);
1389 require(host()->is_same_state(other->
host()));
1393 result = members()->is_equal_to(other->
members());
1397 ensure(unexecutable(other has same mebrs as
this));
1410 require(state_is_read_write_accessible());
1411 require(other != 0);
1412 require(host()->is_same_state(other->
host()));
1433 require(other != 0);
1437 result = members()->includes(other->
members());
1454 require( state_is_read_write_accessible() );
1455 require( other != 0);
1456 require( host() == other->
host());
1461 p_union_pa(other, result);
1465 ensure(result != 0);
1469 ensure(invariant());
1482 require( state_is_read_write_accessible() );
1483 require( other != 0 );
1484 require( host() == other->
host());
1485 require( result != 0 );
1486 require( host() == result->
host());
1496 ensure(invariant());
1509 require( state_is_read_write_accessible() );
1510 require( other != 0 );
1511 require( host() == other->
host());
1515 p_union_pa(other,
this);
1519 ensure(unexecutable(
"for all i: contains_member(i) == old contains_member(i) || other->contains_member(i)"));
1520 ensure(invariant());
1535 require( state_is_read_write_accessible() );
1536 require( other != 0);
1537 require( host() == other->
host());
1543 p_intersection_pa(other, result);
1547 ensure(invariant());
1548 ensure(result != 0);
1549 ensure(postcondition_of(p_intersection_pa));
1562 require( state_is_read_write_accessible() );
1563 require( other != 0 );
1564 require( host() == other->
host());
1565 require( result != 0 );
1566 require( host() == result->
host());
1574 ensure(invariant());
1589 require( state_is_read_write_accessible() );
1590 require( other != 0 );
1591 require( host() == other->
host());
1595 p_intersection_pa(other,
this);
1599 ensure(postcondition_of(p_intersection_pa));
1614 require( state_is_read_write_accessible() );
1615 require( other != 0);
1616 require( host() == other->
host());
1622 p_minus_pa(other, result);
1626 ensure(invariant());
1627 ensure(result != 0);
1628 ensure(postcondition_of(p_minus_pa));
1641 require( state_is_read_write_accessible() );
1642 require( other != 0 );
1643 require( host() == other->
host());
1644 require( result != 0 );
1645 require( host() == result->
host());
1653 ensure(invariant());
1654 ensure(unexecutable(
"forall i: result->contains_member(i) == old contains_member(i) && !other->contains_member(i)"));
1667 require( state_is_read_write_accessible() );
1668 require( other != 0 );
1669 require( host() == other->
host());
1673 p_minus_pa(other,
this);
1677 ensure(invariant());
1678 ensure(postcondition_of(p_minus_pa));
1693 require(state_is_read_write_accessible());
1703 ensure(invariant());
1716 require(state_is_read_write_accessible());
1717 require(result != 0);
1721 members()->b_not_pa(result->
members());
1725 ensure(invariant());
1738 require(state_is_read_write_accessible());
1742 members()->b_not_sa();
1746 ensure(invariant());
1772 require(state_is_read_write_accessible());
1777 extremals_pa(xmaximals, result);
1781 ensure(invariant());
1782 ensure(postcondition_of(extremals_pa));
1795 require( state_is_read_write_accessible() );
1796 require( result != 0 );
1797 require( result->
host() == host() );
1799 require( !is_same_state(result) );
1862 ensure(invariant());
1863 ensure(unexecutable(result contains extremal members of
this));
1878 require(precondition_of(extremals(
true)));
1882 result = extremals(
true);
1886 ensure(postcondition_of(extremals(
true)));
1899 require(precondition_of(extremals_pa(
true, result)));
1903 extremals_pa(
true, result);
1907 ensure(postcondition_of(extremals_pa(
true, result)));
1922 require(precondition_of(extremals(
false)));
1926 result = extremals(
false);
1930 ensure(postcondition_of(extremals(
false)));
1943 require(precondition_of(extremals_pa(
false, result)));
1947 extremals_pa(
false, result);
1951 ensure(postcondition_of(extremals_pa(
false, result)));
1966 require(state_is_read_write_accessible());
1975 ensure(invariant());
1976 ensure(postcondition_of(down_pa));
1989 require( state_is_read_write_accessible() );
1990 require( result != 0 );
1991 require( result->
host() == host() );
1997 slicer.down_set_pa(
this, result);
2001 ensure(invariant());
2016 require(state_is_read_write_accessible());
2025 ensure(invariant());
2026 ensure(postcondition_of(up_pa));
2039 require( state_is_read_write_accessible() );
2040 require( result != 0 );
2041 require( result->
host() == host() );
2047 slicer.up_set_pa(
this, result);
2051 ensure(invariant());
2066 require(state_is_read_write_accessible());
2075 ensure(invariant());
2076 ensure(unexecutable(result contains jims in down
set 2090 require( state_is_read_write_accessible() );
2091 require( result != 0 );
2092 require( result->
host() == host());
2098 slicer.find_jims_pa(
this, result);
2102 ensure(invariant());
2103 ensure(unexecutable(result contains jims in down
set 2119 require(state_is_read_write_accessible());
2124 maximal_jims_pa(result);
2128 ensure(invariant());
2129 ensure(postcondition_of(maximal_jims_pa));
2142 require( state_is_read_write_accessible() );
2143 require( result != 0 );
2144 require( result->
host() == host() );
2150 slicer.find_jims_pa(
this, result, poset_slicer::MAXIMAL);
2154 ensure(invariant());
2169 require(state_is_read_write_accessible());
2174 minimal_jims_pa(result);
2178 ensure(invariant());
2179 ensure(postcondition_of(minimal_jims_pa));
2192 require( state_is_read_write_accessible() );
2193 require( result != 0 );
2194 require( result->
host() == host() );
2200 slicer.find_jims_pa(
this, result, poset_slicer::MINIMAL);
2204 ensure(invariant());
2219 require(state_is_read_write_accessible());
2228 require(invariant());
2229 require(postcondition_of(p_join_pa));
2242 require( state_is_read_write_accessible() );
2243 require( result != 0 );
2253 ensure(invariant());
2269 require(state_is_read_write_accessible());
2278 ensure(invariant());
2279 ensure(postcondition_of(p_meet_pa));
2292 require( state_is_read_write_accessible() );
2293 require( result != 0 );
2303 ensure(invariant());
2329 require(state_is_read_write_accessible());
2332 require(!is_empty());
2341 ensure(invariant());
2342 ensure(postcondition_of(l_join_pa));
2355 require( state_is_read_write_accessible() );
2356 require( result != 0 );
2378 joiner.
join(
this, (xnew_jem ? tern::TRUE : tern::NEITHER), *result);
2383 ensure(invariant());
2398 require(state_is_read_write_accessible());
2399 require(unexecutable(
this is a down
set 2400 containing only jims));
2406 l_join_jims_pa(result, xnew_jem);
2410 ensure(invariant());
2411 ensure(postcondition_of(l_join_jims_pa));
2424 require( state_is_read_write_accessible() );
2425 require(unexecutable(
this is a down
set 2426 containing only jims));
2427 require( result != 0 );
2432 joiner.
join(
this, (xnew_jem ? tern::TRUE : tern::NEITHER), *result);
2436 ensure(invariant());
2440 ensure(unexecutable(this->includes(old
this)));
2444 ensure(unexecutable(
"this includes the strict down set of result"));
2459 require(state_is_read_write_accessible());
2464 l_meet_pa(result, xnew_jem);
2468 ensure(invariant());
2469 ensure(postcondition_of(l_meet_pa));
2482 require( state_is_read_write_accessible() );
2483 require( result != 0 );
2512 ensure(invariant());
2538 require(xhost != 0);
2539 require(host_is_ancestor_of(xhost));
2559 bool result =
false;
2563 require(xhost != 0);
2565 require(host_is_ancestor_of(xhost));
2569 return is_valid_index(xhost, xid.
hub_pod(), xversion);
2578 require(state_is_read_accessible());
2597 require(state_is_read_accessible());
2601 const scoped_index& result = _host->subposet_id(
false);
2618 require(state_is_read_accessible());
2627 ensure(result.
pod() == xid);
2640 require(xhost != 0);
2641 require(host_is_ancestor_of(xhost));
2643 require(!xname.empty());
2651 ensure(unexecutable(result.is_valid() implies
subposet with index = result has name xname));
2665 require(xhost != 0);
2666 require(host_is_ancestor_of(xhost));
2668 require(!xname.empty());
2676 ensure(unexecutable(result.
is_valid() implies
subposet with index = result has name xname));
2702 require(xauto_access || state_is_read_accessible());
2706 result = host()->subposet_name(index(), xauto_access);
2710 ensure(unexecutable(result.empty() implies
this has no name));
2723 require(xauto_access || state_is_read_accessible());
2727 host()->all_subposet_names(_index, xresult, xauto_access);
2731 ensure(xresult.
ct() == name_ct(xauto_access));
2732 ensure_for_all(i, 0, xresult.
ct(), !xresult[i].empty());
2747 require(xauto_access || state_is_read_accessible());
2751 result = host()->subposet_name_ct(index(), xauto_access);
2762 has_name(
const std::string& xname,
bool xauto_access)
const 2766 require(xauto_access || state_is_read_accessible());
2767 require(!xname.empty());
2771 bool result = host()->subposet_has_name(_index, xname, xauto_access);
2782 put_name(
const std::string& xname,
bool xunique,
bool xauto_access)
2786 require(is_attached());
2787 require(xauto_access || state_is_read_write_accessible());
2788 require(poset_path::is_valid_name(xname));
2792 host()->put_subposet_name(index(), xname, xunique, xauto_access);
2796 ensure(xunique ? (name(xauto_access) == xname) : has_name(xname, xauto_access));
2809 require(xauto_access || state_is_read_write_accessible());
2810 require(!xname.empty());
2820 get_read_write_access(
true);
2823 if(has_name(xname,
false))
2825 host()->delete_subposet_name(xname,
false);
2835 ensure(!has_name(xname, xauto_access));
2848 require(xauto_access || state_is_read_write_accessible());
2852 host()->delete_all_subposet_names(_index, xauto_access);
2856 ensure(name_ct(xauto_access) == 0);
2880 require(is_attached());
2881 require(xauto_access || state_is_read_write_accessible());
2887 get_read_write_access(
true);
2892 detach_from_state();
2902 ensure(!is_attached());
2903 ensure(unexecutable(!old host()->includes_subposet(old index())));
2931 result =
dynamic_cast<const subposet*
>(xother) != 0;
2954 ensure(result != 0);
2971 result = result && poset_component::invariant();
2973 if(invariant_check())
2977 disable_invariant_check();
2983 enable_invariant_check();
3038 if(!(xs.
name().empty()))
3040 xos << setw(20) << xs.
name();
3047 xos <<
" " << xs.
host() <<
" " << xs.
index() <<
" " << *xs.
members() << endl;
3051 xos <<
"<void> 0x0 " << scoped_index::INVALID() << endl;
3078 ensure(result == 0);
virtual bool has_name(const std::string &xname, bool xauto_access=false) const
True if xname is a name for this.
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 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 ...
A client handle for a subposet.
bool is_equal_to(const subposet *other) const
True if this subposet has the same members as other.
bool is_valid() const
True if this is a valid id.
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...
size_type ct() const
The number of items currently in use.
void to_stream(std::ostream &os=std::cout)
Prints out useful information for debugging.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
poset_member * p_join()
Poset join of the members of this this, auto-allocated The poset join is the least upper bound in t...
void make_equal_to(const subposet *other)
Make this subposet have the same members as other.
poset_member * p_meet()
Poset meet of the members of this, auto-allocated The poset meet is the greatest lower bound in the...
subposet * p_intersection(const subposet *other)
Intersection of this with other, auto-allocated.
subposet_member_iterator * member_iterator() const
An iterator for members of this poset; handle version.
subposet()
Default constructor, creates a new, unattached subposet.
bool is_persistent() const
True if this id space should be written to disk.
virtual bool has_id_space() const
True if this already has an id space.
void maximal_jims_pa(subposet *result)
The maximal members of the set of jims contained in the down set of this subposet, pre-allocated.
poset_member * l_meet(bool xnew_jem=true)
Lattice meet of the members of this, auto-allocated The lattice meet is the greatest lower bound in...
void p_join_pa(abstract_poset_member *result)
Poset join of the members of this this, pre-allocated The poset join is the least upper bound in th...
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual bool is_dof_subposet() const
True if this is a dofs subposet.
void minimal_jims_pa(subposet *result)
The minimal members of the set of jims contained in the down set of this subposet, pre-allocated.
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.
void maximals_pa(subposet *result)
The subposet containing the maximal members of this, pre-allocated.
void up_pa(subposet *result) const
The up set of this subposet, pre-allocatd.
void l_join_pa(abstract_poset_member *result, bool xnew_jem=true)
Lattice join of the members of this, pre-allocated The lattice join is the least upper bound in the...
A client handle for a general, abstract partially order set.
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
void p_union_pa(const subposet *other, subposet *result)
Union of this with other, pre-allocated.
const scoped_index & index() const
The current item in the subset.
subposet * minimals()
The subposet containing the minimal members of this, auto-allocated.
bool is_done() const
True if iteration finished.
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.
bool contains_members(const block< pod_index_type > &xmbr_hub_ids) const
True if this poset contains poset members with hub ids in xmbr_hub_ids.
~subposet()
Deletes this subposet and the state it is attached to, if any.
void p_meet_pa(abstract_poset_member *result)
Poset meet of the members of this, pre-allocated The poset meet is the greatest lower bound in the ...
unsigned int word_t
The type of the private, internal representation used for bits; Unsigned int is the type used in the ...
virtual subposet & operator=(const subposet &xother)
Assignment operator; attaches this to the same state as xother.
void p_intersection_pa(const subposet *other, subposet *result)
Intersection of this with other, pre-allocated.
const scoped_index & index() const
The index of the component state this handle is attached to.
An implementation of class sum_index_space_handle that has a primary sum id space state...
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...
virtual void delete_name(const std::string &xname, bool xauto_access=false)
Delete all names for this.
void down_pa(subposet *result) const
The down set of this subposet, pre-allocated.
subposet * up() const
The up set of this subposet, auto-allocated.
void next()
Makes item the next member of the subset.
subposet * down() const
The down set of this subposet, auto-allocated.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
virtual void all_names(block< std::string > &xresult, bool xauto_access=false) const
All the names for this.
subposet * jims()
The set of jims contained in the down set of this subposet, auto-allocated.
subposet * minimal_jims()
The minimal members of the set of jims contained in the down set of this subposet, auto-allocated.
void next()
Makes this the next member of the subset.
Abstract base class with useful features for all objects.
bool has_visited(pod_index_type xhub_id) const
True if this has already visited member with hub id xhub_id.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
void p_minus_pa(const subposet *other, subposet *result)
Difference of this and other (this minus other), pre-allocated.
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_is_persistent(bool xvalue)
Sets is_persistent() to xvalue.
virtual dof_descriptor_array * dof_descriptors() const
The offset from beginning of the dof tuple of each dof.
void make_empty()
Make this subposet the empty subposet.
poset_member * l_join_jims(bool xnew_jem=true)
Lattice join of the members of this, auto-allocated Requires this is a down set of jims...
A client handle for a restrictable member of a poset. A poset_member is a poset_member which can ...
void l_meet_pa(abstract_poset_member *result, bool xnew_jem=true)
Lattice meet of the members of this, pre-allocated The lattice meet is the greatest lower bound in ...
virtual void delete_subposet(pod_index_type xsubposet_hub_id)
Deletes the subposet with hub id xsubposet_hub_id.
void jims_pa(subposet *result)
The set of jims contained in the down set of this subposet, pre-allocated.
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...
virtual pod_index_type new_subposet(bool xinitialize=true)
Creates a new subposet. If xinitialize, make the subposet empty,.
virtual bool invariant() const
Class invariant.
subposet * p_not()
Poset complement of this, auto-allocated.
bool includes(const subposet *other) const
True if all the members of other are also members of this.
subposet * maximals()
The subposet containing the maximal members of this, auto-allocated.
virtual scattered_insertion_index_space_handle & new_id_space(const std::string &xstate_class_name)
Creates an id space for the members of this.
An index within the external ("client") scope of a given id space.
virtual bool is_attached() const
True if this handle is attached to a state.
bool index_in_bounds(int i) const
True if index i is in bounds for this vector.
subposet * p_union(const subposet *other)
Union of this with other, auto-allocated.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
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.
subposet * p_minus(const subposet *other)
Difference of this and other (this minus other), auto-allocated.
void equal_pa(const zn_to_bool *result)
OBSOLETE; use assignment operator.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void p_not_sa()
Poset complement of this, self-allocated.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
void join(const scoped_index *xexpansion, int xexpansion_ct, const tern &xgreatest, abstract_poset_member &xresult)
The join of the members of xexpansion.
virtual void insert_members(const block< pod_index_type > &xmbr_hub_ids)
Inserts the members of host() with hub ids in xmbr_hub_ids.
bool is_empty() const
True if this poset is empty.
zn_to_bool::word_t * membership() const
The membership bit vector.
virtual size_type name_ct(bool xauto_access) const
The number of names for this.
virtual void put_dof_ct(int xct)
Set the number of dofs defined this, considered as a dof_subposet, to xct; Note: dof_ct() == member_c...
void next()
Makes this the next member of the subset.
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
void extremals_pa(bool xmaximals, subposet *result)
The subposet containing the extremal members of this, pre-allocated.
virtual std::string id_space_name() const
The name of the id space associated with this.
std::string to_string()
Get useful information for debugging as a string.
virtual const hub_index_space_handle & hub_id_space() const
The hub id space; const version.
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.
virtual void put_dof_descriptors(const dof_descriptor_array *xoffsets)
Set the offset from beginning of the dof tuple of each dof to xoffsets.
subposet * maximal_jims()
The maximal members of the set of jims contained in the down set of this subposet, auto-allocated.
zn_to_bool * members() const
The characteristic function for the members of this.
virtual subposet * clone() const
Virtual constructor; makes a new instance of the same type as this.
virtual int dof_ct() const
Get the number of dofs defined this, considered as a dof_subposet; Note: dof_ct() == member_ct()...
const bool NO_RESET
Iteration marker reset control.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
bool is_done() const
True if iteration finished.
Iterates over the subset of Zn defined by the characteristic function host().
virtual void put_is_dof_subposet(bool xis_dof_subposet)
True if this is a dofs subposet.
const scattered_insertion_index_space_handle & id_space() const
The id space for the members of with this (const version).
void p_intersection_sa(const subposet *other)
Intersection of this with other, self-allocated.
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.
virtual void reset(bool xreset_markers=true)
Restarts the iteration over the down set of anchor().
void p_minus_sa(const subposet *other)
Difference of this and other (this minus other), self-allocated.
subposet * extremals(bool xmaximals)
The subposet containing the extremal members of this, auto-allocated.
virtual void remove_member(pod_index_type xmbr_hub_id)
Removes the member of host() with hub id xmbr_hub_id.
int_type pod_index_type
The plain old data index type.
bool is_done() const
True if iteration finished.
void attach_id_space()
Attach the id space to the id_space_name().
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
A handle for a scattered_insertion_index_space_state.
virtual void put_anchor(const abstract_poset_member *xanchor)
Set anchor() to xanchor.
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.
An abstract client handle for a member of a poset.
virtual pod_index_type subposet_id(const std::string &xname) const
The hub id of the subposet with name xname.
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 ...
void minimals_pa(subposet *result)
The subposet containing the minimal members of this, pre-allocated.
void p_union_sa(const subposet *other)
Union of this with other, self-allocated.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Computes the join of given poset members.
virtual void new_state(bool xinitialize=true, bool xauto_access=true)
Creates a new subposet state in host() and attaches this object to it. If xinitialize, initialize the membership to xmembers, If !xinitialize, leave the membership uninitialized.
virtual void delete_state(bool xauto_access=false)
Detach this from its state and delete the state.
Traverser to compute intersection of the down set (up set) of the anchor with a given subposet...
void put_strict(bool xstrict)
Set strict() to xstrict.
poset_member * l_join(bool xnew_jem=true)
Lattice join of the members of this, auto-allocated The lattice join is the least upper bound in th...
virtual void delete_all_names(bool xauto_access=false)
Delete all the names for this.
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 ...
void p_not_pa(subposet *result)
Poset complement of this, pre-allocated.
virtual index_iterator indexed_member_iterator() const
An iterator for members of this poset; index version.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
const scoped_index & index() const
The index of the current member of the iteration.