Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
yp committed Jul 2, 2020
1 parent bd93aa9 commit c516da3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion BloomfilterFiller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BloomfilterFiller {
{
std::lock_guard<std::mutex> lock(mtx);
for(const auto p : *positions) {
bf->add_at(p % bf->_size);
bf->add_at(p);
}
}
delete positions;
Expand Down
31 changes: 5 additions & 26 deletions bloomfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<index_t> set_index_t;
Expand All @@ -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<uint64_t> &kmers, const int input_idx) {
Expand Down Expand Up @@ -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());
Expand All @@ -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
Expand Down

0 comments on commit c516da3

Please sign in to comment.