SheafSystem
0.0.0.0
|
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Zn. More...
#include <zn_to_bool.h>
Public Types | |
enum | static_const_int { BITS_PER_WORD = std::numeric_limits<word_t>::digits } |
Number of bits per word. More... | |
typedef unsigned int | word_t |
The type of the private, internal representation used for bits; Unsigned int is the type used in the interface to exchange bits with the public. Currently the two types are the same. More... | |
Public Member Functions | |
bool | invariant () const |
Class Invariant. More... | |
zn_to_bool () | |
Default constructor. More... | |
zn_to_bool (const zn_to_bool &xother) | |
Copy constructor. More... | |
zn_to_bool (int xub, bool xinitialize=true) | |
Create an instance with ub() = xub; if xinitialize, initialize so is_false() = true. More... | |
zn_to_bool (int xub, unsigned *values) | |
Create an instance with ub() = xub, initialized with bits from `values'. [j] is true if the bit at offset j from address `values' is 1 and false otherwise. More... | |
~zn_to_bool () | |
Destructor. More... | |
bool | domain_is_valid () const |
True if domain properly allocated. More... | |
int | ub () const |
The upper bound for the domain index. More... | |
bool | index_in_bounds (int i) const |
True if index i is in bounds for this vector. More... | |
bool | index_in_bounds (const block< int > *indices) const |
True if for all i in indices: i is in bounds for this vector. More... | |
int | ct () const |
The number of members in the domain. More... | |
int | true_ct () const |
The number of members with value = true. More... | |
int | false_ct () const |
The number of members with value = false. More... | |
void | extend_to (int xub) |
Make the upper bound at least xub. More... | |
size_t | capacity () const |
The number of members this can extend_to() without reallocating. More... | |
bool | operator[] (int i) const |
Value at i. More... | |
bool | is_true_for (const block< int > *indices) const |
True if for all i in indices: member with index i is true. More... | |
bool | is_false_for (const block< int > *indices) const |
True if for all i in indices: member with index i is false. More... | |
void | put (int i, bool value) |
Sets i-th member to value. More... | |
void | put (const block< int > *indices, bool value) |
For all i in indices: sets i-th member to value. More... | |
void | force (int i, bool value) |
Sets the i-th member to value, extends the upper bound if necessary. More... | |
void | put_not (int i) |
Sets i-th member to its complement. More... | |
void | put_not (const block< int > *indices) |
For all i in indices: sets i-th member to its complement. More... | |
bool | is_true () const |
True function is true everywhere on domain. More... | |
bool | is_false () const |
True if function is false evrywhere on domain. More... | |
bool | is_equal_to (const zn_to_bool *other) const |
OBSOLETE: use operator==(const zn_to_bool&). True if function is equal to other evrywhere on domain. More... | |
bool | operator== (const zn_to_bool &other) const |
True if function is equal to other evrywhere on domain. More... | |
bool | includes (const zn_to_bool *other) const |
True if this function is true everywhere other is true. More... | |
bool | is_not (const zn_to_bool *other) const |
True if function is complement of other evrywhere on domain. More... | |
zn_to_bool * | make_true () |
Constant function true, auto-allocated. More... | |
void | make_true_sa () |
Constant function true, self-allocated. Note on terminology: "true" is a keyword, so this function can not be just "true" More... | |
zn_to_bool * | make_false () |
Constant function false, auto-allocated. Note on terminology: "false" is a keyword, so this function can not be just "false" More... | |
void | make_false_sa () |
Constant function false, self-allocated. Note on terminology: "false" is a keyword, so this function can not be just "false" More... | |
zn_to_bool * | equal () |
OBSOLETE; use copy contructor. More... | |
void | equal_pa (const zn_to_bool *result) |
OBSOLETE; use assignment operator. More... | |
zn_to_bool & | operator= (const zn_to_bool &xother) |
Assignment operator. More... | |
zn_to_bool * | b_not () |
Boolean complement, auto-allocated. More... | |
void | b_not_pa (const zn_to_bool *other) |
Boolean complement, pre-allocated. More... | |
void | b_not_sa () |
Boolean complement, self-allocated. More... | |
zn_to_bool * | b_and (const zn_to_bool *other) |
This AND other, auto-allocated. More... | |
void | b_and_pa (const zn_to_bool *other, zn_to_bool *result) |
This AND other, pre-allocated. More... | |
void | b_and_sa (const zn_to_bool *other) |
This AND other, self-allocated. More... | |
zn_to_bool * | b_or (const zn_to_bool *other) |
This OR other, auto-allocated. More... | |
void | b_or_pa (const zn_to_bool *other, zn_to_bool *result) |
This OR other, pre-allocated. More... | |
void | b_or_sa (const zn_to_bool *other) |
This OR other, self-allocated. More... | |
zn_to_bool * | b_and_not (const zn_to_bool *other) |
This AND NOT other, auto-allocated. More... | |
void | b_and_not_pa (const zn_to_bool *other, zn_to_bool *result) |
This AND NOT other, pre-allocated. More... | |
void | b_and_not_sa (const zn_to_bool *other) |
This AND NOT other, self-allocated. More... | |
Friends | |
class | index_iterator |
class | subposet |
SHEAF_DLL_SPEC std::ostream & | operator<< (std::ostream &os, zn_to_bool &zn) |
Insert zn_to_bool& zn into ostream& os. More... | |
SHEAF_DLL_SPEC size_t | deep_size (const zn_to_bool &zn, bool xinclude_shallow) |
The deep size of the referenced object of type zn_to_bool. More... | |
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Zn.
Definition at line 52 of file zn_to_bool.h.
typedef unsigned int sheaf::zn_to_bool::word_t |
The type of the private, internal representation used for bits; Unsigned int is the type used in the interface to exchange bits with the public. Currently the two types are the same.
Definition at line 160 of file zn_to_bool.h.
Number of bits per word.
Definition at line 167 of file zn_to_bool.h.
sheaf::zn_to_bool::zn_to_bool | ( | ) |
Default constructor.
Definition at line 53 of file zn_to_bool.cc.
Referenced by invariant(), and zn_to_bool().
sheaf::zn_to_bool::zn_to_bool | ( | const zn_to_bool & | xother | ) |
Copy constructor.
Definition at line 77 of file zn_to_bool.cc.
References zn_to_bool().
sheaf::zn_to_bool::zn_to_bool | ( | int | xub, |
bool | xinitialize = true |
||
) |
Create an instance with ub() = xub; if xinitialize, initialize so is_false() = true.
Definition at line 109 of file zn_to_bool.cc.
References zn_to_bool().
sheaf::zn_to_bool::zn_to_bool | ( | int | xub, |
unsigned * | values | ||
) |
Create an instance with ub() = xub, initialized with bits from `values'. [j] is true if the bit at offset j from address `values' is 1 and false otherwise.
Definition at line 141 of file zn_to_bool.cc.
References ~zn_to_bool().
sheaf::zn_to_bool::~zn_to_bool | ( | ) |
Destructor.
Definition at line 174 of file zn_to_bool.cc.
References domain_is_valid().
Referenced by zn_to_bool().
sheaf::zn_to_bool * sheaf::zn_to_bool::b_and | ( | const zn_to_bool * | other | ) |
This AND other, auto-allocated.
Definition at line 1128 of file zn_to_bool.cc.
References b_and_pa(), invariant(), and ub().
Referenced by b_not_sa().
sheaf::zn_to_bool * sheaf::zn_to_bool::b_and_not | ( | const zn_to_bool * | other | ) |
This AND NOT other, auto-allocated.
Definition at line 1276 of file zn_to_bool.cc.
References b_and_not_pa(), invariant(), and ub().
Referenced by b_or_sa().
void sheaf::zn_to_bool::b_and_not_pa | ( | const zn_to_bool * | other, |
zn_to_bool * | result | ||
) |
This AND NOT other, pre-allocated.
Definition at line 1303 of file zn_to_bool.cc.
References b_and_not_sa(), and ub().
Referenced by b_and_not().
void sheaf::zn_to_bool::b_and_not_sa | ( | const zn_to_bool * | other | ) |
This AND NOT other, self-allocated.
Definition at line 1329 of file zn_to_bool.cc.
References ub().
Referenced by b_and_not_pa().
void sheaf::zn_to_bool::b_and_pa | ( | const zn_to_bool * | other, |
zn_to_bool * | result | ||
) |
This AND other, pre-allocated.
Definition at line 1155 of file zn_to_bool.cc.
References b_and_sa(), and ub().
Referenced by b_and().
void sheaf::zn_to_bool::b_and_sa | ( | const zn_to_bool * | other | ) |
This AND other, self-allocated.
Definition at line 1181 of file zn_to_bool.cc.
Referenced by b_and_pa(), sheaf::subposet_member_iterator::initialize_filter(), and sheaf::depth_first_iterator::initialize_filter().
sheaf::zn_to_bool * sheaf::zn_to_bool::b_not | ( | ) |
Boolean complement, auto-allocated.
Definition at line 1060 of file zn_to_bool.cc.
References b_not_pa(), and invariant().
Referenced by operator=().
void sheaf::zn_to_bool::b_not_pa | ( | const zn_to_bool * | other | ) |
Boolean complement, pre-allocated.
Definition at line 1087 of file zn_to_bool.cc.
References b_not_sa().
Referenced by b_not().
void sheaf::zn_to_bool::b_not_sa | ( | ) |
Boolean complement, self-allocated.
Definition at line 1108 of file zn_to_bool.cc.
References b_and().
Referenced by b_not_pa().
sheaf::zn_to_bool * sheaf::zn_to_bool::b_or | ( | const zn_to_bool * | other | ) |
This OR other, auto-allocated.
Definition at line 1202 of file zn_to_bool.cc.
References b_or_pa(), invariant(), and ub().
Referenced by b_and_sa().
void sheaf::zn_to_bool::b_or_pa | ( | const zn_to_bool * | other, |
zn_to_bool * | result | ||
) |
void sheaf::zn_to_bool::b_or_sa | ( | const zn_to_bool * | other | ) |
This OR other, self-allocated.
Definition at line 1255 of file zn_to_bool.cc.
References b_and_not(), and ub().
Referenced by b_or_pa().
size_t sheaf::zn_to_bool::capacity | ( | ) | const |
The number of members this can extend_to() without reallocating.
Definition at line 450 of file zn_to_bool.cc.
References is_true_for().
Referenced by extend_to().
int sheaf::zn_to_bool::ct | ( | ) | const |
The number of members in the domain.
Definition at line 287 of file zn_to_bool.cc.
References true_ct().
Referenced by index_in_bounds().
bool sheaf::zn_to_bool::domain_is_valid | ( | ) | const |
True if domain properly allocated.
Definition at line 192 of file zn_to_bool.cc.
References ub().
Referenced by ~zn_to_bool().
sheaf::zn_to_bool * sheaf::zn_to_bool::equal | ( | ) |
OBSOLETE; use copy contructor.
Definition at line 978 of file zn_to_bool.cc.
References equal_pa(), and invariant().
Referenced by make_false_sa().
void sheaf::zn_to_bool::equal_pa | ( | const zn_to_bool * | result | ) |
OBSOLETE; use assignment operator.
Definition at line 1005 of file zn_to_bool.cc.
References operator=().
Referenced by equal(), sheaf::subposet::make_equal_to(), and sheaf::subposet::subposet().
void sheaf::zn_to_bool::extend_to | ( | int | xub | ) |
Make the upper bound at least xub.
Definition at line 362 of file zn_to_bool.cc.
References capacity().
Referenced by sheaf::poset_traverser::ensure_visited_ub(), false_ct(), fields::field_refinement_buffer::push_prop_dofs(), fields::field_refinement_buffer::refine_prop_dofs(), sheaf::depth_first_iterator::reset(), and fields::field_eval_iterator::update_capacity().
int sheaf::zn_to_bool::false_ct | ( | ) | const |
The number of members with value = false.
Definition at line 346 of file zn_to_bool.cc.
References extend_to().
Referenced by true_ct().
void sheaf::zn_to_bool::force | ( | int | i, |
bool | value | ||
) |
Sets the i-th member to value, extends the upper bound if necessary.
Definition at line 607 of file zn_to_bool.cc.
References put_not().
Referenced by sheaf::schema_poset_member::bound_iterator(), sheaf::poset_state_handle::bound_iterator(), fiber_bundle::binary_section_space_schema_member::get_decomposition(), fiber_bundle::product_section_space_schema_member::get_decomposition(), sheaf::poset_traverser::mark_not_visited(), sheaf::poset_traverser::mark_visited(), and put().
bool sheaf::zn_to_bool::includes | ( | const zn_to_bool * | other | ) | const |
True if this function is true everywhere other is true.
Definition at line 821 of file zn_to_bool.cc.
References is_not(), and ub().
Referenced by operator==().
bool sheaf::zn_to_bool::index_in_bounds | ( | int | i | ) | const |
True if index i is in bounds for this vector.
Definition at line 233 of file zn_to_bool.cc.
Referenced by sheaf::subposet::contains_member(), and ub().
bool sheaf::zn_to_bool::index_in_bounds | ( | const block< int > * | indices | ) | const |
True if for all i in indices: i is in bounds for this vector.
Definition at line 257 of file zn_to_bool.cc.
References ct().
bool sheaf::zn_to_bool::invariant | ( | ) | const |
Class Invariant.
Definition at line 36 of file zn_to_bool.cc.
References zn_to_bool().
Referenced by b_and(), b_and_not(), b_not(), b_or(), equal(), make_false(), and make_true().
bool sheaf::zn_to_bool::is_equal_to | ( | const zn_to_bool * | other | ) | const |
OBSOLETE: use operator==(const zn_to_bool&). True if function is equal to other evrywhere on domain.
Definition at line 763 of file zn_to_bool.cc.
References operator==(), and ub().
Referenced by is_false().
bool sheaf::zn_to_bool::is_false | ( | ) | const |
True if function is false evrywhere on domain.
Definition at line 735 of file zn_to_bool.cc.
References is_equal_to().
Referenced by is_true(), make_false(), and sheaf::poset_traverser::no_members_visited().
bool sheaf::zn_to_bool::is_false_for | ( | const block< int > * | indices | ) | const |
True if for all i in indices: member with index i is false.
Definition at line 507 of file zn_to_bool.cc.
References put().
Referenced by is_true_for().
bool sheaf::zn_to_bool::is_not | ( | const zn_to_bool * | other | ) | const |
True if function is complement of other evrywhere on domain.
Definition at line 852 of file zn_to_bool.cc.
References make_true(), and ub().
Referenced by includes().
bool sheaf::zn_to_bool::is_true | ( | ) | const |
True function is true everywhere on domain.
Definition at line 707 of file zn_to_bool.cc.
References is_false().
Referenced by make_true(), and put_not().
bool sheaf::zn_to_bool::is_true_for | ( | const block< int > * | indices | ) | const |
True if for all i in indices: member with index i is true.
Definition at line 477 of file zn_to_bool.cc.
References is_false_for().
Referenced by capacity().
sheaf::zn_to_bool * sheaf::zn_to_bool::make_false | ( | ) |
Constant function false, auto-allocated.
Note on terminology: "false" is a keyword, so this function can not be just "false"
Definition at line 930 of file zn_to_bool.cc.
References invariant(), is_false(), and make_false_sa().
Referenced by make_true_sa(), and fields::field_eval_iterator::reset().
void sheaf::zn_to_bool::make_false_sa | ( | ) |
Constant function false, self-allocated.
Note on terminology: "false" is a keyword, so this function can not be just "false"
Definition at line 955 of file zn_to_bool.cc.
References equal().
Referenced by make_false(), sheaf::poset_traverser::mark_members_not_visited(), and sheaf::depth_first_iterator::reset().
sheaf::zn_to_bool * sheaf::zn_to_bool::make_true | ( | ) |
Constant function true, auto-allocated.
Definition at line 880 of file zn_to_bool.cc.
References invariant(), is_true(), and make_true_sa().
Referenced by is_not().
void sheaf::zn_to_bool::make_true_sa | ( | ) |
Constant function true, self-allocated.
Note on terminology: "true" is a keyword, so this function can not be just "true"
Definition at line 907 of file zn_to_bool.cc.
References make_false().
Referenced by make_true().
sheaf::zn_to_bool & sheaf::zn_to_bool::operator= | ( | const zn_to_bool & | xother | ) |
Assignment operator.
Definition at line 1028 of file zn_to_bool.cc.
References b_not().
Referenced by equal_pa().
bool sheaf::zn_to_bool::operator== | ( | const zn_to_bool & | other | ) | const |
True if function is equal to other evrywhere on domain.
Definition at line 791 of file zn_to_bool.cc.
References includes(), and ub().
Referenced by is_equal_to().
|
inline |
Value at i.
Definition at line 217 of file zn_to_bool.h.
References sheaf::operator==().
void sheaf::zn_to_bool::put | ( | int | i, |
bool | value | ||
) |
Sets i-th member to value.
Definition at line 537 of file zn_to_bool.cc.
Referenced by sheaf::member_member_poset_bounds::attach_to_state(), sheaf::namespace_poset::clear(), sheaf::dof_tuple_record_set::externalize(), sheaf::dof_tuple_record_set::externalize_domain(), fields::field_refinement_buffer::field_refinement_buffer(), sheaf::dof_tuple_record_set::get_internal_record(), is_false_for(), fiber_bundle::discretization_iterator::next(), fields::field_eval_iterator::next(), fields::field_refinement_buffer::push_prop_dofs(), sheaf::depth_first_iterator::put_has_visited(), fields::field_refinement_buffer::refine_prop_dofs(), and fields::field_eval_iterator::reset().
void sheaf::zn_to_bool::put | ( | const block< int > * | indices, |
bool | value | ||
) |
For all i in indices: sets i-th member to value.
Definition at line 570 of file zn_to_bool.cc.
References sheaf::auto_block< T, S >::ct(), and force().
void sheaf::zn_to_bool::put_not | ( | int | i | ) |
Sets i-th member to its complement.
Definition at line 639 of file zn_to_bool.cc.
Referenced by force().
void sheaf::zn_to_bool::put_not | ( | const block< int > * | indices | ) |
For all i in indices: sets i-th member to its complement.
Definition at line 670 of file zn_to_bool.cc.
References sheaf::auto_block< T, S >::ct(), and is_true().
int sheaf::zn_to_bool::true_ct | ( | ) | const |
The number of members with value = true.
Definition at line 306 of file zn_to_bool.cc.
References false_ct().
Referenced by ct().
int sheaf::zn_to_bool::ub | ( | ) | const |
The upper bound for the domain index.
Definition at line 214 of file zn_to_bool.cc.
References index_in_bounds().
Referenced by b_and(), b_and_not(), b_and_not_pa(), b_and_not_sa(), b_and_pa(), b_and_sa(), b_or(), b_or_pa(), b_or_sa(), domain_is_valid(), fields::field_eval_iterator::enough_capacity(), sheaf::poset_traverser::ensure_visited_ub(), includes(), sheaf::poset_traverser::invariant(), is_equal_to(), is_not(), sheaf::operator<<(), and operator==().
|
friend |
The deep size of the referenced object of type zn_to_bool.
|
friend |
Insert zn_to_bool& zn into ostream& os.