SheafSystem
0.0.0.0
|
Iterates over the subset of Zn defined by the characteristic function host(). More...
#include <index_iterator.h>
Public Member Functions | |
index_iterator () | |
Creates an instance with host() == 0. More... | |
index_iterator (const zn_to_bool *xhost, const index_space_handle &xid_space, bool xdelete_host=false) | |
Create an instance with host() == xhost and index.scope() == xid_space; if xdelete_host, delete host() when this is deleted. More... | |
virtual | ~index_iterator () |
Destructor; not virtual so this class should not be used as a base class. More... | |
const zn_to_bool * | host () const |
The subset this is iterating over. More... | |
int | item () |
OBSOLETE: use index(). The current item in the subset. More... | |
const scoped_index & | index () const |
The current item in the subset. More... | |
bool | is_done () const |
True if iteration finished. More... | |
bool | is_last () const |
True if iteration finished after next call to next() More... | |
void | next () |
Makes item the next member of the subset. More... | |
void | reset () |
Restarts the iteration, makes item the first member of the subset. More... | |
virtual void | reset (const zn_to_bool *xhost, const index_space_handle &xid_space, bool xdelete_host=false) |
Restarts the iteration on host xhost. More... | |
Protected Member Functions | |
void | find_next_item () |
Finds the next item in the iteration. More... | |
Protected Attributes | |
const zn_to_bool * | _host |
The subset this is iterating over. More... | |
bool | _delete_host |
True if _host should be deleted when this is deleted. More... | |
int | _word_index |
The index of the word containing the current bit. More... | |
int | _word_ub |
The upper bound for the word index. More... | |
unsigned int | _word |
The current word. More... | |
int | _bit_index |
The index of the current bit. More... | |
int | _bit_ub |
The upper bound on the bit index. More... | |
int | _item |
The current item in the iteration. More... | |
int | _next_item |
The next item in the iteration. More... | |
int | _item_ub |
The upper bound in item. More... | |
scoped_index | _index |
The current index in the iteration. More... | |
Iterates over the subset of Zn defined by the characteristic function host().
Definition at line 39 of file index_iterator.h.
sheaf::index_iterator::index_iterator | ( | ) |
Creates an instance with host() == 0.
Definition at line 29 of file index_iterator.cc.
References _bit_index, _bit_ub, _delete_host, _host, _item, _item_ub, _next_item, _word, _word_index, _word_ub, and is_done().
sheaf::index_iterator::index_iterator | ( | const zn_to_bool * | xhost, |
const index_space_handle & | xid_space, | ||
bool | xdelete_host = false |
||
) |
Create an instance with host() == xhost and index.scope() == xid_space; if xdelete_host, delete host() when this is deleted.
Definition at line 59 of file index_iterator.cc.
References reset(), and ~index_iterator().
|
virtual |
Destructor; not virtual so this class should not be used as a base class.
Definition at line 78 of file index_iterator.cc.
References _delete_host, _host, and host().
Referenced by index_iterator().
|
inlineprotected |
Finds the next item in the iteration.
Definition at line 220 of file index_iterator.cc.
References _bit_index, _bit_ub, _item_ub, _next_item, _word_index, _word_ub, host(), is_done(), and next().
const sheaf::zn_to_bool * sheaf::index_iterator::host | ( | ) | const |
The subset this is iterating over.
Definition at line 108 of file index_iterator.cc.
Referenced by find_next_item(), index(), item(), next(), reset(), and ~index_iterator().
const sheaf::scoped_index & sheaf::index_iterator::index | ( | ) | const |
The current item in the subset.
Definition at line 141 of file index_iterator.cc.
References _index, _item, host(), and is_done().
Referenced by sheaf::poset_traverser::all_members_visited(), sheaf::storage_agent::begin_read_transaction(), sheaf::namespace_poset::clear(), sheaf::storage_agent::commit_transaction(), sheaf::dof_tuple_record_set::compute_ext_id(), sheaf::poset_state_handle::ensure_lattice_invariant(), sheaf::dof_tuple_record_set::externalize(), sheaf::subposet::extremals_pa(), fiber_bundle::binary_section_space_schema_member::get_decomposition(), fiber_bundle::product_section_space_schema_member::get_decomposition(), sheaf::poset_state_handle::initialize_dof_id_space(), sheaf::int_set::insert_members(), item(), sheaf::poset_joiner::join(), sheaf::member_record_set::make_internal_dataspace(), sheaf::subposet_member_iterator::next(), fields::body_pusher::push_pa(), sheaf::dof_tuple_record_set::read_records(), and sheaf::subposet_member_iterator::reset().
bool sheaf::index_iterator::is_done | ( | ) | const |
True if iteration finished.
Definition at line 169 of file index_iterator.cc.
References _item, _item_ub, and is_last().
Referenced by sheaf::poset_traverser::all_members_visited(), sheaf::storage_agent::begin_read_transaction(), sheaf::namespace_poset::clear(), sheaf::storage_agent::commit_transaction(), sheaf::dof_tuple_record_set::compute_ext_id(), sheaf::poset_state_handle::ensure_lattice_invariant(), sheaf::dof_tuple_record_set::externalize(), sheaf::subposet::extremals_pa(), find_next_item(), fiber_bundle::binary_section_space_schema_member::get_decomposition(), fiber_bundle::product_section_space_schema_member::get_decomposition(), index(), index_iterator(), sheaf::poset_state_handle::initialize_dof_id_space(), sheaf::int_set::insert_members(), sheaf::subposet_member_iterator::is_done(), is_last(), item(), sheaf::poset_joiner::join(), sheaf::member_record_set::make_internal_dataspace(), sheaf::subposet_member_iterator::next(), next(), fields::body_pusher::push_pa(), sheaf::dof_tuple_record_set::read_records(), sheaf::subposet_member_iterator::reset(), and reset().
bool sheaf::index_iterator::is_last | ( | ) | const |
True if iteration finished after next call to next()
Definition at line 197 of file index_iterator.cc.
References _item, _item_ub, _next_item, find_next_item(), is_done(), and next().
Referenced by is_done(), and sheaf::subposet_member_iterator::is_last().
int sheaf::index_iterator::item | ( | ) |
OBSOLETE: use index(). The current item in the subset.
Definition at line 116 of file index_iterator.cc.
References _item, host(), index(), and is_done().
Referenced by sheaf::dof_tuple_record_set::compute_ext_id(), host(), next(), and reset().
void sheaf::index_iterator::next | ( | ) |
Makes item the next member of the subset.
Definition at line 265 of file index_iterator.cc.
References _item, _item_ub, _next_item, find_next_item(), host(), is_done(), item(), and reset().
Referenced by sheaf::poset_traverser::all_members_visited(), sheaf::storage_agent::begin_read_transaction(), sheaf::namespace_poset::clear(), sheaf::storage_agent::commit_transaction(), sheaf::dof_tuple_record_set::compute_ext_id(), sheaf::poset_state_handle::ensure_lattice_invariant(), sheaf::dof_tuple_record_set::externalize(), sheaf::subposet::extremals_pa(), find_next_item(), fiber_bundle::binary_section_space_schema_member::get_decomposition(), fiber_bundle::product_section_space_schema_member::get_decomposition(), sheaf::poset_state_handle::initialize_dof_id_space(), sheaf::int_set::insert_members(), is_last(), sheaf::poset_joiner::join(), sheaf::member_record_set::make_internal_dataspace(), sheaf::subposet_member_iterator::next(), fields::body_pusher::push_pa(), sheaf::dof_tuple_record_set::read_records(), and reset().
void sheaf::index_iterator::reset | ( | ) |
Restarts the iteration, makes item the first member of the subset.
Definition at line 292 of file index_iterator.cc.
References _bit_index, _bit_ub, _item, _next_item, _word_index, find_next_item(), host(), is_done(), item(), and next().
Referenced by sheaf::namespace_poset::clear(), index_iterator(), next(), sheaf::subposet_member_iterator::reset(), and reset().
|
virtual |
Restarts the iteration on host xhost.
Definition at line 322 of file index_iterator.cc.
References _bit_ub, _delete_host, _host, _index, _item, _item_ub, _word_ub, host(), is_done(), sheaf::scoped_index::put_scope(), and reset().
|
protected |
The index of the current bit.
Definition at line 131 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), and reset().
|
protected |
The upper bound on the bit index.
Definition at line 136 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), and reset().
|
protected |
True if _host should be deleted when this is deleted.
Definition at line 111 of file index_iterator.h.
Referenced by index_iterator(), reset(), and ~index_iterator().
|
protected |
The subset this is iterating over.
Definition at line 106 of file index_iterator.h.
Referenced by host(), index_iterator(), reset(), and ~index_iterator().
|
mutableprotected |
The current index in the iteration.
Definition at line 161 of file index_iterator.h.
|
protected |
The current item in the iteration.
Definition at line 141 of file index_iterator.h.
Referenced by index(), index_iterator(), is_done(), is_last(), item(), next(), and reset().
|
protected |
The upper bound in item.
Definition at line 151 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), is_done(), is_last(), next(), and reset().
|
protected |
The next item in the iteration.
Definition at line 146 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), is_last(), next(), and reset().
|
protected |
|
protected |
The index of the word containing the current bit.
Definition at line 116 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), and reset().
|
protected |
The upper bound for the word index.
Definition at line 121 of file index_iterator.h.
Referenced by find_next_item(), index_iterator(), and reset().