27class BitPluckerEncoder {
31 static constexpr size_t kN = size_t(1) << LOGN;
32 static constexpr size_t kNv32Elts = (32u + LOGN - 1u) / LOGN;
33 static constexpr size_t kNv128Elts = (128u + LOGN - 1u) / LOGN;
34 static constexpr size_t kNv256Elts = (256u + LOGN - 1u) / LOGN;
37 using packed_v32 = std::array<Elt, kNv32Elts>;
38 using packed_v128 = std::array<Elt, kNv128Elts>;
39 using packed_v256 = std::array<Elt, kNv256Elts>;
41 explicit BitPluckerEncoder(
const Field& F) : f_(F) {}
46 packed_v32 mkpacked_v32(uint32_t j) {
48 for (
size_t i = 0; i < r.size(); ++i) {
49 r[i] = encode(j & (kN - 1));
56 T pack(uint8_t bits[],
size_t n) {
58 for (
size_t i = 0; i < r.size(); ++i) {
60 for (
size_t j = 0; j < LOGN; ++j) {
61 if (i * LOGN + j < n) {
62 v += (bits[i * LOGN + j] & 0x1) << j;