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>
54 template<const index_t LO, const index_t HI>
60 template<const index_t LO, const index_t HI>
67 template<const index_t LO, const index_t HI>
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));
117 auto operator[] (const
index_t idx) const ->
bool;
174 friend class reference;
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.
auto flip() -> reference &
for b[i].flip();
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
auto count() const -> index_t
std::bitset< HI - LO > bitset_t
auto flip() -> index_set_t &
error< index_set > error_t
auto lex_less_than(const index_set_t rhs) const -> bool
auto reset() -> index_set_t &
auto sign_of_square() const -> int
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
auto hash_fn() const -> size_t
auto set() -> index_set_t &
auto is_contiguous() const -> bool
auto count_pos() const -> index_t
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.
std::pair< index_t, index_t > index_pair_t
index_set(const bitset_t bst)
Constructor from bitset_t.
auto count_neg() const -> index_t
index_set(const std::string &str)
Constructor from string.
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.
index_set(const index_pair_t &range, const bool prechecked=false)
Constructor from range of indices from range.first to range.second.
auto max() const -> index_t
auto sign_of_mult(const index_set_t ist) const -> int
auto unfold(const index_set_t frm, const bool prechecked=false) const -> const index_set_t
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
friend auto compare(const index_set_t &lhs, const index_set_t &rhs) -> int
index_set(const index_t idx)
Constructor from index.
auto fold() const -> const index_set_t
static const index_t v_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 >
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 sign_of_square(index_t j) -> int
Square of generator {j}.
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.
_GLUCAT_CTAssert(std::numeric_limits< unsigned char >::radix==2, CannotDetermineBitsPerChar) const index_t BITS_PER_CHAR
If radix of unsigned char is not 2, we can't easily determine number of bits from sizeof.
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.