|
|
template<typename Int , CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr bool | ndtree::v1::bit::has_bit (uint_t b) noexcept |
| | Does the type Int have the bit b? note: used to assert if bit is within bounds.
|
| |
|
template<typename Int , CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr bool | ndtree::v1::bit::get (Int x, uint_t b) |
| | Gets the value of the i-th bit of the integer x.
|
| |
|
template<typename Int , CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr void | ndtree::v1::bit::set (Int &x, uint_t b, bool value) |
| | Sets the i-th bit of x to value.
|
| |
|
template<typename Int , Int max = width<Int>, CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr auto | ndtree::v1::bit::to_int (Int x, Int from=0, Int to=max) -> Int |
| | Integer representation of the bit range [from, to) of x.
|
| |
|
template<typename Int , Int max = width<Int>, CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr auto | ndtree::v1::bit::to_int_r (Int x, Int from=0, Int to=max) -> Int |
| | Reverse integer representation of the bit range [from, to) of x TODO: clean this up.
|
| |
|
template<typename Int , CONCEPT_REQUIRES_(Integral< Int >{}) > |
| constexpr void | ndtree::v1::bit::swap (Int &x, uint_t b0, uint_t b1) |
| | Swaps the bits a and b in x.
|
| |
| template<typename Int , CONCEPT_REQUIRES_(Integral< Int >{}) > |
| auto | ndtree::v1::bit::bits () noexcept |
| | Range of bit positions for type. More...
|
| |
| constexpr uint64_t | ndtree::v1::bit::max_value (uint64_t no_bits) |
| | Maximum representable unsigned integer value in no_bits. More...
|
| |
|
template<typename UInt , typename SInt , CONCEPT_REQUIRES_(UnsignedIntegral< UInt >{}and SignedIntegral< SInt >{}) and bit::width< UInt > = = bit::width<SInt>> |
| constexpr bool | ndtree::v1::bit::overflows_on_add (UInt value, SInt offset, UInt no_bits=width< UInt >) |
| | Does adding offset to the first no_bits of value overflows?
|
| |
|
template<typename UInt , CONCEPT_REQUIRES_(UnsignedIntegral< UInt >{}) > |
| constexpr bool | ndtree::v1::bit::overflows_on_add (UInt value, UInt offset, UInt no_bits=width< UInt >) |
| | Does adding offset to the first no_bits of value overflows?
|
| |
|
template<typename Integral > |
| constexpr Integral | ndtree::v1::bit::deposit_bits (Integral x, Integral mask) |
| | Parallel Bits Deposit.
|
| |
|
template<typename Integral > |
| constexpr Integral | ndtree::v1::bit::extract_bits (Integral x, Integral mask) |
| | Parallel Bits Extract.
|
| |
Bit manipulation utilities.