SheafSystem  0.0.0.0
sheaf::poset_slicer Class Reference

Traverser to compute intersection of the down set (up set) of the anchor with a given subposet. The typical use of this traverser is to compute the maximal (minimal) members of the down set (up set) which are also contained in the given subset. This produces a slice subposet, hence the name of the class. More...

#include <poset_slicer.h>

Inheritance diagram for sheaf::poset_slicer:
sheaf::poset_dft sheaf::poset_traverser sheaf::any

Public Types

enum  slice_mode { MAXIMAL, MINIMAL, ALL }
 Include only maximal, minimal, or all members in slice. More...
 

Public Member Functions

virtual bool invariant () const
 Class invariant. More...
 
 poset_slicer (const poset_state_handle *xhost)
 Constructor. More...
 
 ~poset_slicer ()
 Destructor. More...
 
subposetfind (abstract_poset_member *xanchor, subposet *xlayer, bool xdown, slice_mode xmode=ALL)
 Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), auto-allocated. More...
 
void find_pa (abstract_poset_member *xanchor, subposet *xlayer, bool xdown, subposet *result, slice_mode xmode=ALL)
 Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), pre-allocated. More...
 
subposetfind (subposet *xanchor, subposet *xlayer, bool xdown, slice_mode xmode=ALL)
 Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), auto-allocated. More...
 
void find_pa (const subposet *xanchor, subposet *xlayer, bool xdown, subposet *result, slice_mode xmode=ALL)
 Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), pre-allocated. More...
 
subposetfind_jims (abstract_poset_member *xanchor, slice_mode xmode=ALL)
 Find jims in the down set of the poset member xanchor, auto-allocated. More...
 
void find_jims_pa (abstract_poset_member *xanchor, subposet *result, slice_mode xmode=ALL)
 Find jims in the down set of the poset member xanchor, pre-allocated. More...
 
subposetfind_jims (const subposet *xanchor, slice_mode xmode=ALL)
 Find jims in the down set of the subposet xsp, auto-allocated. More...
 
void find_jims_pa (const subposet *xanchor, subposet *result, slice_mode xmode=ALL)
 Find jims in the down set of the subposet xsp, pre-allocated. More...
 
subposetdown_set (abstract_poset_member *xanchor, slice_mode xmode=ALL)
 find the down set of the poset member xanchor, auto-allocated More...
 
void down_set_pa (abstract_poset_member *xanchor, subposet *result, slice_mode xmode=ALL)
 find the down set of the poset member xanchor, pre-allocated More...
 
subposetup_set (abstract_poset_member *xanchor, slice_mode xmode=ALL)
 find the up set of the poset member xanchor, auto-allocated More...
 
void up_set_pa (abstract_poset_member *xanchor, subposet *result, slice_mode xmode=ALL)
 find the up set of the poset member xanchor, pre-allocated More...
 
subposetdown_set (const subposet *xanchor, slice_mode xmode=ALL)
 find the down set of subposet xanchor, auto-allocated More...
 
void down_set_pa (const subposet *xanchor, subposet *result, slice_mode xmode=ALL)
 find the down set of subposet xanchor, pre-allocated More...
 
subposetup_set (const subposet *xanchor, slice_mode xmode=ALL)
 find the up set of subposet xanchor, auto-allocated More...
 
void up_set_pa (const subposet *xanchor, subposet *result, slice_mode xmode=ALL)
 find the up set of subposet xanchor, pre-allocated More...
 
- Public Member Functions inherited from sheaf::poset_dft
 poset_dft (const poset_state_handle *xhost)
 Constructor. More...
 
 ~poset_dft ()
 Destructor. More...
 
- Public Member Functions inherited from sheaf::poset_traverser
 poset_traverser (const poset_state_handle *xanchor)
 Constructor. More...
 
 ~poset_traverser ()
 Destructor. More...
 
poset_state_handlehost ()
 The poset being traversed (mutable version). More...
 
const poset_state_handlehost () const
 The poset being traversed (const version). More...
 
bool has_same_host (const poset_component *other) const
 True if other is not void and is attached to the same host as this. More...
 
