Skip to content

Commit

Permalink
templated select index
Browse files Browse the repository at this point in the history
  • Loading branch information
jermp committed Jan 3, 2025
1 parent 78bd32f commit 9e627c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external/bits
13 changes: 10 additions & 3 deletions include/utils/encoders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

namespace pthash {

/*
Increase block (4096) and subblock (64) length compared to the default
used in the BITS library (1024 and 32, respectively).
*/
typedef bits::darray<bits::util::identity_getter, 4096, 64> darray1; // take positions of 1s
typedef bits::darray<bits::util::negating_getter, 4096, 64> darray0; // take positions of 0s

struct compact {
template <typename Iterator>
void encode(Iterator begin, const uint64_t n) {
Expand Down Expand Up @@ -243,7 +250,7 @@ struct elias_fano {
}

private:
bits::elias_fano<false, true> m_values;
bits::elias_fano<false, true, darray1, darray0> m_values;
};

struct sdc_sequence {
Expand Down Expand Up @@ -313,7 +320,7 @@ struct sdc_sequence {

uint64_t m_size;
bits::bit_vector m_codewords;
bits::elias_fano<false, false> m_index;
bits::elias_fano<false, false, darray1, darray0> m_index;
};

struct sdc {
Expand Down Expand Up @@ -460,7 +467,7 @@ struct rice_sequence {
visitor.visit(t.m_low_bits);
}
bits::bit_vector m_high_bits;
bits::darray1 m_high_bits_d1;
darray1 m_high_bits_d1;
bits::compact_vector m_low_bits;

template <typename Iterator>
Expand Down

0 comments on commit 9e627c1

Please sign in to comment.