Bitset Listing#

Functions

LIBRAPID_SIMPLE_IO_NORANGE (uint64_t numBits COMMA bool stackAlloc, librapid::BitSet< numBits COMMA stackAlloc >) template< uint64_t numElements
bool stackAlloc std::ostream & operator<< (std::ostream &os, const librapid::BitSet< numElements, stackAlloc > &bitset)
template<uint64_t numBits, bool stackAlloc, typename Char>
struct formatter<librapid::BitSet<numBits, stackAlloc>, Char>
#include <bitset.hpp>

Public Functions

template<typename ParseContext>
inline FMT_CONSTEXPR auto parse(ParseContext &ctx) -> const Char*
template<typename FormatContext>
inline FMT_CONSTEXPR auto format(const Type &val, FormatContext &ctx) const -> decltype(ctx.out())

Private Types

using Type = librapid::BitSet<numBits, stackAlloc>#
using Base = fmt::formatter<int, Char>#

Private Members

Base m_base#
namespace librapid

Functions

template<typename T>
uint64_t popCount(const T &value)
template<uint64_t numBits, bool stackAlloc>
uint64_t popCount(const BitSet<numBits, stackAlloc> &bitset)
template<uint64_t numBits_ = 64, bool stackAlloc_ = true>
class BitSet
#include <bitset.hpp>

Public Types

template<uint64_t otherBits, bool otherStackAlloc>
using BitSetMerger = BitSet
using ElementType = uint64_t
using StorageType = std::conditional_t<stackAlloc, std::array<ElementType, numElements>, ElementType*>

Public Functions

inline BitSet()
inline BitSet(const BitSet &other)
BitSet(BitSet &&other) = default
inline constexpr BitSet(uint64_t value)
inline constexpr BitSet(const std::string &str, char zero = '0', char one = '1')
BitSet &operator=(const BitSet &other) = default
BitSet &operator=(BitSet &&other) = default
inline ~BitSet()
inline BitSet &set(uint64_t index, bool value)
inline BitSet &set(uint64_t start, uint64_t end, bool value)
inline bool get(uint64_t index) const
inline bool any() const
inline bool all() const
inline bool none() const
inline uint64_t first() const
inline uint64_t last() const
inline uint64_t popCount() const
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator|=(const BitSet<otherBits, otherStackAlloc> &other)
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator&=(const BitSet<otherBits, otherStackAlloc> &other)
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline BitSet &operator^=(const BitSet<otherBits, otherStackAlloc> &other)
inline BitSet &operator<<=(int64_t shift)
inline BitSet &operator>>=(int64_t shift)
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator|(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator&(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>
template<uint64_t otherBits = numBits, bool otherStackAlloc = stackAlloc>
inline auto operator^(const BitSet<otherBits, otherStackAlloc> &other) const -> BitSetMerger<otherBits, otherStackAlloc>
inline BitSet operator<<(int64_t shift) const
inline BitSet operator>>(int64_t shift) const
inline BitSet operator~() const
inline bool operator==(const BitSet &other) const
inline const auto &data() const
inline auto &data()
template<typename Integer = ElementType>
inline int toInt() const
template<typename T, typename Char, typename Ctx>
inline void str(const fmt::formatter<T, Char> &format, Ctx &ctx) const

Public Static Attributes

static constexpr bool stackAlloc = stackAlloc_
static constexpr uint64_t bitsPerElement = sizeof(ElementType) * 8
static constexpr uint64_t numBits = numBits_
static constexpr uint64_t numElements = (numBits + bitsPerElement - 1) / bitsPerElement

Protected Functions

inline constexpr uint64_t highMask() const
inline void zero()
inline void init()
inline void emptyInit()

Private Members

StorageType m_data#