SheafSystem  0.0.0.0
sheaf::poset_powerset_state Class Reference

The set of subsets of a poset. More...

#include <poset_powerset_state.h>

Inheritance diagram for sheaf::poset_powerset_state:
sheaf::any

Friends

class poset_state_handle
 
class subposet
 
class storage_agent
 
class poset_scaffold
 
SHEAF_DLL_SPEC std::ostream & operator<< (std::ostream &os, const poset_powerset_state &p)
 Insert poset_powerset_state& p into ostream& os. More...
 
SHEAF_DLL_SPEC size_t deep_size (const poset_powerset_state &xp, bool xinclude_shallow)
 The deep size of the referenced object of type poset_powerset_state. More...
 

CANONICAL FACET

 poset_powerset_state (size_type xcapacity, const scoped_index &xsubposet_member_index_ub)
 Creates an instance with initial space for xcapacity subposets each of which has an index upper bound xsubposet_member_index_ub. More...
 
 ~poset_powerset_state ()
 Destructor. More...
 

SUBPOSETS FACET

subposet_statemember (pod_index_type xindex)
 The subposet with index xindex (mutable version). More...
 
subposet_statemember (const scoped_index &xindex)
 The subposet with index xindex (mutable version). More...
 
const subposet_statemember (pod_index_type xindex) const
 The subposet with index xindex (const version). More...
 
const subposet_statemember (const scoped_index &xindex) const
 The subposet with index xindex (const version). More...
 
pod_index_type new_subposet (bool xinitializ)
 Allocate a new subposet. If xinitialize, make the subposet empty,. More...
 
void new_subposet (bool xinitialize, scoped_index &xresult)
 Allocate a new subposet. If xinitialize, make the subposet empty,. More...
 
pod_index_type new_subposet (const block< pod_index_type > &xmembers)
 Allocate a new subposet with members xmembers. More...
 
void new_subposet (const block< scoped_index > &xmembers, scoped_index &xresult)
 Allocate a new subposet with members xmembers. More...
 
void delete_subposet (pod_index_type xindex)
 Deallocate the subposet with index xindex. More...
 
void delete_subposet (const scoped_index &xindex)
 Deallocate the subposet with index xindex. More...
 
const scoped_indexsubposet_index_ub () const
 The upper bound on the subposet index. More...
 
size_type subposet_ct () const
 The number of subposets. More...
 
index_space_iteratorget_subposet_id_space_iterator () const
 Allocates an id space iterator over the subposet ids from the iterator pool. More...
 
void release_subposet_id_space_iterator (index_space_iterator &xitr) const
 Returns the id space iterator xitr to the subposet iterator pool. More...
 
bool contains_subposet (pod_index_type xindex) const
 True if and only if there exists a subposet with index xindex. More...
 
bool contains_subposet (const scoped_index &xindex) const
 True if and only if there exists a subposet with index xindex. More...
 

ID SPACE FACET

const index_space_familyid_spaces () const
 Collection of id spaces for this poset powerset. More...
 
const hub_index_space_handlehub_id_space () const
 Hub id space for this poset powerset. More...
 
const scoped_indexhub_id () const
 A id in the hub id space; intended for copying to initialize ids to the hub id space. More...
 
scoped_index hub_id (pod_index_type xid) const
 A id in the hub id space with pod xid. More...
 

SUBPOSET NAME FACET

typedef name_multimap subposet_name_map_type
 The type of the subposet_name_map. More...
 
subposet_name_map_typesubposet_name_map ()
 Bi-directional map between subposet names and indices. More...
 
const subposet_name_map_typesubposet_name_map () const
 Bi-directional map between subposet names and indices; const version. More...
 

SUBPOSET MEMBERSHIP FACET

const scoped_indexsubposet_member_index_ub () const
 Upper bound of member index in each subposet. More...
 
void put_subposet_member_index_ub (const scoped_index &xub)
 Sets the upper bound of member index in each subposet to xub. More...
 
bool is_dof_subposet (pod_index_type xindex) const
 True, if the subposet with index xindex is a dofs subposet. More...
 
bool is_dof_subposet (const scoped_index &xindex) const
 True, if the subposet with index xindex is a dofs subposet. More...
 