virtual abstract_poset_memberanchor ()
 The member which is the starting point of this traversal (mutable verison). More...
 
virtual const abstract_poset_memberanchor () const
 The member which is the starting point of this traversal (const version). More...
 
bool in_down_set () const
 True if traversing down from anchor(). More...
 
void traverse (const abstract_poset_member *xanchor, bool down, bool reset_markers=true)
 Traverse the down set (down == true) or up set (down == false) of xanchor. If reset_markers, reset all visited markers to false before begining. More...
 
- Public Member Functions inherited from sheaf::any
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual anyclone () const
 Virtual constructor, makes a new instance of 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 poset_state_handle
 
class abstract_poset_member
 

Additional Inherited Members

- Protected Member Functions inherited from sheaf::poset_dft
void private_traverse ()
 Implements the traversal. More...
 
void recursive_dft (abstract_poset_member *xmbr)
 
- Protected Member Functions inherited from sheaf::poset_traverser
bool has_been_visited (const abstract_poset_member *xmbr) const
 True if xmbr has been previously visited. More...
 
bool has_been_visited (int xindex) const
 True if the member with index xindex has been previously visited. More...
 
scoped_index member_index_ub () const
 The upper bound on the member index. More...
 
bool no_members_visited () const
 True if no members have been visited. More...
 
bool all_members_visited () const
 True if all members have been visited. More...
 
void mark_members_not_visited ()
 Sets the visited markers false for all members. More...
 
void mark_visited (const abstract_poset_member *xmbr)
 Sets the visited marker true for xmbr. More...
 
void mark_visited (int xindex)
 Sets the visited markers true for the emebr with index xindex. More...
 
void mark_not_visited (int xindex)
 Sets the visited markers false for the emebr with index xindex. More...
 
void ensure_visited_ub ()
 Ensures the visited bit vector is large enough. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from sheaf::poset_dft
bool _descend
 If true on return from previsit_action, descend into lower cover previsit_action can truncate dft by setting this false. More...
 
std::stack< abstract_poset_member * > _free_mbrs
 Storage for abstract_poset_member objects, so we can reuse them, rather than creating one for each member in the graph. More...
 
- Protected Attributes inherited from sheaf::poset_traverser
poset_state_handle_host
 The poset being traversed. More...
 
zn_to_bool_visited
 The markers for previously visited members. More...
 
abstract_poset_member_anchor
 The member which is the starting point of this traversal. More...
 
bool _in_down_set
 True if traversing down from anchor(). More...
 

Detailed Description

Traverser to compute intersection of the down set (up set) of the anchor with a given subposet. The typical use of this traverser is to compute the maximal (minimal) members of the down set (up set) which are also contained in the given subset. This produces a slice subposet, hence the name of the class.

Definition at line 45 of file poset_slicer.h.

Member Enumeration Documentation

◆ slice_mode

Include only maximal, minimal, or all members in slice.

Definition at line 57 of file poset_slicer.h.

Constructor & Destructor Documentation

◆ poset_slicer()

sheaf::poset_slicer::poset_slicer ( const poset_state_handle xhost)

Constructor.

Precondition
  • xhost != 0
Postcondition

Definition at line 86 of file poset_slicer.cc.

References invariant(), and ~poset_slicer().

Referenced by invariant().

◆ ~poset_slicer()

sheaf::poset_slicer::~poset_slicer ( )

Destructor.

Definition at line 109 of file poset_slicer.cc.

References find().

Referenced by poset_slicer().

Member Function Documentation

◆ down_set() [1/2]

sheaf::subposet * sheaf::poset_slicer::down_set ( abstract_poset_member xanchor,
slice_mode  xmode = ALL 
)

find the down set of the poset member xanchor, auto-allocated

Precondition
  • has_same_host(xanchor)
Postcondition
  • has_same_host(result)
  • -unexecutable( result is xmode members of down set of xanchor )

Definition at line 432 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, down_set_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

Referenced by find_jims_pa(), and up_set_pa().

◆ down_set() [2/2]

