SheafSystem
0.0.0.0
|
An implementation of class sum_index_space_state intended for use as the sum of the primary id spaces. More...
#include <primary_sum_index_space_state.h>
Public Member Functions | |
virtual const std::string & | class_name () const |
The name of this class. More... | |
virtual primary_sum_index_space_state * | clone () const |
Virtual constructor; create a new instance of the same type at this. More... | |
Public Member Functions inherited from sheaf::sum_index_space_state | |
void | equivalence_class (pod_type xhub_id, equivalence_class_type &result) const |
The equivalence class associated with the hub id xhub_id. More... | |
size_type | equivalence_ct (pod_type xhub_id) const |
The number of members of the equivalence class of hub id xhub_id. More... | |
bool | contains_unique_rep (pod_type xhub_id) const |
True if and only if hub id xhub_id is the only member of its equivalence class. More... | |
const index_space_handle & | term (pod_type xi) const |
The xi-th term. More... | |
const index_space_handle & | term_of (pod_type xid) const |
The term containing id xid. More... | |
const index_space_handle & | term_of (const scoped_index &xid) const |
The term contains id xid. More... | |
const index_space_handle & | last_term () const |
The last term. More... | |
pod_type | term_begin (pod_type xi) const |
Beginning id of the xi-th term. More... | |
pod_type | term_end (pod_type xi) const |
Ending id of the xi-th term. More... | |
pod_type | term_hub_begin (pod_type xi) const |
Beginning hub id of the xi-th term. More... | |
pod_type | term_hub_end (pod_type xi) const |
Ending hub id of the xi-th term. More... | |
pod_type | term_id (pod_type xid) const |
The id of the term containing id xid. More... | |
void | binary (pod_type xindex, pod_type &xterm_id, pod_type &xlocal) const |
Converts simple index xindex to its binary components xterm_id and xlocal_id. More... | |
void | simple (pod_type xterm_id, pod_type xlocal_id, pod_type &xindex) const |
Converts binary components xterm_id, xlocal_id to simple index xindex. More... | |
Public Member Functions inherited from sheaf::explicit_index_space_state | |
virtual | ~explicit_index_space_state () |
Destructor. More... | |
const index_space_collection & | host () const |
The host collection (const version). More... | |
index_space_collection & | host () |
The host collection (mutable version). More... | |
pod_type | index () const |
The index of this id space. More... | |
const index_space_family & | id_spaces () const |
The id space family for this (const version). More... | |
index_space_family & | id_spaces () |
The id space family for this (mutable version). More... | |
const hub_index_space_handle & | hub_id_space () const |
The hub id space. More... | |
size_type | ct () const |
The number of members. More... | |
bool | is_empty () const |
True if there are no ids in the space. More... | |
pod_type | begin () const |
Beginning id of this space. More... | |
pod_type | end () const |
Ending id of this space. More... | |
bool | is_gathered () const |
True if begin() == 0 and end() == ct(). More... | |
bool | contains (const scoped_index &xid) const |
True if this space contains an id equivalent to xid. synonym for contains_hub(xid.hub_pod()). More... | |
bool | contains_hub (pod_type xid) const |
True if this space contains an id equivalent to xid in the unglued hub id space. synonym for contains_unglued_hub(xid) More... | |
bool | contains (pod_type xid, const scoped_index &xhub_id) const |
True if this space contains an id xid equivalent to xhub_id in the hub id space. synonym for contains(xid, xhub_id.hub_pod()). More... | |
virtual bool | contains (pod_type xid, pod_type xhub_id) const |
True if this space contains an id xid equivalent to xhub_id in the hub id space. More... | |
pod_type | pod (const scoped_index &xid) const |
The pod index in this space equivalent to xid. synonym for pod(xid.hub_pod()). More... | |
pod_type | hub_pod (pod_type xid) const |
The pod index in the unglued hub id space equivalent to xid in this id space. synonym for unglued_hub_pod(xid). More... | |
bool | is_persistent () const |
True if this id space should be written to disk. More... | |
virtual void | new_product_structure (const abstract_product_structure &xproduct) |
Creates a new product structure for this id space by cloning the product structure, xproduct. More... | |
virtual void | delete_product_structure () |
Deletes the product structure for this id space. More... | |
const abstract_product_structure & | product_structure () const |
The product structure for this id space (const version). More... | |
abstract_product_structure & | product_structure () |
The product structure for this id space (mutable version). More... | |
bool | has_product_structure () const |
True if this id space has a product structure. More... | |
Public Member Functions inherited from sheaf::any | |
bool | is_same_type (const any *other) const |
True if other is the same type as this. More... | |
virtual | ~any () |
Destructor. More... | |
bool | invariant_check () const |
True if invariant checking is enabled. More... | |
void | enable_invariant_check () const |
Enable invariant checking. More... | |
void | disable_invariant_check () const |
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More... | |
int | disable_invariance_check_request_depth () const |
Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More... | |
Friends | |
class | hub_index_space_iterator |
class | namespace_poset |
SHEAF_DLL_SPEC size_t | deep_size (const primary_sum_index_space_state &xn, bool xinclude_shallow) |
The deep size of primary_sum_index_space_state& xn. More... | |
SPACE FACTORY FACET | |
static hub_index_space_handle | new_space (index_space_family &xid_spaces, const std::string &xname) |
Create a new primary sum id space in the id space family xid_space at the next available id space index with name xname. Returns a handle to the id space created. More... | |
static hub_index_space_handle | new_space (index_space_family &xid_spaces, pod_type xid, const std::string &xname) |
Create a new primary sum id space in the id space family xid_space at the id space index xid with name xname. Returns a handle to the id space created. More... | |
PRIMARY_SUM_INDEX_SPACE_STATE FACET | |
primary_sum_index_space_state () | |
Default constructor. More... | |
primary_sum_index_space_state (const primary_sum_index_space_state &xother) | |
Copy constructor; disabled. More... | |
virtual | ~primary_sum_index_space_state () |
Destructor. More... | |
PRIMARY SUM INDEX SPACE FACET | |
interval_set | _members |
Set of members in the domain of this map. More... | |
pod_type | _next_id |
The next available id. More... | |
reserved_primary_index_space_handle | _reserved_term |
The current reserved term. More... | |
unordered::unordered_set< pod_type > | _reserved_term_ids |
The set of reserved term ids. More... | |
std::string | next_term_name () |
Name of the next term id space. More... | |
pod_type | new_reserved_term () |
Creates a new reserved term starting above next_hub_id(). Returns the index of the term created. More... | |
pod_type | new_reserved_term (pod_type xid) |
Creates a new reserved term starting at id xid. Returns the index of the term created. More... | |
void | add_term (pod_type xterm_id, pod_type xbegin, pod_type xend) |
Insert term with id xterm_id into the interval . More... | |
bool | reserved_interval_is_available (pod_type xid) const |
True if the reserved interval for id xid is available for allocation. More... | |
void | update_extrema () |
Update the id extrema. More... | |
pod_type | new_id () |
Allocate the next available id in this space. More... | |
pod_type | new_id (pod_type xid) |
Allocate the id xid in this space. More... | |
void | delete_id (pod_type xid) |
Deallocate the id xid in this space. More... | |
bool | is_valid_reserved_id (pod_type xid) const |
True if and only if the reserved term containing xid is already a reserved term or is available for allocation. More... | |
pod_type | next_id () const |
The next available id. More... | |
pod_type | new_primary_term (size_type xct) |
Create a new primary term [next_id(), next_id()+xct). Returns the index of the term created. More... | |
pod_type | new_primary_term (pod_type xid, size_type xct) |
Create a new primary term [xid, xid+xct). Returns the index of the term created. More... | |
void | remove_term (pod_type xi) |
Remove xi-th term of this sum. More... | |
void | extend_last_term (size_type xct) |
Extends the last term to ct() == xct. More... | |
bool | interval_is_full (pod_type xbegin, pod_type xend) const |
True if all ids in the interval [xbegin, xend) are in this space. More... | |
bool | interval_is_empty (pod_type xbegin, pod_type xend) const |
True if all ids in the interval [xbegin, xend) are not in this space. More... | |
bool | interval_is_available (pod_type xbegin, pod_type xend) const |
True if the ids in the interval [xbegin, xend) are available in this space. More... | |
static const std::string & | term_prefix () |
Prefix of the term id spaces. More... | |
GLUING FACET | |
void | glue (pod_type xid, pod_type xrep) |
Glues xid to xrep; adds xid to the equivalence class with representative member xrep. More... | |
void | unglue (pod_type xid) |
Unglues xid; makes xid its own representative. More... | |
void | unglue_all (pod_type xrep_id) |
Unglue all ids glued to representative xrep_id; makes each id in the equivalence class of xrep_id its own representative. More... | |
bool | has_gluing () const |
Ture if there is any gluing. More... | |
GATHERED ID SPACE FACET | |
interval_index_space_handle | _gathered_id_space |
The gathered id space. More... | |
static const std::string & | gathered_hub_id_space_name () |
Name of the gathered id space. More... | |
void | update_gathered_id_space (bool xexclude_bottom) |
Update the gathered id space. If xexclude_bottom, construct the id space without BOTTOM_INDEX. More... | |
const index_space_handle & | new_gathered_id_space (bool xexclude_bottom) |
Construct a gathered id space from this id space. If xexclude_bottom, construct the id space without BOTTOM_INDEX. More... | |
void | update_gathered_id_space () |
Update the gathered id space. More... | |
const index_space_handle & | gathered_id_space () const |
The gathered id space. More... | |
bool | has_gathered_id_space () const |
True, if the gathered id space exists. More... | |
bool | gathered_id_space_excludes_bottom () const |
True, if the gathered id space excludes BOTTOM_INDEX. More... | |
STANDARD IDS FACET | |
pod_type | _standard_id_end |
The end id of the standard ids. More... | |
void | update_standard_ids () |
Make end() the standard id end. More... | |
bool | has_only_standard_ids () const |
True if and only if there are only standard ids. More... | |
void | clear_ids () |
Deallocate all non-standard ids. More... | |
SUM INDEX SPACE FACET | |
typedef unordered::unordered_map< pod_type, pod_type > | rem_type |
The type of rem map. More... | |
rem_type | _rem |
The reflexive reduction of the rem map. More... | |
pod_type | _term_id_begin |
Beginning index of the terms in this sum. More... | |
pod_type | _term_id_end |
Ending index of the terms in this sum. More... | |
virtual bool | contains_rep (pod_type xhub_id) const |
True if and only if hub id xhub_id is the representative member of its equivalence class. More... | |
virtual pod_type | rep (pod_type xhub_id) const |
The representative member of the equivalence class of hub id xhub_id. More... | |
virtual pod_type | host_rep (pod_type xhub_id) const |
The host id associated with the representative member of the equivalence class of hub id xhub_id. More... | |
virtual pod_type | term_id_begin () const |
Beginning index of the terms in this sum. More... | |
virtual pod_type | term_id_end () const |
Ending index of the terms in this sum. More... | |
virtual bool | contains_term_id (pod_type xi) const |
True if this map contains the xi-th term. More... | |
virtual void | clear () |
Deletes all entries. More... | |
EXPLICIT_INDEX_SPACE_STATE FACET | |
virtual primary_sum_index_space_state & | operator= (const explicit_index_space_state &xother) |
Assignment operator. More... | |
virtual bool | operator== (const explicit_index_space_state &xother) const |
True if this is equivalent to xother. More... | |
virtual size_type | deep_size (bool xinclude_shallow) const |
The deep size of this. More... | |
INDEX SPACE FACET | |
virtual bool | contains (pod_type xid) const |
True if this space contains id xid. More... | |
virtual bool | contains_unglued_hub (pod_type xid) const |
True if this space contains an id equivalent to xid in the unglued hub id space. More... | |
virtual bool | contains_glued_hub (pod_type xid) const |
True if this space contains an id equivalent to xid in the glued hub id space. More... | |
virtual pod_type | pod (pod_type xid) const |
The pod index in this space equivalent to xid in the hub id space. More... | |
virtual pod_type | unglued_hub_pod (pod_type xid) const |
The pod index in the unglued hub id space equivalent to xid in this id space. More... | |
virtual pod_type | glued_hub_pod (pod_type xid) const |
The pod index in the glued primary sum id space equivalent to xid in this id space. More... | |
HANDLE POOL FACET | |
static size_type | handle_pool_ct () |
The number of handles in the pool. More... | |
static size_type | handle_pool_deep_size () |
The deep size of the handle pool. More... | |
virtual index_space_handle & | get_id_space () const |
The id space handle with this state. More... | |
virtual void | release_id_space (index_space_handle &xid_space) const |
Release the id space handle xid_space. More... | |
virtual bool | allocated_id_space (const index_space_handle &xid_space) const |
True if and only if id space handle xid_space was allocated by the handle pool. More... | |
ITERATOR POOL FACET | |
static size_type | iterator_pool_ct () |
The number of iterators in the pool. More... | |
static size_type | iterator_pool_deep_size () |
The deep size of the iterator pool. More... | |
virtual index_space_iterator & | get_iterator () const |
Allocates an id space iterator from the iterator pool. More... | |
virtual void | release_iterator (index_space_iterator &xitr) const |
Returns the id space iterator xitr to the iterator pool. More... | |
virtual bool | allocated_iterator (const index_space_iterator &xitr) const |
True if and only if id space iterator xitr was allocated by the iterator pool. More... | |
ANY FACET | |
virtual bool | is_ancestor_of (const any *other) const |
Conformance test; true if other conforms to this. More... | |
virtual bool | invariant () const |
Class invariant. More... | |
Additional Inherited Members | |
Public Types inherited from sheaf::sum_index_space_state | |
typedef std::list< pod_type > | equivalence_class_type |
The type used to represent an equivalence class. More... | |
Public Types inherited from sheaf::explicit_index_space_state | |
typedef pod_index_type | pod_type |
The "plain old data" index type for this. More... | |
Static Public Member Functions inherited from sheaf::explicit_index_space_state | |
static factory< explicit_index_space_state > & | id_space_factory () |
A factory for making descendants of this class. More... | |
Protected Types inherited from sheaf::sum_index_space_state | |
typedef unordered::unordered_multimap< pod_type, pod_type > | rem_inv_type |
The type of the inverse of the rem map. More... | |
typedef zero_block_initialization_policy< index_space_handle * > | terms_init_type |
The type of the terms block initialization policy. More... | |
typedef auto_block< index_space_handle *, terms_init_type > | terms_type |
The type of the terms block. More... | |
typedef std::map< pod_type, pod_type > | sum_to_term_type |
The type of sum_to_term_map. More... | |
Protected Member Functions inherited from sheaf::sum_index_space_state | |
sum_index_space_state () | |
Default constructor. More... | |
sum_index_space_state (const sum_index_space_state &xother) | |
Copy constructor; disabled. More... | |
virtual | ~sum_index_space_state () |
Destructor. More... | |
Protected Member Functions inherited from sheaf::explicit_index_space_state | |
explicit_index_space_state () | |
Default constructor. More... | |
explicit_index_space_state (const explicit_index_space_state &xother) | |
Copy constructor; disabled. More... | |
void | new_state (index_space_family &xid_spaces, const std::string &xname, bool xis_persistent) |
Create a new id space state in the id space family xid_spaces at the next available id space index with name xname, and persistence xis_persistent. More... | |
void | new_state (index_space_family &xid_spaces, pod_type xid, const std::string &xname, bool xis_persistent) |
Create a new id space state in the id space family xid_spaces at the id space index xid with name xname, and persistence xis_persistent. More... | |
void | invalidate_extrema () |
Invalidate the extrema. More... | |
void | attach (explicit_index_space_handle &xid_space) const |
Attach the id space handle xid_space to this state. More... | |
void | attach (explicit_index_space_iterator &xitr) const |
Attach the id space iterator xitr to this state. More... | |
Protected Member Functions inherited from sheaf::any | |
any () | |
default constructor More... | |
Protected Attributes inherited from sheaf::sum_index_space_state | |
rem_inv_type | _rem_inv |
The inverse rem map. More... | |
terms_type | _terms |
The terms of this sum. More... | |
block< pod_type > | _term_begin |
The beginning of the interval in the sum id space for each term. More... | |
block< pod_type > | _term_end |
The end of the interval in the sum id space for each term. More... | |
sum_to_term_type | _sum_to_term_map |
The term id corresponding to each sum id. More... | |
Protected Attributes inherited from sheaf::explicit_index_space_state | |
index_space_collection * | _host |
The host collection. More... | |
pod_type | _index |
The index of this id space. More... | |
size_type | _ct |
The number of members. More... | |
pod_type | _begin |
Beginning id of this space. More... | |
pod_type | _end |
Ending id of this space. More... | |
bool | _is_persistent |
True if this id space should be written to disk. More... | |
abstract_product_structure * | _product |
The product structure for this id space. More... | |
An implementation of class sum_index_space_state intended for use as the sum of the primary id spaces.
Class primary_sum_index_space_state has a mutable equivalence relation which is interpreted as defining the hub id space as the quotient space of the primary sum id space by the equivalence relation. That is, the equivalence relation is interpreted as gluing members of the primary sum id space together to form the hub id space.
The implementation of this class takes advantage of two unique features:
(1) The hub id space is an explicit subset of the primary sum id space, so the equivalence relation can represented using the rem function. We can thus make the equivalence relation mutable by storing the rem function and its inverse in mutable form and deriving the id spaces from the equivalence relation.
(2) In practice, relatively few sum ids are glued, so most of the equivalence classes contain only a single member and most of the entries in the rem function are reflexive (rem(s) = s). We can thus store only the reflexive reduction of rem and its inverse.
Definition at line 86 of file primary_sum_index_space_state.h.
|
protected |
The type of rem map.
Definition at line 462 of file primary_sum_index_space_state.h.
|
protected |
Default constructor.
Definition at line 121 of file primary_sum_index_space_state.cc.
References invariant(), sheaf::explicit_index_space_state::is_empty(), and ~primary_sum_index_space_state().
Referenced by clone(), and new_space().
|
inlineprotected |
Copy constructor; disabled.
Definition at line 141 of file primary_sum_index_space_state.h.
|
protectedvirtual |
Destructor.
Definition at line 143 of file primary_sum_index_space_state.cc.
References new_id().
Referenced by primary_sum_index_space_state().
|
protected |
Insert term with id xterm_id into the interval .
Definition at line 751 of file primary_sum_index_space_state.cc.
References _next_id, sheaf::sum_index_space_state::_sum_to_term_map, sheaf::sum_index_space_state::_term_begin, sheaf::sum_index_space_state::_term_end, _term_id_end, sheaf::sum_index_space_state::_terms, contains(), sheaf::explicit_index_space_state::ct(), sheaf::auto_block< T, S >::force_item(), sheaf::index_space_family::get_id_space(), sheaf::explicit_index_space_state::id_spaces(), interval_is_available(), interval_is_empty(), sheaf::invalid_pod_index(), invariant(), sheaf::primary_index_space_handle::put_hub_term_id(), reserved_interval_is_available(), and term_id_end().
Referenced by new_primary_term(), and new_reserved_term().
|
virtual |
True if and only if id space handle xid_space was allocated by the handle pool.
Implements sheaf::explicit_index_space_state.
Definition at line 1833 of file primary_sum_index_space_state.cc.
References iterator_pool_ct().
Referenced by release_id_space().
|
virtual |
True if and only if id space iterator xitr was allocated by the iterator pool.
Implements sheaf::explicit_index_space_state.
Definition at line 1970 of file primary_sum_index_space_state.cc.
References class_name().
Referenced by release_iterator().
|
virtual |
The name of this class.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 2022 of file primary_sum_index_space_state.cc.
References clone().
Referenced by allocated_iterator().
|
virtual |
Deletes all entries.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 1449 of file primary_sum_index_space_state.cc.
References _members, _rem, _term_id_begin, _term_id_end, sheaf::interval_set::clear(), sheaf::sum_index_space_state::clear(), invariant(), sheaf::explicit_index_space_state::is_empty(), and operator==().
Referenced by contains_term_id().
void sheaf::primary_sum_index_space_state::clear_ids | ( | ) |
Deallocate all non-standard ids.
Definition at line 1255 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, sheaf::explicit_index_space_state::_end, _members, _standard_id_end, contains_rep(), sheaf::explicit_index_space_state::end(), has_only_standard_ids(), sheaf::interval_set::member_ct(), sheaf::interval_set::remove_interval(), and update_extrema().
Referenced by sheaf::hub_index_space_handle::clear_ids(), and has_only_standard_ids().
|
virtual |
Virtual constructor; create a new instance of the same type at this.
Implements sheaf::explicit_index_space_state.
Definition at line 2030 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::id_space_factory(), is_ancestor_of(), sheaf::any::is_same_type(), and primary_sum_index_space_state().
Referenced by class_name().
|
virtual |
True if this space contains id xid.
Implements sheaf::explicit_index_space_state.
Definition at line 1579 of file primary_sum_index_space_state.cc.
References _members, sheaf::interval_set::contains_member(), and contains_unglued_hub().
Referenced by add_term(), delete_id(), glued_hub_pod(), host_rep(), new_id(), new_primary_term(), operator=(), pod(), unglue(), and unglued_hub_pod().
|
virtual |
True if this space contains an id equivalent to xid in the glued hub id space.
Reimplemented from sheaf::explicit_index_space_state.
Definition at line 1617 of file primary_sum_index_space_state.cc.
References _members, _rem, sheaf::interval_set::contains_member(), and pod().
Referenced by contains_unglued_hub(), and glued_hub_pod().
|
virtual |
True if and only if hub id xhub_id is the representative member of its equivalence class.
Implements sheaf::sum_index_space_state.
Definition at line 1306 of file primary_sum_index_space_state.cc.
References _rem, sheaf::explicit_index_space_state::contains_hub(), and rep().
Referenced by clear_ids(), glue(), unglue(), and unglue_all().
|
virtual |
True if this map contains the xi-th term.
Implements sheaf::sum_index_space_state.
Definition at line 1428 of file primary_sum_index_space_state.cc.
References _term_id_begin, _term_id_end, sheaf::sum_index_space_state::_terms, and clear().
Referenced by remove_term(), and term_id_end().
|
virtual |
True if this space contains an id equivalent to xid in the unglued hub id space.
Implements sheaf::explicit_index_space_state.
Definition at line 1598 of file primary_sum_index_space_state.cc.
References _members, contains_glued_hub(), and sheaf::interval_set::contains_member().
Referenced by contains(), and unglued_hub_pod().
|
virtual |
The deep size of this.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 1516 of file primary_sum_index_space_state.cc.
References sheaf::deep_size(), and operator=().
void sheaf::primary_sum_index_space_state::delete_id | ( | pod_type | xid | ) |
Deallocate the id xid in this space.
Definition at line 256 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, contains(), sheaf::interval_set::contains_member(), is_valid_reserved_id(), sheaf::interval_set::remove_member(), and update_extrema().
Referenced by sheaf::hub_index_space_handle::delete_id(), and new_id().
void sheaf::primary_sum_index_space_state::extend_last_term | ( | size_type | xct | ) |
Extends the last term to ct() == xct.
Definition at line 517 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, sheaf::sum_index_space_state::_term_begin, sheaf::sum_index_space_state::_term_end, _term_id_end, sheaf::sum_index_space_state::_terms, sheaf::explicit_index_space_handle::ct(), sheaf::explicit_index_space_state::ct(), sheaf::primary_index_space_handle::extend(), sheaf::interval_set::insert_interval(), interval_is_full(), invariant(), sheaf::sum_index_space_state::last_term(), term_id_end(), and update_extrema().
Referenced by sheaf::hub_index_space_handle::extend_last_term(), and remove_term().
|
static |
Name of the gathered id space.
Definition at line 1115 of file primary_sum_index_space_state.cc.
References sheaf::poset_path::reserved_prefix(), and update_gathered_id_space().
Referenced by gathered_id_space_excludes_bottom(), and new_gathered_id_space().
const sheaf::index_space_handle & sheaf::primary_sum_index_space_state::gathered_id_space | ( | ) | const |
The gathered id space.
Definition at line 1058 of file primary_sum_index_space_state.cc.
References _gathered_id_space, and has_gathered_id_space().
Referenced by sheaf::hub_index_space_handle::gathered_id_space(), new_gathered_id_space(), and update_gathered_id_space().
bool sheaf::primary_sum_index_space_state::gathered_id_space_excludes_bottom | ( | ) | const |
True, if the gathered id space excludes BOTTOM_INDEX.
Definition at line 1096 of file primary_sum_index_space_state.cc.
References _gathered_id_space, sheaf::index_space_handle::contains_hub(), and gathered_hub_id_space_name().
Referenced by sheaf::hub_index_space_handle::gathered_id_space_excludes_bottom(), has_gathered_id_space(), new_gathered_id_space(), and update_gathered_id_space().
|
virtual |
The id space handle with this state.
Implements sheaf::explicit_index_space_state.
Definition at line 1786 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::attach(), sheaf::explicit_index_space_handle::is_attached(), and release_id_space().
Referenced by handle_pool_deep_size().
|
virtual |
Allocates an id space iterator from the iterator pool.
Implements sheaf::explicit_index_space_state.
Definition at line 1923 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::attach(), sheaf::explicit_index_space_iterator::is_attached(), and release_iterator().
Referenced by iterator_pool_deep_size().
Glues xid to xrep; adds xid to the equivalence class with representative member xrep.
Definition at line 869 of file primary_sum_index_space_state.cc.
References _rem, sheaf::sum_index_space_state::_rem_inv, contains_rep(), sheaf::sum_index_space_state::contains_unique_rep(), glued_hub_pod(), invariant(), sheaf::sum_index_space_state::term_id(), and unglue().
Referenced by sheaf::hub_index_space_handle::glue(), and update_extrema().
|
virtual |
The pod index in the glued primary sum id space equivalent to xid in this id space.
Reimplemented from sheaf::explicit_index_space_state.
Definition at line 1689 of file primary_sum_index_space_state.cc.
References _rem, contains(), contains_glued_hub(), handle_pool_ct(), sheaf::invalid_pod_index(), and sheaf::is_valid().
Referenced by glue(), and unglued_hub_pod().
|
static |
The number of handles in the pool.
Definition at line 1748 of file primary_sum_index_space_state.cc.
References handle_pool_deep_size().
Referenced by glued_hub_pod().
|
static |
The deep size of the handle pool.
Definition at line 1767 of file primary_sum_index_space_state.cc.
References sheaf::deep_size(), and get_id_space().
Referenced by handle_pool_ct().
bool sheaf::primary_sum_index_space_state::has_gathered_id_space | ( | ) | const |
True, if the gathered id space exists.
Definition at line 1077 of file primary_sum_index_space_state.cc.
References _gathered_id_space, gathered_id_space_excludes_bottom(), and sheaf::explicit_index_space_handle::is_attached().
Referenced by gathered_id_space(), sheaf::hub_index_space_handle::has_gathered_id_space(), new_gathered_id_space(), and update_gathered_id_space().
bool sheaf::primary_sum_index_space_state::has_gluing | ( | ) | const |
Ture if there is any gluing.
Definition at line 979 of file primary_sum_index_space_state.cc.
References _rem, and new_gathered_id_space().
Referenced by sheaf::hub_index_space_handle::has_gluing(), and unglue_all().
bool sheaf::primary_sum_index_space_state::has_only_standard_ids | ( | ) | const |
True if and only if there are only standard ids.
Definition at line 1236 of file primary_sum_index_space_state.cc.
References _standard_id_end, clear_ids(), and sheaf::explicit_index_space_state::end().
Referenced by clear_ids(), sheaf::hub_index_space_handle::has_only_standard_ids(), and update_standard_ids().
|
virtual |
The host id associated with the representative member of the equivalence class of hub id xhub_id.
Implements sheaf::sum_index_space_state.
Definition at line 1367 of file primary_sum_index_space_state.cc.
References contains(), sheaf::explicit_index_space_state::contains_hub(), rep(), and term_id_begin().
Referenced by rep().
bool sheaf::primary_sum_index_space_state::interval_is_available | ( | pod_type | xbegin, |
pod_type | xend | ||
) | const |
True if the ids in the interval [xbegin, xend) are available in this space.
Definition at line 613 of file primary_sum_index_space_state.cc.
References sheaf::sum_index_space_state::_term_begin, sheaf::sum_index_space_state::_term_end, _term_id_begin, _term_id_end, and term_prefix().
Referenced by add_term(), sheaf::hub_index_space_handle::interval_is_available(), interval_is_empty(), new_primary_term(), and reserved_interval_is_available().
bool sheaf::primary_sum_index_space_state::interval_is_empty | ( | pod_type | xbegin, |
pod_type | xend | ||
) | const |
True if all ids in the interval [xbegin, xend) are not in this space.
Definition at line 592 of file primary_sum_index_space_state.cc.
References _members, interval_is_available(), and sheaf::interval_set::interval_is_empty().
Referenced by add_term(), sheaf::hub_index_space_handle::interval_is_empty(), interval_is_full(), and remove_term().
bool sheaf::primary_sum_index_space_state::interval_is_full | ( | pod_type | xbegin, |
pod_type | xend | ||
) | const |
True if all ids in the interval [xbegin, xend) are in this space.
Definition at line 571 of file primary_sum_index_space_state.cc.
References _members, interval_is_empty(), and sheaf::interval_set::interval_is_full().
Referenced by extend_last_term(), sheaf::hub_index_space_handle::interval_is_full(), and new_primary_term().
|
virtual |
Class invariant.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 2103 of file primary_sum_index_space_state.cc.
References sheaf::deep_size(), sheaf::any::disable_invariant_check(), sheaf::any::enable_invariant_check(), sheaf::sum_index_space_state::invariant(), and sheaf::any::invariant_check().
Referenced by add_term(), clear(), extend_last_term(), glue(), is_ancestor_of(), new_primary_term(), operator=(), primary_sum_index_space_state(), remove_term(), unglue(), and unglue_all().
|
virtual |
Conformance test; true if other conforms to this.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 2081 of file primary_sum_index_space_state.cc.
References invariant().
Referenced by clone(), operator=(), and operator==().
bool sheaf::primary_sum_index_space_state::is_valid_reserved_id | ( | pod_type | xid | ) | const |
True if and only if the reserved term containing xid is already a reserved term or is available for allocation.
Definition at line 280 of file primary_sum_index_space_state.cc.
References sheaf::sum_index_space_state::_terms, sheaf::is_valid(), next_id(), reserved_interval_is_available(), and sheaf::sum_index_space_state::term_id().
Referenced by delete_id(), sheaf::hub_index_space_handle::is_valid_reserved_id(), and new_id().
|
static |
The number of iterators in the pool.
Definition at line 1885 of file primary_sum_index_space_state.cc.
References iterator_pool_deep_size().
Referenced by allocated_id_space().
|
static |
The deep size of the iterator pool.
Definition at line 1904 of file primary_sum_index_space_state.cc.
References sheaf::deep_size(), and get_iterator().
Referenced by iterator_pool_ct().
const sheaf::index_space_handle & sheaf::primary_sum_index_space_state::new_gathered_id_space | ( | bool | xexclude_bottom | ) |
Construct a gathered id space from this id space. If xexclude_bottom, construct the id space without BOTTOM_INDEX.
Definition at line 1009 of file primary_sum_index_space_state.cc.
References _gathered_id_space, gathered_hub_id_space_name(), gathered_id_space(), gathered_id_space_excludes_bottom(), has_gathered_id_space(), sheaf::explicit_index_space_state::id_spaces(), sheaf::explicit_index_space_state::is_gathered(), sheaf::interval_index_space_state::new_space(), and update_gathered_id_space().
Referenced by has_gluing(), and sheaf::hub_index_space_handle::new_gathered_id_space().
sheaf::primary_sum_index_space_state::pod_type sheaf::primary_sum_index_space_state::new_id | ( | ) |
Allocate the next available id in this space.
Definition at line 169 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, _reserved_term, contains(), sheaf::explicit_index_space_state::contains_hub(), sheaf::interval_set::insert_member(), sheaf::explicit_index_space_handle::is_attached(), sheaf::reserved_primary_index_space_handle::is_next_id_available(), sheaf::reserved_primary_index_space_handle::new_id(), new_reserved_term(), sheaf::sum_index_space_state::term_of(), and update_extrema().
Referenced by sheaf::hub_index_space_handle::new_id(), and ~primary_sum_index_space_state().
sheaf::primary_sum_index_space_state::pod_type sheaf::primary_sum_index_space_state::new_id | ( | pod_type | xid | ) |
Allocate the id xid in this space.
Definition at line 207 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, _term_id_end, sheaf::sum_index_space_state::_terms, contains(), sheaf::explicit_index_space_state::contains_hub(), delete_id(), sheaf::interval_set::insert_member(), sheaf::is_valid(), is_valid_reserved_id(), new_reserved_term(), sheaf::sum_index_space_state::term_id(), sheaf::sum_index_space_state::term_of(), and update_extrema().
sheaf::primary_sum_index_space_state::pod_type sheaf::primary_sum_index_space_state::new_primary_term | ( | size_type | xct | ) |
Create a new primary term [next_id(), next_id()+xct). Returns the index of the term created.
Definition at line 344 of file primary_sum_index_space_state.cc.
References _next_id, contains(), sheaf::explicit_index_space_state::ct(), sheaf::explicit_index_space_state::id_spaces(), interval_is_available(), interval_is_full(), invariant(), next_id(), and term_id_end().
Referenced by sheaf::hub_index_space_handle::new_primary_term(), and next_id().
sheaf::primary_sum_index_space_state::pod_type sheaf::primary_sum_index_space_state::new_primary_term | ( | pod_type | xid, |
size_type | xct | ||
) |
Create a new primary term [xid, xid+xct). Returns the index of the term created.
Definition at line 374 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, add_term(), contains(), sheaf::explicit_index_space_state::ct(), sheaf::explicit_index_space_state::id_spaces(), sheaf::explicit_index_space_handle::index(), sheaf::interval_set::insert_interval(), interval_is_available(), interval_is_full(), invariant(), sheaf::primary_index_space_state::new_space(), next_term_name(), remove_term(), term_id_end(), and update_extrema().
|
protected |
Creates a new reserved term starting above next_hub_id(). Returns the index of the term created.
Definition at line 685 of file primary_sum_index_space_state.cc.
References _next_id, _reserved_term, _term_id_end, next_id(), sheaf::primary_index_space_handle::offset(), sheaf::RESERVED_TERM_SIZE, sheaf::sum_index_space_state::term_end(), and term_id_end().
Referenced by new_id(), and next_term_name().
|
protected |
Creates a new reserved term starting at id xid. Returns the index of the term created.
Definition at line 709 of file primary_sum_index_space_state.cc.
References _reserved_term, _term_id_end, add_term(), sheaf::explicit_index_space_handle::attach_to(), sheaf::explicit_index_space_state::id_spaces(), sheaf::explicit_index_space_handle::index(), sheaf::reserved_primary_index_space_state::new_space(), next_id(), next_term_name(), sheaf::RESERVED_TERM_SIZE, sheaf::sum_index_space_state::term_end(), and term_id_end().
|
static |
Create a new primary sum id space in the id space family xid_space at the next available id space index with name xname. Returns a handle to the id space created.
Definition at line 43 of file primary_sum_index_space_state.cc.
References sheaf::hub_index_space_handle::conforms_to_state(), sheaf::index_space_family::contains(), sheaf::explicit_index_space_handle::id_spaces(), sheaf::explicit_index_space_handle::is_persistent(), and sheaf::index_space_handle::name().
Referenced by sheaf::index_space_family::index_space_family().
|
static |
Create a new primary sum id space in the id space family xid_space at the id space index xid with name xname. Returns a handle to the id space created.
Definition at line 74 of file primary_sum_index_space_state.cc.
References sheaf::hub_index_space_handle::conforms_to_state(), sheaf::index_space_family::contains(), sheaf::explicit_index_space_handle::id_spaces(), sheaf::explicit_index_space_handle::index(), sheaf::index_space_family::is_explicit_interval(), sheaf::explicit_index_space_handle::is_persistent(), sheaf::index_space_handle::name(), and primary_sum_index_space_state().
sheaf::primary_sum_index_space_state::pod_type sheaf::primary_sum_index_space_state::next_id | ( | ) | const |
The next available id.
Definition at line 325 of file primary_sum_index_space_state.cc.
References _next_id, and new_primary_term().
Referenced by is_valid_reserved_id(), new_primary_term(), new_reserved_term(), and sheaf::hub_index_space_handle::next_id().
|
protected |
Name of the next term id space.
Definition at line 662 of file primary_sum_index_space_state.cc.
References new_reserved_term(), term_id_end(), and term_prefix().
Referenced by new_primary_term(), new_reserved_term(), and term_prefix().
|
protectedvirtual |
Assignment operator.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 1537 of file primary_sum_index_space_state.cc.
References _members, _next_id, _rem, _reserved_term, _standard_id_end, _term_id_begin, _term_id_end, contains(), invariant(), and is_ancestor_of().
Referenced by deep_size().
|
virtual |
True if this is equivalent to xother.
Reimplemented from sheaf::sum_index_space_state.
Definition at line 1485 of file primary_sum_index_space_state.cc.
References _members, _next_id, _reserved_term, _standard_id_end, _term_id_begin, _term_id_end, deep_size, is_ancestor_of(), and sheaf::sum_index_space_state::operator==().
Referenced by clear().
|
virtual |
The pod index in this space equivalent to xid in the hub id space.
Implements sheaf::explicit_index_space_state.
Definition at line 1644 of file primary_sum_index_space_state.cc.
References contains(), sheaf::explicit_index_space_state::contains_hub(), sheaf::invalid_pod_index(), sheaf::is_valid(), and unglued_hub_pod().
Referenced by contains_glued_hub().
|
virtual |
Release the id space handle xid_space.
Implements sheaf::explicit_index_space_state.
Definition at line 1806 of file primary_sum_index_space_state.cc.
References allocated_id_space(), and sheaf::index_space_handle::detach().
Referenced by get_id_space().
|
virtual |
Returns the id space iterator xitr to the iterator pool.
Implements sheaf::explicit_index_space_state.
Definition at line 1943 of file primary_sum_index_space_state.cc.
References allocated_iterator(), and sheaf::index_space_iterator::detach().
Referenced by get_iterator().
void sheaf::primary_sum_index_space_state::remove_term | ( | pod_type | xi | ) |
Remove xi-th term of this sum.
Definition at line 423 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_ct, _members, sheaf::sum_index_space_state::_sum_to_term_map, sheaf::sum_index_space_state::_term_begin, sheaf::sum_index_space_state::_term_end, _term_id_begin, _term_id_end, sheaf::sum_index_space_state::_terms, contains_term_id(), sheaf::explicit_index_space_state::ct(), extend_last_term(), sheaf::explicit_index_space_state::id_spaces(), interval_is_empty(), sheaf::invalid_pod_index(), invariant(), sheaf::is_valid(), sheaf::interval_set::member_ct(), sheaf::index_space_family::release_id_space(), sheaf::interval_set::remove_interval(), sheaf::sum_index_space_state::term(), term_id_begin(), term_id_end(), and update_extrema().
Referenced by new_primary_term(), and sheaf::hub_index_space_handle::remove_term().
|
virtual |
The representative member of the equivalence class of hub id xhub_id.
Implements sheaf::sum_index_space_state.
Definition at line 1332 of file primary_sum_index_space_state.cc.
References _rem, sheaf::explicit_index_space_state::contains_hub(), and host_rep().
Referenced by contains_rep(), and host_rep().
|
protected |
True if the reserved interval for id xid is available for allocation.
Definition at line 810 of file primary_sum_index_space_state.cc.
References interval_is_available(), sheaf::RESERVED_TERM_SIZE, and update_extrema().
Referenced by add_term(), and is_valid_reserved_id().
|
virtual |
Beginning index of the terms in this sum.
Implements sheaf::sum_index_space_state.
Definition at line 1390 of file primary_sum_index_space_state.cc.
References _term_id_begin, and term_id_end().
Referenced by host_rep(), and remove_term().
|
virtual |
Ending index of the terms in this sum.
Implements sheaf::sum_index_space_state.
Definition at line 1409 of file primary_sum_index_space_state.cc.
References _term_id_end, and contains_term_id().
Referenced by add_term(), extend_last_term(), new_primary_term(), new_reserved_term(), next_term_name(), remove_term(), and term_id_begin().
|
staticprotected |
Prefix of the term id spaces.
Definition at line 643 of file primary_sum_index_space_state.cc.
References next_term_name().
Referenced by interval_is_available(), and next_term_name().
void sheaf::primary_sum_index_space_state::unglue | ( | pod_type | xid | ) |
Unglues xid; makes xid its own representative.
Definition at line 897 of file primary_sum_index_space_state.cc.
References _rem, sheaf::sum_index_space_state::_rem_inv, contains(), contains_rep(), sheaf::sum_index_space_state::contains_unique_rep(), sheaf::explicit_index_space_state::hub_pod(), invariant(), and unglue_all().
Referenced by glue(), and sheaf::hub_index_space_handle::unglue().
void sheaf::primary_sum_index_space_state::unglue_all | ( | pod_type | xrep_id | ) |
Unglue all ids glued to representative xrep_id; makes each id in the equivalence class of xrep_id its own representative.
Definition at line 942 of file primary_sum_index_space_state.cc.
References _rem, sheaf::sum_index_space_state::_rem_inv, contains_rep(), sheaf::sum_index_space_state::contains_unique_rep(), has_gluing(), and invariant().
Referenced by unglue(), and sheaf::hub_index_space_handle::unglue_all().
|
virtual |
The pod index in the unglued hub id space equivalent to xid in this id space.
Implements sheaf::explicit_index_space_state.
Definition at line 1670 of file primary_sum_index_space_state.cc.
References contains(), contains_unglued_hub(), glued_hub_pod(), sheaf::invalid_pod_index(), and sheaf::is_valid().
Referenced by pod().
|
protected |
Update the id extrema.
Definition at line 831 of file primary_sum_index_space_state.cc.
References sheaf::explicit_index_space_state::_begin, sheaf::explicit_index_space_state::_ct, sheaf::explicit_index_space_state::_end, _members, sheaf::interval_set::begin(), sheaf::interval_set::end(), glue(), and sheaf::explicit_index_space_state::invalidate_extrema().
Referenced by clear_ids(), delete_id(), extend_last_term(), new_id(), new_primary_term(), remove_term(), and reserved_interval_is_available().
void sheaf::primary_sum_index_space_state::update_gathered_id_space | ( | ) |
Update the gathered id space.
Definition at line 1037 of file primary_sum_index_space_state.cc.
References gathered_id_space(), gathered_id_space_excludes_bottom(), has_gathered_id_space(), and sheaf::explicit_index_space_state::is_gathered().
Referenced by gathered_hub_id_space_name(), new_gathered_id_space(), and sheaf::hub_index_space_handle::update_gathered_id_space().
|
protected |
Update the gathered id space. If xexclude_bottom, construct the id space without BOTTOM_INDEX.
Definition at line 1136 of file primary_sum_index_space_state.cc.
References _gathered_id_space, _members, sheaf::gathered_insertion_index_space_handle::clear(), gathered_id_space(), gathered_id_space_excludes_bottom(), has_gathered_id_space(), sheaf::interval_set::interval_map(), sheaf::invalid_pod_index(), sheaf::index_space_handle::is_empty(), sheaf::explicit_index_space_state::is_gathered(), sheaf::is_valid(), sheaf::interval_index_space_handle::push_interval(), and update_standard_ids().
void sheaf::primary_sum_index_space_state::update_standard_ids | ( | ) |
Make end() the standard id end.
Definition at line 1217 of file primary_sum_index_space_state.cc.
References _standard_id_end, sheaf::explicit_index_space_state::end(), and has_only_standard_ids().
Referenced by update_gathered_id_space(), and sheaf::hub_index_space_handle::update_standard_ids().
|
friend |
The deep size of primary_sum_index_space_state& xn.
Referenced by sheaf::deep_size(), and operator==().
|
protected |
The gathered id space.
Definition at line 372 of file primary_sum_index_space_state.h.
Referenced by gathered_id_space(), gathered_id_space_excludes_bottom(), has_gathered_id_space(), new_gathered_id_space(), and update_gathered_id_space().
|
protected |
Set of members in the domain of this map.
Definition at line 264 of file primary_sum_index_space_state.h.
Referenced by sheaf::hub_index_space_iterator::attach_to(), clear(), clear_ids(), contains(), contains_glued_hub(), contains_unglued_hub(), sheaf::deep_size(), delete_id(), extend_last_term(), interval_is_empty(), interval_is_full(), new_id(), new_primary_term(), operator=(), operator==(), remove_term(), update_extrema(), and update_gathered_id_space().
|
protected |
The next available id.
Definition at line 269 of file primary_sum_index_space_state.h.
Referenced by add_term(), new_primary_term(), new_reserved_term(), next_id(), operator=(), and operator==().
|
protected |
The reflexive reduction of the rem map.
Definition at line 467 of file primary_sum_index_space_state.h.
Referenced by sheaf::hub_index_space_iterator::attach_to(), clear(), contains_glued_hub(), contains_rep(), sheaf::deep_size(), glue(), glued_hub_pod(), has_gluing(), operator=(), rep(), unglue(), and unglue_all().
|
protected |
The current reserved term.
Definition at line 274 of file primary_sum_index_space_state.h.
Referenced by new_id(), new_reserved_term(), operator=(), and operator==().
|
protected |
The set of reserved term ids.
Definition at line 279 of file primary_sum_index_space_state.h.
|
protected |
The end id of the standard ids.
Definition at line 406 of file primary_sum_index_space_state.h.
Referenced by clear_ids(), has_only_standard_ids(), operator=(), operator==(), and update_standard_ids().
|
protected |
Beginning index of the terms in this sum.
Definition at line 472 of file primary_sum_index_space_state.h.
Referenced by clear(), contains_term_id(), interval_is_available(), operator=(), operator==(), remove_term(), and term_id_begin().
|
protected |
Ending index of the terms in this sum.
Definition at line 477 of file primary_sum_index_space_state.h.
Referenced by add_term(), clear(), contains_term_id(), extend_last_term(), interval_is_available(), new_id(), new_reserved_term(), operator=(), operator==(), remove_term(), and term_id_end().