void delete_poset_member (pod_index_type xindex)
 Removes the poset member with index xindex from all subposets. More...
 
void delete_poset_member (const scoped_index &xindex)
 Removes the poset member with index xindex from all subposets. More...
 
bool subposet_contains_member (pod_index_type xsubposet_index, pod_index_type xmbr_index) const
 True if and only if the subposet with index xsubposet_index contains the member with index xmbr_index. More...
 
bool subposet_contains_member (const scoped_index &xsubposet_index, const scoped_index &xmbr_index) const
 True if and only if the subposet with index xsubposet_index contains the member with index xmbr_index. More...
 

STANDARD SUBPOSETS FACET

subposetcoarsest_common_refinement ()
 The coarsest common refinement of all versions of this poset (mutable version). More...
 
const subposetcoarsest_common_refinement () const
 The coarsest common refinement of all versions of this poset (const version). More...
 
subposetcoarsest_common_refinement_jims ()
 The jims of the coarsest_common_refinement (mutable version). More...
 
const subposetcoarsest_common_refinement_jims () const
 The jims of the coarsest_common_refinement (const version). More...
 
subposetwhole ()
 The members of the current version of this poset. More...
 
subposetjims ()
 The jims of the current version of this poset. More...
 
subposettable_dof_subposet ()
 The table dof subposet when this poset is used as a schema (mutable version). More...
 
const subposettable_dof_subposet () const
 The table dof subposet when this poset is used as a schema (const version). More...
 
subposetrow_dof_subposet ()
 The row dof subposet when this poset is used as a schema (mutable version). More...
 
const subposetrow_dof_subposet () const
 The row dof subposet when this poset is used as a schema (const version). More...
 
int standard_subposet_ct () const
 The number of standard subposets automatically allocated by the poset handle constructor. More...
 
void put_standard_subposet_ct (int xct)
 Put the number of standard subposets automatically allocated by the poset handle constructor. More...
 

ANY FACET

virtual bool is_ancestor_of (const any *other) const
 True if other conforms to current. More...
 
virtual poset_powerset_stateclone () const
 Make a new instance of the same type as this. More...
 
bool invariant () const
 Class invariant. More...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Detailed Description

The set of subsets of a poset.

Definition at line 64 of file poset_powerset_state.h.

Member Typedef Documentation

◆ subposet_name_map_type

The type of the subposet_name_map.

Definition at line 265 of file poset_powerset_state.h.

Constructor & Destructor Documentation

◆ poset_powerset_state()

sheaf::poset_powerset_state::poset_powerset_state ( size_type  xcapacity,
const scoped_index xsubposet_member_index_ub 
)

Creates an instance with initial space for xcapacity subposets each of which has an index upper bound xsubposet_member_index_ub.

Precondition
  • xsubposet_member_index_ub.is_hub_scope()
  • xsubposet_member_index_ub >= 0
Postcondition

Definition at line 37 of file poset_powerset_state.cc.

References sheaf::scoped_index::is_hub_scope(), and ~poset_powerset_state().

◆ ~poset_powerset_state()

sheaf::poset_powerset_state::~poset_powerset_state ( )

Member Function Documentation

◆ clone()

sheaf::poset_powerset_state * sheaf::poset_powerset_state::clone ( ) const
virtual

Make a new instance of the same type as this.

Todo:
implement poset_powerset_state::clone

Not Implemented.

Postcondition
  • result != 0

Reimplemented from sheaf::any.

Definition at line 869 of file poset_powerset_state.cc.

References invariant().

Referenced by is_ancestor_of().

◆ coarsest_common_refinement() [1/2]

sheaf::subposet & sheaf::poset_powerset_state::coarsest_common_refinement ( )

The coarsest common refinement of all versions of this poset (mutable version).

Definition at line 743 of file poset_powerset_state.cc.

Referenced by sheaf::refinable_poset::coarsest_common_refinement(), and subposet_contains_member().

◆ coarsest_common_refinement() [2/2]

const sheaf::subposet & sheaf::poset_powerset_state::coarsest_common_refinement ( ) const

