Skip to content

Commit

Permalink
Remove friend declarations for supporting rank/select indices
Browse files Browse the repository at this point in the history
  • Loading branch information
kurpicz committed Sep 5, 2024
1 parent 376572c commit dca3ba0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
20 changes: 0 additions & 20 deletions include/pasta/bit_vector/bit_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,6 @@ class BitAccess {
* \c std::vector<bool>).
*/
class BitVector {
private:
//! Forward declaration.
template <OptimizedFor o, typename v>
friend class Rank;
//! Forward declaration.
template <OptimizedFor o, typename v>
friend class FlatRank;
//! Forward declaration.
template <OptimizedFor o, typename v>
friend class WideRank;
//! Forward declaration.
template <OptimizedFor o, typename v>
friend class RankSelect;
//! Forward declaration.
template <OptimizedFor o, FindL2FlatWith f, typename v>
friend class FlatRankSelect;
//! Forward declaration.
template <OptimizedFor o, FindL2WideWith f, typename v>
friend class WideRankSelect;

public:
//! Type that is used to store the raw data of the bit vector.
using RawDataType = uint64_t;
Expand Down
4 changes: 2 additions & 2 deletions include/pasta/bit_vector/support/flat_rank.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class FlatRank {
* \param bv Vector of \c VectorType the rank structure is created for.
*/
FlatRank(VectorType& bv)
: data_size_(bv.size_),
data_(bv.data_.data()),
: data_size_(bv.data().size()),
data_(bv.data().data()),
l12_((data_size_ / FlatRankSelectConfig::L1_WORD_SIZE) + 1) {
init();
}
Expand Down
4 changes: 2 additions & 2 deletions include/pasta/bit_vector/support/rank.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Rank {
* for.
*/
Rank(VectorType& bv)
: data_size_(bv.size_),
data_(bv.data_.data()),
: data_size_(bv.data().size()),
data_(bv.data().data()),
bit_size_(bv.size()),
l0_((data_size_ / PopcntRankSelectConfig::L0_WORD_SIZE) + 2),
l12_((data_size_ / PopcntRankSelectConfig::L1_WORD_SIZE) + 1) {
Expand Down
4 changes: 2 additions & 2 deletions include/pasta/bit_vector/support/wide_rank.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class WideRank {
* \param bv Vector of type \c VectorType the rank structure is created for.
*/
WideRank(VectorType& bv)
: data_size_(bv.size_),
data_(bv.data_.data()),
: data_size_(bv.data().size()),
data_(bv.data().data()),
l1_((data_size_ / WideRankSelectConfig::L1_WORD_SIZE) + 1),
l2_((data_size_ / WideRankSelectConfig::L2_WORD_SIZE) + 1) {
init();
Expand Down

0 comments on commit dca3ba0

Please sign in to comment.