From c516da317fcb2fe3e2c3e92425aa5355c428dfb9 Mon Sep 17 00:00:00 2001 From: Yuri Pirola Date: Wed, 1 Jul 2020 17:08:24 +0200 Subject: [PATCH] Remove unused code --- BloomfilterFiller.hpp | 2 +- bloomfilter.h | 31 +++++-------------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/BloomfilterFiller.hpp b/BloomfilterFiller.hpp index e7a972b..e14f43c 100644 --- a/BloomfilterFiller.hpp +++ b/BloomfilterFiller.hpp @@ -39,7 +39,7 @@ class BloomfilterFiller { { std::lock_guard lock(mtx); for(const auto p : *positions) { - bf->add_at(p % bf->_size); + bf->add_at(p); } } delete positions; diff --git a/bloomfilter.h b/bloomfilter.h index 590a0c3..66f62fa 100644 --- a/bloomfilter.h +++ b/bloomfilter.h @@ -31,21 +31,14 @@ #include "small_vector.hpp" using namespace std; -using namespace sdsl; - -class KmerBuilder; -class BloomfilterFiller; class BF { - friend class KmerBuilder; - friend class BloomfilterFiller; - public: typedef uint64_t kmer_t; typedef uint64_t hash_t; - typedef bit_vector bit_vector_t; + typedef sdsl::bit_vector bit_vector_t; typedef bit_vector_t::rank_1_type rank_t; typedef small_vector_t index_t; typedef vector set_index_t; @@ -62,21 +55,7 @@ class BF { ~BF() {} void add_at(const uint64_t p) { - _bf[p] = 1; - } - - // Function to add a k-mer to the BF - void add_kmer(const kmer_t kmer) { - if (_mode == 0) { - uint64_t hash = _get_hash(kmer); - _bf[hash % _size] = 1; - } - } - - // Function to test if a k-mer is in the BF - bool test_kmer(const uint64_t &kmer) const { - uint64_t hash = _get_hash(kmer); - return _bf[hash % _size]; + _bf[p % _size] = 1; } void add_to_kmer(vector &kmers, const int input_idx) { @@ -139,7 +118,7 @@ class BF { * function. **/ _mode = new_mode; - util::init_support(_brank,&_bf); + sdsl::util::init_support(_brank,&_bf); size_t num_kmer = _brank(_bf.size()); if (num_kmer != 0) _set_index.resize(num_kmer, index_t()); @@ -160,13 +139,13 @@ class BF { * data structure for the int_vector that store the * concatenation of all the sets. **/ - _bv = bit_vector(tot_idx, 0); + _bv = bit_vector_t(tot_idx, 0); int pos = -1; for (const auto &set : _set_index) { pos += set.size(); _bv[pos] = 1; } - util::init_support(_select_bv,&_bv); + sdsl::util::init_support(_select_bv,&_bv); /** * We merge the idxs associated to each kmer into a single