The coarsest common refinement of all versions of this poset (const version).

Definition at line 750 of file poset_powerset_state.cc.

References coarsest_common_refinement_jims().

◆ coarsest_common_refinement_jims() [1/2]

sheaf::subposet & sheaf::poset_powerset_state::coarsest_common_refinement_jims ( )

The jims of the coarsest_common_refinement (mutable version).

Definition at line 757 of file poset_powerset_state.cc.

Referenced by coarsest_common_refinement(), and sheaf::refinable_poset::coarsest_common_refinement_jims().

◆ coarsest_common_refinement_jims() [2/2]

const sheaf::subposet & sheaf::poset_powerset_state::coarsest_common_refinement_jims ( ) const

The jims of the coarsest_common_refinement (const version).

Definition at line 764 of file poset_powerset_state.cc.

References whole().

◆ contains_subposet() [1/2]

bool sheaf::poset_powerset_state::contains_subposet ( pod_index_type  xindex) const

True if and only if there exists a subposet with index xindex.

Definition at line 457 of file poset_powerset_state.cc.

Referenced by release_subposet_id_space_iterator().

◆ contains_subposet() [2/2]

bool sheaf::poset_powerset_state::contains_subposet ( const scoped_index xindex) const

True if and only if there exists a subposet with index xindex.

Definition at line 474 of file poset_powerset_state.cc.

References sheaf::scoped_index::hub_pod(), and id_spaces().

◆ delete_poset_member() [1/2]

void sheaf::poset_powerset_state::delete_poset_member ( pod_index_type  xindex)

Removes the poset member with index xindex from all subposets.

Definition at line 657 of file poset_powerset_state.cc.

References sheaf::index_space_iterator::is_done(), sheaf::index_space_iterator::next(), and sheaf::index_space_iterator::pod().

Referenced by is_dof_subposet().

◆ delete_poset_member() [2/2]

void sheaf::poset_powerset_state::delete_poset_member ( const scoped_index xindex)

Removes the poset member with index xindex from all subposets.

Definition at line 683 of file poset_powerset_state.cc.

References sheaf::scoped_index::hub_pod(), and subposet_contains_member().

◆ delete_subposet() [1/2]

void sheaf::poset_powerset_state::delete_subposet ( pod_index_type  xindex)

Deallocate the subposet with index xindex.

Precondition
  • contains_subposet(xindex)
Postcondition
  • !contains_subposet(xindex)

Definition at line 349 of file poset_powerset_state.cc.

Referenced by new_subposet().

◆ delete_subposet() [2/2]

void sheaf::poset_powerset_state::delete_subposet ( const scoped_index xindex)

Deallocate the subposet with index xindex.

Precondition
  • contains_subposet(xindex)
Postcondition
  • !contains_subposet(xindex)

Definition at line 384 of file poset_powerset_state.cc.

References sheaf::scoped_index::hub_pod(), and subposet_index_ub().

◆ get_subposet_id_space_iterator()

sheaf::index_space_iterator & sheaf::poset_powerset_state::get_subposet_id_space_iterator ( ) const

Allocates an id space iterator over the subposet ids from the iterator pool.

Postcondition

Definition at line 419 of file poset_powerset_state.cc.

References release_subposet_id_space_iterator().

Referenced by sheaf::operator<<(), and subposet_ct().

◆ hub_id() [1/2]

const sheaf::scoped_index & sheaf::poset_powerset_state::hub_id ( ) const

A id in the hub id space; intended for copying to initialize ids to the hub id space.

Postcondition
  • result.is_hub_scope()

Definition at line 506 of file poset_powerset_state.cc.

References sheaf::scoped_index::is_hub_scope().

Referenced by sheaf::poset_scaffold::convert_record_id_to_subposet_id(), and hub_id_space().

◆ hub_id() [2/2]

sheaf::scoped_index sheaf::poset_powerset_state::hub_id ( pod_index_type  xid) const

A id in the hub id space with pod xid.

Postcondition
  • result.is_hub_scope()
  • result.pod() == xid

Definition at line 525 of file poset_powerset_state.cc.

References sheaf::scoped_index::is_hub_scope(), sheaf::scoped_index::pod(), and subposet_name_map().

