Class TypeAttr¶
Defined in File space.hpp
Inheritance Relationships¶
Derived Type¶
public sequant::IndexSpace::Attr
(Struct IndexSpace::Attr)
Class Documentation¶
-
class TypeAttr¶
TypeAttr denotes the type of index space.
This class models a host (complete) space partitioned into disjoint subspaces. To simplify implementation of set operations (intersection, union, etc.) it is encoded as a fixed-width (32) bitset.
Subclassed by sequant::IndexSpace::Attr
Public Functions
-
inline explicit constexpr TypeAttr(bitset_t bitset) noexcept¶
Constructs from a bitset representation.
Warning
first (most significant) bit is reserved for internal use
- Parameters:
bitset – bitset representation of this Type
- Pre:
(bitset & make_reserved().bitset) == null.bitset
-
template<typename T, typename = std::enable_if_t<meta::is_statically_castable_v<std::decay_t<T>, bitset_t> && !std::is_same_v<std::decay_t<T>, bool> && !std::is_same_v<std::decay_t<T>, QuantumNumbersAttr> && !std::is_same_v<std::decay_t<T>, TypeAttr>>>
inline constexpr TypeAttr(T &&value) noexcept¶ construct TypeAddr from things that can be cast to bitset_t, but exclude bool and QuantumNumbersAttr
-
inline explicit constexpr operator int64_t() const¶
-
inline constexpr int32_t to_int32() const¶
-
inline explicit constexpr operator bool() const¶
- Returns:
true if this object is non-null (i.e. has any bits set)
-
inline constexpr TypeAttr unIon(TypeAttr other) const¶
Note
equivalent to
this->to_int32() | other.to_int32()
- Returns:
union of
*this
andother
, i.e.*this
ANDother
-
inline constexpr const TypeAttr xOr(TypeAttr other) const¶
Note
equivalent to
this->to_int32() ^ other.to_int32()
- Returns:
*this
XORother
-
inline constexpr const TypeAttr intersection(TypeAttr other) const¶
Note
equivalent to
this->to_int32() & other.to_int32()
- Returns:
intersection of
*this
ANDother
-
inline constexpr TypeAttr operator~() const¶
Note
equivalent to
~this->to_int32()
- Returns:
complement of
*this
-
inline explicit constexpr TypeAttr(bitset_t bitset) noexcept¶