sheaf::subposet * sheaf::poset_slicer::down_set ( const subposet xanchor,
slice_mode  xmode = ALL 
)

find the down set of subposet xanchor, auto-allocated

Precondition
  • has_same_host(xanchor)
Postcondition
  • -unexecutable( result is xmode members of down set of xanchor )

Definition at line 543 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, down_set_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

◆ down_set_pa() [1/2]

void sheaf::poset_slicer::down_set_pa ( abstract_poset_member xanchor,
subposet result,
slice_mode  xmode = ALL 
)

find the down set of the poset member xanchor, pre-allocated

Precondition
  • has_same_host(xanchor)
  • has_same_host(result)
Postcondition
  • -unexecutable( result is union(xmode members of down set of xanchor, old result) )

Definition at line 461 of file poset_slicer.cc.

References find_pa(), sheaf::poset_traverser::has_same_host(), invariant(), and up_set().

Referenced by sheaf::abstract_poset_member::down_pa(), and down_set().

◆ down_set_pa() [2/2]

void sheaf::poset_slicer::down_set_pa ( const subposet xanchor,
subposet result,
slice_mode  xmode = ALL 
)

find the down set of subposet xanchor, pre-allocated

Precondition
  • has_same_host(xanchor)
  • has_same_host(result)
  • !xanchor->is_same_state(result)
Postcondition
  • -unexecutable( result is xmode members of union(down set of xanchor, old result) )

Definition at line 571 of file poset_slicer.cc.

References sheaf::poset_traverser::has_same_host(), invariant(), sheaf::poset_component::is_same_state(), and up_set().

◆ find() [1/2]

sheaf::subposet * sheaf::poset_slicer::find ( abstract_poset_member xanchor,
subposet xlayer,
bool  xdown,
slice_mode  xmode = ALL 
)

Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), auto-allocated.

Precondition
  • has_same_host(xanchor)
  • has_same_host(xlayer)
Postcondition
  • has_same_host(result)
  • -unexecutable( result is intersection(xmode members of xdown set of xanchor, xlayer) )

Definition at line 124 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, find_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

Referenced by find_pa(), and ~poset_slicer().

◆ find() [2/2]

sheaf::subposet * sheaf::poset_slicer::find ( subposet xanchor,
subposet xlayer,
bool  xdown,
slice_mode  xmode = ALL 
)

Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), auto-allocated.

Precondition
  • has_same_host(xanchor)
  • has_same_host(xlayer)
Postcondition
  • has_same_host(result)
  • -unexecutable( result is intersection(xmode memberss of xdown set of xanchor, xlayer) )

Definition at line 195 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, find_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

◆ find_jims() [1/2]

sheaf::subposet * sheaf::poset_slicer::find_jims ( abstract_poset_member xanchor,
slice_mode  xmode = ALL 
)

Find jims in the down set of the poset member xanchor, auto-allocated.

Precondition
  • has_same_host(xanchor)
Postcondition
  • has_same_host(result)
  • -unexecutable( result is xmode jims of xanchor )

Definition at line 287 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, find_jims_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

Referenced by find_jims_pa(), and find_pa().

◆ find_jims() [2/2]

sheaf::subposet * sheaf::poset_slicer::find_jims ( const subposet xanchor,
slice_mode  xmode = ALL 
)

Find jims in the down set of the subposet xsp, auto-allocated.

Precondition
  • has_same_host(xanchor)
Postcondition
  • -unexecutable( result is xmode jims of xanchor )

Definition at line 343 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, find_jims_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

◆ find_jims_pa() [1/2]

void sheaf::poset_slicer::find_jims_pa ( abstract_poset_member xanchor,
subposet result,
slice_mode  xmode = ALL 
)

Find jims in the down set of the poset member xanchor, pre-allocated.

Precondition
  • has_same_host(xanchor)
  • has_same_host(result)
Postcondition
  • -unexecutable( result is xmode members of union(jims of xanchor, old result) )

Definition at line 315 of file poset_slicer.cc.

References find_jims(), find_pa(), sheaf::poset_traverser::has_same_host(), sheaf::poset_traverser::host(), invariant(), and sheaf::poset_state_handle::jims().