◆ hub_id_space()

const sheaf::hub_index_space_handle & sheaf::poset_powerset_state::hub_id_space ( ) const

Hub id space for this poset powerset.

Definition at line 499 of file poset_powerset_state.cc.

References hub_id(), and sheaf::index_space_handle::hub_id_space().

Referenced by id_spaces(), and sheaf::operator<<().

◆ id_spaces()

const sheaf::index_space_family & sheaf::poset_powerset_state::id_spaces ( ) const

Collection of id spaces for this poset powerset.

Definition at line 492 of file poset_powerset_state.cc.

References hub_id_space().

Referenced by contains_subposet(), and sheaf::operator<<().

◆ invariant()

bool sheaf::poset_powerset_state::invariant ( ) const
virtual

Class invariant.

Invariant

Reimplemented from sheaf::any.

Definition at line 892 of file poset_powerset_state.cc.

References sheaf::operator<<().

Referenced by clone(), and sheaf::poset_state::invariant().

◆ is_ancestor_of()

bool sheaf::poset_powerset_state::is_ancestor_of ( const any other) const
virtual

True if other conforms to current.

Reimplemented from sheaf::any.

Definition at line 850 of file poset_powerset_state.cc.

References clone().

Referenced by put_standard_subposet_ct().

◆ is_dof_subposet() [1/2]

bool sheaf::poset_powerset_state::is_dof_subposet ( pod_index_type  xindex) const

True, if the subposet with index xindex is a dofs subposet.

Precondition
  • contains_subposet(xindex)

Definition at line 619 of file poset_powerset_state.cc.

Referenced by put_subposet_member_index_ub().

◆ is_dof_subposet() [2/2]

bool sheaf::poset_powerset_state::is_dof_subposet ( const scoped_index xindex) const

True, if the subposet with index xindex is a dofs subposet.

Precondition
  • contains_subposet(xindex)

Definition at line 638 of file poset_powerset_state.cc.

References delete_poset_member(), and sheaf::scoped_index::hub_pod().

◆ jims()

sheaf::subposet & sheaf::poset_powerset_state::jims ( )

The jims of the current version of this poset.

Definition at line 778 of file poset_powerset_state.cc.

References table_dof_subposet().

Referenced by whole().

◆ member() [1/4]

sheaf::subposet_state & sheaf::poset_powerset_state::member ( pod_index_type  xindex)

The subposet with index xindex (mutable version).

Precondition
  • contains_subposet(xindex)

Definition at line 108 of file poset_powerset_state.cc.

Referenced by sheaf::depth_first_itr< T >::initialize_filter(), sheaf::depth_first_iterator::initialize_filter(), member(), and ~poset_powerset_state().

◆ member() [2/4]

sheaf::subposet_state & sheaf::poset_powerset_state::member ( const scoped_index xindex)

The subposet with index xindex (mutable version).

Precondition
  • contains_subposet(xindex)

Definition at line 127 of file poset_powerset_state.cc.

References sheaf::scoped_index::hub_pod(), and member().

◆ member() [3/4]

const sheaf::subposet_state & sheaf::poset_powerset_state::member ( pod_index_type  xindex) const

The subposet with index xindex (const version).

Precondition
  • contains_subposet(xindex)

Definition at line 146 of file poset_powerset_state.cc.

References member().

◆ member() [4/4]

const sheaf::subposet_state & sheaf::poset_powerset_state::member ( const scoped_index xindex) const

The subposet with index xindex (const version).

Precondition
  • contains_subposet(xindex)

Definition at line 165 of file poset_powerset_state.cc.

References sheaf::scoped_index::hub_pod(), and new_subposet().

◆ new_subposet() [1/4]

sheaf::pod_index_type sheaf::poset_powerset_state::new_subposet ( bool  xinitializ)

Allocate a new subposet. If xinitialize, make the subposet empty,.

Issue:
Do we want to reuse the subposet index when the last member is deleted? If so, uncomment the code below (including the postcondition). This was working before because _subposet_index_ub was not updated when a member was deleted. scoped_index result = _id_spaces.new_id(subposet_index_ub());
Postcondition
  • contains_subposet(result)
  • member(result).is_persistent()

