glucat
0.8.2
|
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 45 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.
typedef std::pair<index_t,index_t> glucat::index_set< LO, HI >::index_pair_t |
Definition at line 85 of file index_set.h.
typedef index_set glucat::index_set< LO, HI >::index_set_t |
Definition at line 84 of file index_set.h.
|
inline |
Default constructor creates an empty set.
Definition at line 92 of file index_set.h.
References glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::count_neg(), glucat::index_set< LO, HI >::count_pos(), glucat::index_set< LO, HI >::flip(), glucat::index_set< LO, HI >::fold(), glucat::index_set< LO, HI >::hash_fn(), glucat::index_set< LO, HI >::is_contiguous(), PyClical::ist, glucat::index_set< LO, HI >::max(), glucat::index_set< LO, HI >::min(), glucat::index_set< LO, HI >::operator!=(), glucat::index_set< LO, HI >::operator&=(), glucat::index_set< LO, HI >::operator==(), glucat::index_set< LO, HI >::operator[](), glucat::index_set< LO, HI >::operator^=(), glucat::index_set< LO, HI >::operator|=(), glucat::index_set< LO, HI >::operator~(), glucat::index_set< LO, HI >::reset(), glucat::index_set< LO, HI >::sign_of_mult(), glucat::index_set< LO, HI >::sign_of_square(), glucat::index_set< LO, HI >::test(), glucat::index_set< LO, HI >::unfold(), and glucat::index_set< LO, HI >::value_of_fold().
Referenced by glucat::index_set< LO, HI >::classname(), and glucat::index_set< LO, HI >::index_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.
References glucat::index_set< LO, HI >::index_set().
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.
References glucat::index_set< LO, HI >::index_set().
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 >::index_set(), 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.
References glucat::index_set< LO, HI >::index_set().
glucat::index_set< LO, HI >::index_set | ( | const std::string & | str | ) |
Constructor from string.
Definition at line 102 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator==().
|
private |
|
inlinestatic |
Definition at line 49 of file index_set_imp.h.
References glucat::index_set< LO, HI >::index_set().
|
inline |
Cardinality: Number of indices included in set.
Definition at line 344 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count_neg().
Referenced by glucat::matrix_multi< Scalar_T, LO, HI >::basis_element(), glucat::index_set< LO, HI >::count_neg(), glucat::index_set< LO, HI >::count_pos(), glucat::index_set< LO, HI >::flip(), glucat::framed_multi< Scalar_T, LO, HI >::framed_multi(), glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::is_contiguous(), glucat::matrix_multi< Scalar_T, LO, HI >::matrix_multi(), glucat::operator%(), glucat::operator&(), glucat::operator*(), glucat::index_set< LO, HI >::operator<(), glucat::operator^(), glucat::framed_multi< Scalar_T, LO, HI >::random(), and glucat::index_set< LO, HI >::sign_of_square().
|
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(), and glucat::index_set< LO, HI >::count_pos().
Referenced by glucat::index_set< LO, HI >::count(), glucat::matrix_multi< Scalar_T, LO, HI >::fast_framed_multi(), glucat::framed_multi< Scalar_T, LO, HI >::fast_matrix_multi(), glucat::folded_dim(), glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::sign_of_square().
|
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(), and glucat::index_set< LO, HI >::min().
Referenced by glucat::index_set< LO, HI >::count_neg(), glucat::matrix_multi< Scalar_T, LO, HI >::fast_framed_multi(), glucat::framed_multi< Scalar_T, LO, HI >::fast_matrix_multi(), glucat::folded_dim(), and glucat::index_set< LO, HI >::index_set().
|
inline |
Set complement, except 0: flip all bits, except 0.
Definition at line 319 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::reference::flip(), glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::reset().
|
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.
References glucat::index_set< LO, HI >::count().
|
inline |
Fold this index set within itself as a frame.
Definition at line 748 of file index_set_imp.h.
Referenced by glucat::matrix_multi< Scalar_T, LO, HI >::basis_element(), glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::is_contiguous(), and glucat::index_set< LO, HI >::value_of_fold().
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 756 of file index_set_imp.h.
References glucat::index_set< LO, HI >::max(), glucat::index_set< LO, HI >::min(), glucat::index_set< LO, HI >::set(), glucat::index_set< LO, HI >::test(), and glucat::index_set< LO, HI >::unfold().
|
inline |
Hash function.
Definition at line 948 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set(), glucat::index_set_hash< LO, HI >::operator()(), and glucat::index_set< LO, HI >::sign_of_square().
|
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.
References glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::fold(), glucat::index_set< LO, HI >::max(), and glucat::index_set< LO, HI >::min().
Referenced by glucat::framed_multi< Scalar_T, LO, HI >::fold(), glucat::index_set< LO, HI >::index_set(), glucat::operator>>(), and glucat::framed_multi< Scalar_T, LO, HI >::unfold().
|
inlineprivate |
Lexicographic ordering of two sets: *this < rhs.
Definition at line 588 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator<().
Referenced by glucat::compare(), and glucat::index_set< LO, HI >::operator<().
index_t glucat::index_set< LO, HI >::max | ( | ) | const |
Maximum member.
Maximum member, or 0 if none.
Definition at line 550 of file index_set_imp.h.
References glucat::index_set< LO, HI >::test().
Referenced by PyClical.index_set::__iter__(), glucat::matrix_multi< Scalar_T, LO, HI >::basis_element(), glucat::framed_multi< Scalar_T, LO, HI >::centre_pm4_qp4(), glucat::index_set< LO, HI >::fold(), glucat::framed_multi< Scalar_T, LO, HI >::framed_multi(), glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::is_contiguous(), glucat::matrix_multi< Scalar_T, LO, HI >::matrix_multi(), glucat::max_pos(), glucat::index_set< LO, HI >::min(), and glucat::index_set< LO, HI >::unfold().
index_t glucat::index_set< LO, HI >::min | ( | ) | const |
Minimum member.
Minimum member, or 0 if none.
Definition at line 461 of file index_set_imp.h.
References glucat::index_set< LO, HI >::max(), and glucat::index_set< LO, HI >::test().
Referenced by PyClical.index_set::__iter__(), glucat::matrix_multi< Scalar_T, LO, HI >::basis_element(), glucat::framed_multi< Scalar_T, LO, HI >::centre_pp4_qm4(), glucat::index_set< LO, HI >::count_pos(), glucat::index_set< LO, HI >::fold(), glucat::framed_multi< Scalar_T, LO, HI >::framed_multi(), glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::is_contiguous(), glucat::matrix_multi< Scalar_T, LO, HI >::matrix_multi(), glucat::min_neg(), glucat::index_set< LO, HI >::unfold(), and glucat::index_set< LO, HI >::value_of_fold().
|
inline |
Inequality.
Definition at line 130 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator~().
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::operator==().
|
inline |
Set intersection: and.
Definition at line 174 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::operator^().
|
inline |
Less than operator used for comparisons, map, etc.
Definition at line 597 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count(), and glucat::index_set< LO, HI >::lex_less_than().
Referenced by glucat::index_set< LO, HI >::lex_less_than().
|
inline |
Equality.
Definition at line 119 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator!=().
Referenced by glucat::index_set< LO, HI >::index_set().
|
inline |
Subscripting: Test idx for membership: test value of bit idx.
Definition at line 232 of file index_set_imp.h.
References glucat::index_set< LO, HI >::test().
Referenced by glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::operator[](), and glucat::operator|().
|
inline |
Subscripting: Element access.
Definition at line 224 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator[](), and glucat::index_set< LO, HI >::reference.
|
inline |
Symmetric set difference: exclusive or.
Definition at line 149 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::operator~().
|
inline |
Set union: or.
Definition at line 199 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::operator&().
|
inline |
Set complement: not.
Definition at line 141 of file index_set_imp.h.
References glucat::index_set< LO, HI >::operator^=().
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::operator!=().
|
inline |
Make set empty: Set all bits to 0.
Definition at line 294 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::reference::operator=(), and glucat::index_set< LO, HI >::set().
|
inline |
Exclude idx: Set bit at idx to 0.
Definition at line 305 of file index_set_imp.h.
References glucat::index_set< LO, HI >::flip().
|
inline |
Include all indices except 0: set all bits except 0.
Definition at line 255 of file index_set_imp.h.
Referenced by glucat::index_set< LO, HI >::fold(), glucat::index_set< LO, HI >::reference::operator=(), glucat::operator>>(), glucat::index_set< LO, HI >::set(), glucat::index_set< LO, HI >::test(), and glucat::index_set< LO, HI >::unfold().
|
inline |
Include idx: Set bit at idx if idx != 0.
Definition at line 266 of file index_set_imp.h.
References glucat::index_set< LO, HI >::set().
|
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.
References glucat::index_set< LO, HI >::reset().
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 879 of file index_set_imp.h.
References glucat::inverse_gray(), glucat::inverse_reversed_gray(), and glucat::index_set< LO, HI >::sign_of_square().
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::inverse_gray().
|
inline |
Sign of geometric square of a Clifford basis element.
Definition at line 928 of file index_set_imp.h.
References glucat::index_set< LO, HI >::count(), glucat::index_set< LO, HI >::count_neg(), and glucat::index_set< LO, HI >::hash_fn().
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::sign_of_mult().
|
inline |
Test idx for membership: test value of bit idx.
Definition at line 240 of file index_set_imp.h.
References glucat::index_set< LO, HI >::set().
Referenced by glucat::index_set< LO, HI >::fold(), glucat::index_set< LO, HI >::index_set(), glucat::index_set< LO, HI >::max(), glucat::index_set< LO, HI >::min(), glucat::index_set< LO, HI >::reference::operator bool(), glucat::index_set< LO, HI >::operator[](), glucat::index_set< LO, HI >::reference::operator~(), and glucat::index_set< LO, HI >::unfold().
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 794 of file index_set_imp.h.
References glucat::index_set< LO, HI >::max(), glucat::index_set< LO, HI >::min(), glucat::index_set< LO, HI >::set(), glucat::index_set< LO, HI >::test(), and glucat::index_set< LO, HI >::value_of_fold().
Referenced by glucat::index_set< LO, HI >::fold(), and 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 828 of file index_set_imp.h.
References glucat::index_set< LO, HI >::fold(), and glucat::index_set< LO, HI >::min().
Referenced by glucat::index_set< LO, HI >::index_set(), and glucat::index_set< LO, HI >::unfold().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 173 of file index_set.h.
Referenced by glucat::index_set< LO, HI >::operator[]().
|
static |
Definition at line 88 of file index_set.h.
|
static |
Definition at line 87 of file index_set.h.