25#include <tlx/define.hpp>
46 L12Type(uint32_t
const _l1, std::array<uint16_t, 3>
const _l2)
48 l2_values(((uint32_t(0b1111111111) & _l2[2]) << 20) |
49 ((uint32_t(0b1111111111) & _l2[1]) << 10) |
50 (uint32_t(0b1111111111) & _l2[0])) {}
58 return (
l2_values >> (10 * index)) & uint16_t(0b1111111111);
65} TLX_ATTRIBUTE_PACKED;
68static_assert(
sizeof(
L12Type) == 8);
104 :
data(((__uint128_t{0b111111111111} & _l2[6]) << 116) |
105 ((__uint128_t{0b111111111111} & _l2[5]) << 104) |
106 ((__uint128_t{0b111111111111} & _l2[4]) << 92) |
107 ((__uint128_t{0b111111111111} & _l2[3]) << 80) |
108 ((__uint128_t{0b111111111111} & _l2[2]) << 68) |
109 ((__uint128_t{0b111111111111} & _l2[1]) << 56) |
110 ((__uint128_t{0b111111111111} & _l2[0]) << 44) |
111 ((__uint128_t{0xFFFFFFFFFFF} & _l1))) {}
119 return (index == 0) ?
121 ((
data >> ((12 * index) + 32)) & uint64_t(0b111111111111));
129 inline uint64_t
l1()
const {
130 return uint64_t{0xFFFFFFFFFFF} &
data;
135} TLX_ATTRIBUTE_PACKED;
Check that L12Type requires only 64 bits.
Definition l12_type.hpp:94
uint64_t operator[](size_t const index) const
Access operator used to access the L2-block entries individually.
Definition l12_type.hpp:118
uint64_t l1() const
Get the L1-value of the L12-block.
Definition l12_type.hpp:129
BigL12Type()=default
Constructor. Empty constructor required for tlx::SimpleVector.
BigL12Type(uint64_t const _l1, std::array< uint16_t, 7 > &_l2)
Constructor. Setting all values and packing the L2-block entries.
Definition l12_type.hpp:103
__uint128_t data
All data of the BigL12Type packed into 128 bits.
Definition l12_type.hpp:134
Struct used to store L1- and L2-blocks for BitVectorRank and BitVectorSelect.
Definition l12_type.hpp:37
L12Type()=default
Constructor. Empty constructor required for tlx::SimpleVector.
L12Type(uint32_t const _l1, std::array< uint16_t, 3 > const _l2)
Constructor. Setting all values and packing the L2-block entries.
Definition l12_type.hpp:46
uint32_t l2_values
Packed L2-block values.
Definition l12_type.hpp:64
uint16_t operator[](size_t const index) const
Access operator used to access the L2-block entries individually.
Definition l12_type.hpp:57
uint32_t l1
L1-block value.
Definition l12_type.hpp:62