1#ifndef _GLUCAT_INDEX_SET_H
2#define _GLUCAT_INDEX_SET_H
37#include <boost/static_assert.hpp>
44 template<const index_t LO, const index_t HI>
48 template<const index_t LO, const index_t HI>
51 const index_set<LO,HI>& rhs) ->
const index_set<LO,HI>;
54 template<const index_t LO, const index_t HI>
57 const index_set<LO,HI>& rhs) ->
const index_set<LO,HI>;
60 template<const index_t LO, const index_t HI>
63 const index_set<LO,HI>& rhs) ->
const index_set<LO,HI>;
67 template<const index_t LO, const index_t HI>
69 compare(
const index_set<LO,HI>& a,
const index_set<LO,HI>& b) -> int;
72 template<const index_t LO, const index_t HI>
74 private std::bitset<HI-LO>
78 (-LO < _GLUCAT_BITS_PER_ULONG) && \
79 ( HI < _GLUCAT_BITS_PER_ULONG) && \
80 ( HI-LO <= _GLUCAT_BITS_PER_ULONG));
90 static auto classname() ->
const std::string;
117 auto operator[] (const
index_t idx) const ->
bool;
147 auto operator< (const
index_set_t rhs) const ->
bool;
164 auto
hash_fn () const ->
size_t;
188 auto operator= (
const bool x) ->
reference&;
194 operator
bool () const;
211 Default_index_set_too_big_for_value)
218 operator<< (
std::ostream& os, const
index_set<LO,HI>& ist) ->
std::ostream&;
Specific exception class.
Index set member reference.
reference()=delete
Default constructor is deleted.
Index set class based on std::bitset<> in Gnu standard C++ library.
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 count() const -> index_t
Cardinality: Number of indices included in set.
std::bitset< HI - LO > bitset_t
auto flip() -> index_set_t &
Set complement, except 0: flip all bits, except 0.
auto lex_less_than(const index_set_t rhs) const -> bool
Lexicographic ordering of two sets: *this < rhs.
auto reset() -> index_set_t &
Make set empty: Set all bits to 0.
auto sign_of_square() const -> int
Sign of geometric square of a Clifford basis element.
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))
static const index_t v_lo
auto min() const -> index_t
Minimum member.
auto hash_fn() const -> size_t
Hash function.
auto set() -> index_set_t &
Include all indices except 0: set all bits except 0.
auto is_contiguous() const -> bool
Determine if the index set is contiguous, ie. has no gaps.
auto count_pos() const -> index_t
Number of positive indices included in set.
std::pair< index_t, index_t > index_pair_t
auto count_neg() const -> index_t
Number of negative indices included in set.
auto operator!=(const index_set_t rhs) const -> bool
Inequality.
static auto classname() -> const std::string
auto operator~() const -> index_set_t
Set complement: not.
auto max() const -> index_t
Maximum member.
auto sign_of_mult(const index_set_t ist) const -> int
Sign of geometric product of two Clifford basis elements.
auto unfold(const index_set_t frm, const bool prechecked=false) const -> const index_set_t
Unfold this index set within the given frame.
index_set()=default
Default constructor creates an empty set.
auto operator==(const index_set_t rhs) const -> bool
Equality.
auto test(const index_t idx) const -> bool
Test idx for membership: test value of bit idx.
friend auto compare(const index_set_t &lhs, const index_set_t &rhs) -> int
auto fold() const -> const index_set_t
Fold this index set within itself as a frame.
static const index_t v_hi
#define _GLUCAT_CTAssert(expr, msg)
auto operator|(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Transformation via twisted adjoint action.
auto operator&(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Inner product.
auto compare(const index_set< LO, HI > &a, const index_set< LO, HI > &b) -> int
"lexicographic compare" eg. {3,4,5} is less than {3,7,8}
auto min_neg(const index_set< LO, HI > &ist) -> index_t
Minimum negative index, or 0 if none.
unsigned long set_value_t
Size of set_value_t should be enough to contain index_set<LO,HI>
int index_t
Size of index_t should be enough to represent LO, HI.
auto operator^(const Multivector< Scalar_T, LO, HI, Tune_P > &lhs, const RHS< Scalar_T, LO, HI, Tune_P > &rhs) -> const Multivector< Scalar_T, LO, HI, Tune_P >
Outer product.
auto max_pos(const index_set< LO, HI > &ist) -> index_t
Maximum positive index, or 0 if none.
const index_t DEFAULT_HI
Default highest index in an index set.