Definition at line 184 of file poset_powerset_state.cc.

Referenced by member(), and new_subposet().

◆ new_subposet() [2/4]

void sheaf::poset_powerset_state::new_subposet ( bool  xinitialize,
scoped_index xresult 
)

Allocate a new subposet. If xinitialize, make the subposet empty,.

Postcondition
  • result.is_hub_scope()
  • result.in_scope()
  • contains_subposet(result)
  • member(result).is_persistent()

Definition at line 229 of file poset_powerset_state.cc.

References sheaf::scoped_index::in_scope(), sheaf::scoped_index::is_hub_scope(), new_subposet(), and sheaf::scoped_index::put().

◆ new_subposet() [3/4]

sheaf::pod_index_type sheaf::poset_powerset_state::new_subposet ( const block< pod_index_type > &  xmembers)

Allocate a new subposet with members xmembers.

Issue:
Do we want to reuse the subposet index when the last member is deleted? If so, uncomment the code below (including the postcondition). This was working before because _subposet_index_ub was not updated when a member was deleted. scoped_index result = _id_spaces.new_id(subposet_index_ub());
Postcondition
  • contains_subposet(result)
  • member(result).is_persistent()

Definition at line 258 of file poset_powerset_state.cc.

References new_subposet().

◆ new_subposet() [4/4]

void sheaf::poset_powerset_state::new_subposet ( const block< scoped_index > &  xmembers,
scoped_index xresult 
)

Allocate a new subposet with members xmembers.

Issue:
Do we want to reuse the subposet index when the last member is deleted? If so, uncomment the code below (including the postcondition). This was working before because _subposet_index_ub was not updated when a member was deleted. scoped_index result = _id_spaces.new_id(subposet_index_ub());
Postcondition
  • result.is_hub_scope()
  • result.in_scope()
  • contains_subposet(result)
  • member(result).is_persistent()

Definition at line 303 of file poset_powerset_state.cc.

References delete_subposet(), sheaf::scoped_index::in_scope(), sheaf::scoped_index::is_hub_scope(), sheaf::scoped_index::pod(), and sheaf::scoped_index::put().

◆ put_standard_subposet_ct()

void sheaf::poset_powerset_state::put_standard_subposet_ct ( int  xct)

Put the number of standard subposets automatically allocated by the poset handle constructor.

Postcondition

Definition at line 820 of file poset_powerset_state.cc.

References is_ancestor_of().

Referenced by standard_subposet_ct().

◆ put_subposet_member_index_ub()

void sheaf::poset_powerset_state::put_subposet_member_index_ub ( const scoped_index xub)

Sets the upper bound of member index in each subposet to xub.

Precondition
  • xub.same_scope(subposet_member_index_ub())
Postcondition

Definition at line 589 of file poset_powerset_state.cc.

References is_dof_subposet(), sheaf::index_space_iterator::is_done(), sheaf::index_space_iterator::next(), sheaf::index_space_iterator::pod(), sheaf::scoped_index::pod(), and sheaf::scoped_index::same_scope().

Referenced by fiber_bundle::section_space_schema_poset::new_standard_member_hack(), and subposet_member_index_ub().

◆ release_subposet_id_space_iterator()

void sheaf::poset_powerset_state::release_subposet_id_space_iterator ( index_space_iterator xitr) const

Returns the id space iterator xitr to the subposet iterator pool.

Precondition

Definition at line 438 of file poset_powerset_state.cc.

References contains_subposet().

Referenced by get_subposet_id_space_iterator(), and sheaf::operator<<().

◆ row_dof_subposet() [1/2]

sheaf::subposet & sheaf::poset_powerset_state::row_dof_subposet ( )

The row dof subposet when this poset is used as a schema (mutable version).

Definition at line 799 of file poset_powerset_state.cc.

Referenced by table_dof_subposet().

◆ row_dof_subposet() [2/2]

const sheaf::subposet & sheaf::poset_powerset_state::row_dof_subposet ( ) const

The row dof subposet when this poset is used as a schema (const version).

Definition at line 806 of file poset_powerset_state.cc.

