glucat 0.12.0
|
Index set class based on std::bitset<> in Gnu standard C++ library. More...
#include <index_set.h>
Classes | |
class | reference |
Index set member reference. More... | |
Public Types | |
using | index_set_t = index_set |
using | index_pair_t = std::pair<index_t, index_t> |
Public Member Functions | |
index_set ()=default | |
Default constructor creates an empty set. | |
index_set (const bitset_t bst) | |
Constructor from bitset_t. | |
index_set (const index_t idx) | |
Constructor from index. | |
index_set (const set_value_t folded_val, const index_set_t frm, const bool prechecked=false) | |
Constructor from set value of an index set folded within the given frame. | |
index_set (const index_pair_t &range, const bool prechecked=false) | |
Constructor from range of indices from range.first to range.second. | |
index_set (const std::string &str) | |
Constructor from string. | |
auto | operator== (const index_set_t rhs) const -> bool |
Equality. | |
auto | operator!= (const index_set_t rhs) const -> bool |
Inequality. | |
auto | operator~ () const -> index_set_t |
Set complement: not. | |
auto | operator^= (const index_set_t rhs) -> index_set_t & |
Symmetric set difference: exclusive or. | |
auto | operator&= (const index_set_t rhs) -> index_set_t & |
Set intersection: and. | |
auto | operator|= (const index_set_t rhs) -> index_set_t & |
Set union: or. | |
auto | operator[] (const index_t idx) const -> bool |
Subscripting: Test idx for membership: test value of bit idx. | |
auto | test (const index_t idx) const -> bool |
Test idx for membership: test value of bit idx. | |
auto | set () -> index_set_t & |
Include all indices except 0: set all bits except 0. | |
auto | set (const index_t idx) -> index_set_t & |
Include idx: Set bit at idx if idx != 0. | |
auto | set (const index_t idx, const int val) -> index_set_t & |
Set membership of idx to val if idx != 0: Set bit at idx to val if idx != 0. | |
auto | reset () -> index_set_t & |
Make set empty: Set all bits to 0. | |
auto | reset (const index_t idx) -> index_set_t & |
Exclude idx: Set bit at idx to 0. | |
auto | flip () -> index_set_t & |
Set complement, except 0: flip all bits, except 0. | |
auto | flip (const index_t idx) -> index_set_t & |
Complement membership of idx if idx != 0: flip bit at idx if idx != 0. | |
auto | count () const -> index_t |
Cardinality: Number of indices included in set. | |
auto | count_neg () const -> index_t |
Number of negative indices included in set. | |
auto | count_pos () const -> index_t |
Number of positive indices included in set. | |
auto | min () const -> index_t |
Minimum member. | |
auto | max () const -> index_t |
Maximum member. | |
auto | operator< (const index_set_t rhs) const -> bool |
Less than operator used for comparisons, map, etc. | |
auto | is_contiguous () const -> bool |
Determine if the index set is contiguous, ie. has no gaps. | |
auto | fold () const -> const index_set_t |
Fold this index set within itself as a frame. | |
auto | fold (const index_set_t frm, const bool prechecked=false) const -> const index_set_t |
Fold this index set within the given frame. | |
auto | unfold (const index_set_t frm, const bool prechecked=false) const -> const index_set_t |
Unfold this index set within the given frame. | |
auto | value_of_fold (const index_set_t frm) const -> set_value_t |
The set value of the fold of this index set within the given frame. | |
auto | sign_of_mult (const index_set_t ist) const -> int |
Sign of geometric product of two Clifford basis elements. | |
auto | sign_of_square () const -> int |
Sign of geometric square of a Clifford basis element. | |
auto | hash_fn () const -> size_t |
Hash function. | |
auto | operator[] (index_t idx) -> reference |
Subscripting: Element access. | |
Static Public Member Functions | |
static auto | classname () -> const std::string |
Static Public Attributes | |
static const index_t | v_lo = LO |
static const index_t | v_hi = HI |
Private Types | |
using | bitset_t = std::bitset<HI - LO> |
using | error_t = error<index_set> |
Private Member Functions | |
BOOST_STATIC_ASSERT ((LO<=0) &&(0<=HI) &&(LO< HI) &&(-LO< _GLUCAT_BITS_PER_ULONG) &&(HI< _GLUCAT_BITS_PER_ULONG) &&(HI-LO<=_GLUCAT_BITS_PER_ULONG)) | |
auto | lex_less_than (const index_set_t rhs) const -> bool |
Lexicographic ordering of two sets: *this < rhs. | |
Friends | |
class | reference |
auto | operator^ (const index_set_t &lhs, const index_set_t &rhs) -> const index_set_t |
auto | operator& (const index_set_t &lhs, const index_set_t &rhs) -> const index_set_t |
auto | operator| (const index_set_t &lhs, const index_set_t &rhs) -> const index_set_t |
auto | compare (const index_set_t &lhs, const index_set_t &rhs) -> int |
Index set class based on std::bitset<> in Gnu standard C++ library.
Definition at line 73 of file index_set.h.
|
private |
Definition at line 81 of file index_set.h.
|
private |
Definition at line 82 of file index_set.h.
using glucat::index_set< LO, HI >::index_pair_t = std::pair<index_t, index_t> |
Definition at line 85 of file index_set.h.
using glucat::index_set< LO, HI >::index_set_t = index_set |
Definition at line 84 of file index_set.h.
|
default |
Default constructor creates an empty set.
glucat::index_set< LO, HI >::index_set | ( | const bitset_t | bst | ) |
Constructor from bitset_t.
Definition at line 61 of file index_set_imp.h.
glucat::index_set< LO, HI >::index_set | ( | const index_t | idx | ) |
Constructor from index.
Constructor from index value.
Definition at line 55 of file index_set_imp.h.
glucat::index_set< LO, HI >::index_set | ( | const set_value_t | folded_val, |
const index_set_t | frm, | ||
const bool | prechecked = false ) |
Constructor from set value of an index set folded within the given frame.
Definition at line 68 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::fold(), glucat::index_set< LO, HI >::min(), and glucat::index_set< LO, HI >::unfold().
glucat::index_set< LO, HI >::index_set | ( | const index_pair_t & | range, |
const bool | prechecked = false ) |
Constructor from range of indices from range.first to range.second.
Definition at line 82 of file index_set_imp.h.
glucat::index_set< LO, HI >::index_set | ( | const std::string & | str | ) |
Constructor from string.
Definition at line 102 of file index_set_imp.h.
|
private |
|
inlinestatic |
Definition at line 49 of file index_set_imp.h.
|
inline |
Cardinality: Number of indices included in set.
Definition at line 344 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::count_neg(), glucat::index_set< LO, HI >::count_pos(), glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi(), glucat::index_set< LO, HI >::index_set(), and glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::matrix_multi().
|
inline |
Number of negative indices included in set.
Definition at line 364 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count().
|
inline |
Number of positive indices included in set.
Definition at line 376 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count().
|
inline |
Set complement, except 0: flip all bits, except 0.
Definition at line 319 of file index_set_imp.h.
|
inline |
Complement membership of idx if idx != 0: flip bit at idx if idx != 0.
Definition at line 330 of file index_set_imp.h.
|
inline |
Fold this index set within itself as a frame.
Definition at line 747 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set().
auto glucat::index_set< LO, HI >::fold | ( | const index_set_t | frm, |
const bool | prechecked = false ) const -> const index_set_t |
Fold this index set within the given frame.
Definition at line 755 of file index_set_imp.h.
|
inline |
Hash function.
Definition at line 950 of file index_set_imp.h.
|
inline |
Determine if the index set is contiguous, ie. has no gaps.
Determine if the index set is contiguous, ie. has no gaps when 0 is included.
Definition at line 732 of file index_set_imp.h.
|
inlineprivate |
Lexicographic ordering of two sets: *this < rhs.
Definition at line 588 of file index_set_imp.h.
auto glucat::index_set< LO, HI >::max | ( | ) | const -> index_t |
Maximum member.
Maximum member, or 0 if none.
Definition at line 550 of file index_set_imp.h.
Referenced by PyClical.index_set::__iter__(), glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi(), and glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::matrix_multi().
auto glucat::index_set< LO, HI >::min | ( | ) | const -> index_t |
Minimum member.
Minimum member, or 0 if none.
Definition at line 461 of file index_set_imp.h.
Referenced by PyClical.index_set::__iter__(), glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi(), glucat::index_set< LO, HI >::index_set(), and glucat::matrix_multi< Scalar_T, LO, HI, Tune_P >::matrix_multi().
|
inline |
Inequality.
Definition at line 130 of file index_set_imp.h.
|
inline |
Set intersection: and.
Definition at line 174 of file index_set_imp.h.
|
inline |
Less than operator used for comparisons, map, etc.
Definition at line 596 of file index_set_imp.h.
|
inline |
Equality.
Definition at line 119 of file index_set_imp.h.
|
inline |
Subscripting: Test idx for membership: test value of bit idx.
Definition at line 232 of file index_set_imp.h.
|
inline |
Subscripting: Element access.
Definition at line 224 of file index_set_imp.h.
|
inline |
Symmetric set difference: exclusive or.
Definition at line 149 of file index_set_imp.h.
|
inline |
Set union: or.
Definition at line 199 of file index_set_imp.h.
|
inline |
Set complement: not.
Definition at line 141 of file index_set_imp.h.
|
inline |
Make set empty: Set all bits to 0.
Definition at line 294 of file index_set_imp.h.
|
inline |
Exclude idx: Set bit at idx to 0.
Definition at line 305 of file index_set_imp.h.
|
inline |
Include all indices except 0: set all bits except 0.
Definition at line 255 of file index_set_imp.h.
|
inline |
Include idx: Set bit at idx if idx != 0.
Definition at line 266 of file index_set_imp.h.
|
inline |
Set membership of idx to val if idx != 0: Set bit at idx to val if idx != 0.
Definition at line 280 of file index_set_imp.h.
auto glucat::index_set< LO, HI >::sign_of_mult | ( | const index_set_t | ist | ) | const -> int |
Sign of geometric product of two Clifford basis elements.
Definition at line 880 of file index_set_imp.h.
References glucat::inverse_gray(), and glucat::inverse_reversed_gray().
|
inline |
Sign of geometric square of a Clifford basis element.
Definition at line 930 of file index_set_imp.h.
|
inline |
Test idx for membership: test value of bit idx.
Definition at line 240 of file index_set_imp.h.
auto glucat::index_set< LO, HI >::unfold | ( | const index_set_t | frm, |
const bool | prechecked = false ) const -> const index_set_t |
Unfold this index set within the given frame.
Definition at line 794 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set().
|
inline |
The set value of the fold of this index set within the given frame.
Definition at line 829 of file index_set_imp.h.
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 174 of file index_set.h.
|
static |
Definition at line 88 of file index_set.h.
|
static |
Definition at line 87 of file index_set.h.