glucat
0.8.4
|
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 | |
typedef index_set | index_set_t |
typedef std::pair< index_t, index_t > | index_pair_t |
Public Member Functions | |
index_set () | |
Default constructor creates an empty set. More... | |
index_set (const bitset_t bst) | |
Constructor from bitset_t. More... | |
index_set (const index_t idx) | |
Constructor from index. More... | |
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. More... | |
index_set (const index_pair_t &range, const bool prechecked=false) | |
Constructor from range of indices from range.first to range.second. More... | |
index_set (const std::string &str) | |
Constructor from string. More... | |
bool | operator== (const index_set_t rhs) const |
Equality. More... | |
bool | operator!= (const index_set_t rhs) const |
Inequality. More... | |
index_set_t | operator~ () const |
Set complement: not. More... | |
index_set_t & | operator^= (const index_set_t rhs) |
Symmetric set difference: exclusive or. More... | |
index_set_t & | operator&= (const index_set_t rhs) |
Set intersection: and. More... | |
index_set_t & | operator|= (const index_set_t rhs) |
Set union: or. More... | |
bool | operator[] (const index_t idx) const |
Subscripting: Test idx for membership: test value of bit idx. More... | |
bool | test (const index_t idx) const |
Test idx for membership: test value of bit idx. More... | |
index_set_t & | set () |
Include all indices except 0: set all bits except 0. More... | |
index_set_t & | set (const index_t idx) |
Include idx: Set bit at idx if idx != 0. More... | |
index_set_t & | set (const index_t idx, const int val) |
Set membership of idx to val if idx != 0: Set bit at idx to val if idx != 0. More... | |
index_set_t & | reset () |
Make set empty: Set all bits to 0. More... | |
index_set_t & | reset (const index_t idx) |
Exclude idx: Set bit at idx to 0. More... | |
index_set_t & | flip () |
Set complement, except 0: flip all bits, except 0. More... | |
index_set_t & | flip (const index_t idx) |
Complement membership of idx if idx != 0: flip bit at idx if idx != 0. More... | |
index_t | count () const |
Cardinality: Number of indices included in set. More... | |
index_t | count_neg () const |
Number of negative indices included in set. More... | |
index_t | count_pos () const |
Number of positive indices included in set. More... | |
index_t | min () const |
Minimum member. More... | |
index_t | max () const |
Maximum member. More... | |
bool | operator< (const index_set_t rhs) const |
Less than operator used for comparisons, map, etc. More... | |
bool | is_contiguous () const |
Determine if the index set is contiguous, ie. has no gaps. More... | |
const index_set_t | fold () const |
Fold this index set within itself as a frame. More... | |
const index_set_t | fold (const index_set_t frm, const bool prechecked=false) const |
Fold this index set within the given frame. More... | |
const index_set_t | unfold (const index_set_t frm, const bool prechecked=false) const |
Unfold this index set within the given frame. More... | |
set_value_t | value_of_fold (const index_set_t frm) const |
The set value of the fold of this index set within the given frame. More... | |
int | sign_of_mult (const index_set_t ist) const |
Sign of geometric product of two Clifford basis elements. More... | |
int | sign_of_square () const |
Sign of geometric square of a Clifford basis element. More... | |
size_t | hash_fn () const |
Hash function. More... | |
reference | operator[] (index_t idx) |
Subscripting: Element access. More... | |
Static Public Member Functions | |
static const std::string | classname () |
Static Public Attributes | |
static const index_t | v_lo = LO |
static const index_t | v_hi = HI |
Private Types | |
typedef std::bitset< HI-LO > | bitset_t |
typedef error< index_set > | error_t |
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)) | |
bool | lex_less_than (const index_set_t rhs) const |
Lexicographic ordering of two sets: *this < rhs. More... | |
Friends | |
class | reference |
const index_set_t | operator^ (const index_set_t &lhs, const index_set_t &rhs) |
const index_set_t | operator& (const index_set_t &lhs, const index_set_t &rhs) |
const index_set_t | operator| (const index_set_t &lhs, const index_set_t &rhs) |
int | compare (const index_set_t &lhs, const index_set_t &rhs) |
Index set class based on std::bitset<> in Gnu standard C++ library.
Definition at line 74 of file index_set.h.
|
private |
Definition at line 110 of file index_set.h.
|
private |
Definition at line 111 of file index_set.h.
typedef std::pair<index_t,index_t> glucat::index_set< LO, HI >::index_pair_t |
Definition at line 114 of file index_set.h.
typedef index_set glucat::index_set< LO, HI >::index_set_t |
Definition at line 113 of file index_set.h.
|
inline |
Default constructor creates an empty set.
Definition at line 121 of file index_set.h.
glucat::index_set< LO, HI >::index_set | ( | const bitset_t | bst | ) |
Constructor from bitset_t.
Definition at line 89 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 83 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 96 of file index_set_imp.h.
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 110 of file index_set_imp.h.
glucat::index_set< LO, HI >::index_set | ( | const std::string & | str | ) |
Constructor from string.
Definition at line 130 of file index_set_imp.h.
|
private |
|
inlinestatic |
Definition at line 77 of file index_set_imp.h.
|
inline |
Cardinality: Number of indices included in set.
Definition at line 372 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count().
Referenced by glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::flip(), glucat::framed_multi< Scalar_T, LO, HI >::framed_multi(), and glucat::matrix_multi< Scalar_T, LO, HI >::matrix_multi().
|
inline |
Number of negative indices included in set.
Definition at line 392 of file index_set_imp.h.
|
inline |
Number of positive indices included in set.
Definition at line 404 of file index_set_imp.h.
|
inline |
Set complement, except 0: flip all bits, except 0.
Definition at line 347 of file index_set_imp.h.
|
inline |
Complement membership of idx if idx != 0: flip bit at idx if idx != 0.
Definition at line 358 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count().
|
inline |
Fold this index set within itself as a frame.
Definition at line 776 of file index_set_imp.h.
References glucat::index_set< LO, HI >::set().
Referenced by glucat::index_set< LO, HI >::unfold().
const index_set< LO, HI > glucat::index_set< LO, HI >::fold | ( | const index_set_t | frm, |
const bool | prechecked = false |
||
) | const |
Fold this index set within the given frame.
Definition at line 784 of file index_set_imp.h.
|
inline |
Hash function.
Definition at line 976 of file index_set_imp.h.
Referenced by glucat::index_set_hash< LO, HI >::operator()().
|
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 760 of file index_set_imp.h.
References glucat::index_set< LO, HI >::set().
|
inlineprivate |
Lexicographic ordering of two sets: *this < rhs.
Definition at line 616 of file index_set_imp.h.
index_t glucat::index_set< LO, HI >::max |
Maximum member.
Maximum member, or 0 if none.
Definition at line 578 of file index_set_imp.h.
Referenced by PyClical.index_set::__iter__(), and glucat::framed_multi< Scalar_T, LO, HI >::framed_multi().
index_t glucat::index_set< LO, HI >::min |
Minimum member.
Minimum member, or 0 if none.
Definition at line 489 of file index_set_imp.h.
Referenced by PyClical.index_set::__iter__(), glucat::framed_multi< Scalar_T, LO, HI >::framed_multi(), and glucat::index_set< LO, HI >::unfold().
|
inline |
Inequality.
Definition at line 158 of file index_set_imp.h.
|
inline |
Set intersection: and.
Definition at line 202 of file index_set_imp.h.
|
inline |
Less than operator used for comparisons, map, etc.
Definition at line 624 of file index_set_imp.h.
|
inline |
Equality.
Definition at line 147 of file index_set_imp.h.
|
inline |
Subscripting: Test idx for membership: test value of bit idx.
Definition at line 260 of file index_set_imp.h.
|
inline |
Subscripting: Element access.
Definition at line 252 of file index_set_imp.h.
|
inline |
Symmetric set difference: exclusive or.
Definition at line 177 of file index_set_imp.h.
|
inline |
Set union: or.
Definition at line 227 of file index_set_imp.h.
|
inline |
Set complement: not.
Definition at line 169 of file index_set_imp.h.
|
inline |
Make set empty: Set all bits to 0.
Definition at line 322 of file index_set_imp.h.
|
inline |
Exclude idx: Set bit at idx to 0.
Definition at line 333 of file index_set_imp.h.
|
inline |
Include all indices except 0: set all bits except 0.
Definition at line 283 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::fold(), and glucat::index_set< LO, HI >::is_contiguous().
|
inline |
Include idx: Set bit at idx if idx != 0.
Definition at line 294 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 308 of file index_set_imp.h.
int glucat::index_set< LO, HI >::sign_of_mult | ( | const index_set_t | ist | ) | const |
Sign of geometric product of two Clifford basis elements.
Definition at line 907 of file index_set_imp.h.
|
inline |
Sign of geometric square of a Clifford basis element.
Definition at line 956 of file index_set_imp.h.
|
inline |
Test idx for membership: test value of bit idx.
Definition at line 268 of file index_set_imp.h.
const index_set< LO, HI > glucat::index_set< LO, HI >::unfold | ( | const index_set_t | frm, |
const bool | prechecked = false |
||
) | const |
Unfold this index set within the given frame.
Definition at line 822 of file index_set_imp.h.
References glucat::index_set< LO, HI >::fold(), and glucat::index_set< LO, HI >::min().
|
inline |
The set value of the fold of this index set within the given frame.
Definition at line 856 of file index_set_imp.h.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 203 of file index_set.h.
|
static |
Definition at line 117 of file index_set.h.
|
static |
Definition at line 116 of file index_set.h.