Referenced by find_jims(), sheaf::abstract_poset_member::jims_pa(), and sheaf::abstract_poset_member::maximal_jims_pa().

◆ find_jims_pa() [2/2]

void sheaf::poset_slicer::find_jims_pa ( const subposet xanchor,
subposet result,
slice_mode  xmode = ALL 
)

◆ find_pa() [1/2]

void sheaf::poset_slicer::find_pa ( abstract_poset_member xanchor,
subposet xlayer,
bool  xdown,
subposet result,
slice_mode  xmode = ALL 
)

Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), pre-allocated.

Precondition
  • has_same_host(xanchor)
  • xlayer != 0 ? has_same_host(xlayer) : true
  • has_same_host(result)
Postcondition
  • -unexecutable( result is xmode members of union(intersection(xdown set of xanchor, xlayer), old result) )

Definition at line 154 of file poset_slicer.cc.

References find(), sheaf::poset_traverser::has_same_host(), invariant(), and sheaf::poset_traverser::traverse().

Referenced by down_set_pa(), find(), find_jims_pa(), sheaf::abstract_poset_member::l_not_pa(), and up_set_pa().

◆ find_pa() [2/2]

void sheaf::poset_slicer::find_pa ( const subposet xanchor,
subposet xlayer,
bool  xdown,
subposet result,
slice_mode  xmode = ALL 
)

Finds the intersection of the down set (up set) of xanchor with xlayer if xdown (!xdown), pre-allocated.

Precondition
  • has_same_host(xanchor)
  • xlayer != 0 ? has_same_host(xlayer) : true
  • has_same_host(result)
  • !xanchor->is_same_state(result)
Postcondition
  • -unexecutable( result is xmode members of union(intersection(xdown set of xanchor, xlayer), old result) )

Definition at line 225 of file poset_slicer.cc.

References sheaf::poset_traverser::_anchor, sheaf::poset_traverser::_in_down_set, find_jims(), sheaf::poset_traverser::has_been_visited(), sheaf::poset_traverser::has_same_host(), invariant(), sheaf::poset_member_iterator::is_done(), sheaf::poset_component::is_same_state(), sheaf::poset_traverser::mark_members_not_visited(), sheaf::subposet::member_iterator(), sheaf::poset_member_iterator::next(), and sheaf::poset_traverser::traverse().

◆ invariant()

◆ up_set() [1/2]

sheaf::subposet * sheaf::poset_slicer::up_set ( abstract_poset_member xanchor,
slice_mode  xmode = ALL 
)

find the up set of the poset member xanchor, auto-allocated

Precondition
  • has_same_host(xanchor)
Postcondition
  • has_same_host(result)
  • -unexecutable( result is xmode members of up set of xanchor )

Definition at line 487 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, sheaf::poset_traverser::has_same_host(), invariant(), and up_set_pa().

Referenced by down_set_pa().

◆ up_set() [2/2]

sheaf::subposet * sheaf::poset_slicer::up_set ( const subposet xanchor,
slice_mode  xmode = ALL 
)

find the up set of subposet xanchor, auto-allocated

Precondition
  • has_same_host(xanchor)
Postcondition
  • -unexecutable( result is xmode members of up set of xanchor )

Definition at line 598 of file poset_slicer.cc.

References sheaf::poset_traverser::_host, sheaf::poset_traverser::has_same_host(), invariant(), and up_set_pa().

◆ up_set_pa() [1/2]

void sheaf::poset_slicer::up_set_pa ( abstract_poset_member xanchor,
subposet result,
slice_mode  xmode = ALL 
)

find the up set of the poset member xanchor, pre-allocated

Precondition
  • has_same_host(xanchor)
  • has_same_host(result)
Postcondition
  • -unexecutable( result is xmode members of union(up set of xanchor, old result) )

Definition at line 516 of file poset_slicer.cc.

References down_set(), find_pa(), sheaf::poset_traverser::has_same_host(), and invariant().

Referenced by up_set().

◆ up_set_pa() [2/2]


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