References standard_subposet_ct().

◆ standard_subposet_ct()

int sheaf::poset_powerset_state::standard_subposet_ct ( ) const

The number of standard subposets automatically allocated by the poset handle constructor.

Definition at line 813 of file poset_powerset_state.cc.

References put_standard_subposet_ct().

Referenced by row_dof_subposet().

◆ subposet_contains_member() [1/2]

bool sheaf::poset_powerset_state::subposet_contains_member ( pod_index_type  xsubposet_index,
pod_index_type  xmbr_index 
) const

True if and only if the subposet with index xsubposet_index contains the member with index xmbr_index.

Precondition
  • contains_subposet(xsubposet_index)

Definition at line 690 of file poset_powerset_state.cc.

Referenced by delete_poset_member().

◆ subposet_contains_member() [2/2]

bool sheaf::poset_powerset_state::subposet_contains_member ( const scoped_index xsubposet_index,
const scoped_index xmbr_index 
) const

True if and only if the subposet with index xsubposet_index contains the member with index xmbr_index.

Precondition
  • contains_subposet(xsubposet_index)

Definition at line 711 of file poset_powerset_state.cc.

References coarsest_common_refinement(), and sheaf::scoped_index::hub_pod().

◆ subposet_ct()

sheaf::size_type sheaf::poset_powerset_state::subposet_ct ( ) const

The number of subposets.

Definition at line 412 of file poset_powerset_state.cc.

References get_subposet_id_space_iterator().

Referenced by subposet_index_ub().

◆ subposet_index_ub()

const sheaf::scoped_index & sheaf::poset_powerset_state::subposet_index_ub ( ) const

The upper bound on the subposet index.

Definition at line 405 of file poset_powerset_state.cc.

References subposet_ct().

Referenced by delete_subposet().

◆ subposet_member_index_ub()

const sheaf::scoped_index & sheaf::poset_powerset_state::subposet_member_index_ub ( ) const

Upper bound of member index in each subposet.

Definition at line 582 of file poset_powerset_state.cc.

References put_subposet_member_index_ub().

Referenced by sheaf::poset_state::invariant(), and subposet_name_map().

◆ subposet_name_map() [1/2]

sheaf::poset_powerset_state::subposet_name_map_type & sheaf::poset_powerset_state::subposet_name_map ( )

Bi-directional map between subposet names and indices.

Definition at line 557 of file poset_powerset_state.cc.

Referenced by hub_id(), and sheaf::operator<<().

◆ subposet_name_map() [2/2]

const sheaf::poset_powerset_state::subposet_name_map_type & sheaf::poset_powerset_state::subposet_name_map ( ) const

Bi-directional map between subposet names and indices; const version.

Definition at line 564 of file poset_powerset_state.cc.

References subposet_member_index_ub().

◆ table_dof_subposet() [1/2]

sheaf::subposet & sheaf::poset_powerset_state::table_dof_subposet ( )

The table dof subposet when this poset is used as a schema (mutable version).

Definition at line 785 of file poset_powerset_state.cc.

Referenced by jims().

◆ table_dof_subposet() [2/2]

const sheaf::subposet & sheaf::poset_powerset_state::table_dof_subposet ( ) const

The table dof subposet when this poset is used as a schema (const version).

Definition at line 792 of file poset_powerset_state.cc.

References row_dof_subposet().

◆ whole()

sheaf::subposet & sheaf::poset_powerset_state::whole ( )

The members of the current version of this poset.

Definition at line 771 of file poset_powerset_state.cc.

References jims().

Referenced by coarsest_common_refinement_jims(), and fiber_bundle::section_space_schema_poset::new_standard_member_hack().

Friends And Related Function Documentation

◆ deep_size

SHEAF_DLL_SPEC size_t deep_size ( const poset_powerset_state xp,
bool  xinclude_shallow 
)
friend

The deep size of the referenced object of type poset_powerset_state.

◆ operator<<

SHEAF_DLL_SPEC std::ostream& operator<< ( std::ostream &  os,
const poset_powerset_state p 
)
friend

Insert poset_powerset_state& p into ostream& os.


The documentation for this class was generated from the following files: