| 1 |
%module BloomFilter |
| 2 |
%include "std_string.i" |
| 3 |
%include "stdint.i" |
| 4 |
%include "std_vector.i" |
| 5 |
/*%apply const uint64_t& { uint64_t & };*/ |
| 6 |
/*%apply uint64_t& INOUT {uint64_t& fhVal, uint64_t& rhVal};*/ |
| 7 |
namespace std { |
| 8 |
%template(SizetVector) vector<size_t>; |
| 9 |
} |
| 10 |
|
| 11 |
%{ |
| 12 |
#include "../KmerBloomFilter.hpp" |
| 13 |
#include "../vendor/ntHashIterator.hpp" |
| 14 |
#include "../BloomFilterUtil.h" |
| 15 |
%} |
| 16 |
|
| 17 |
%rename(BloomFilter) KmerBloomFilter; |
| 18 |
|
| 19 |
using namespace std; |
| 20 |
|
| 21 |
class KmerBloomFilter { |
| 22 |
public: |
| 23 |
KmerBloomFilter(); |
| 24 |
~KmerBloomFilter(); |
| 25 |
KmerBloomFilter(uint64_t filterSize, unsigned hashNum, unsigned kmerSize); |
| 26 |
KmerBloomFilter(const string &filterFilePath); |
| 27 |
|
| 28 |
void insert(vector<uint64_t> const &precomputed); |
| 29 |
void insert(const char* kmer); |
| 30 |
|
| 31 |
bool contains(vector<uint64_t> const &values); |
| 32 |
bool contains(const char* kmer); |
| 33 |
|
| 34 |
void storeFilter(string const &filterFilePath); |
| 35 |
uint64_t getPop(); |
| 36 |
unsigned getHashNum(); |
| 37 |
unsigned getKmerSize(); |
| 38 |
uint64_t getFilterSize(); |
| 39 |
}; |
| 40 |
|
| 41 |
/* |
| 42 |
class ntHashIterator { |
| 43 |
public: |
| 44 |
ntHashIterator(); |
| 45 |
~ntHashIterator(); |
| 46 |
ntHashIterator(const string& seq, unsigned numHashes, unsigned k); |
| 47 |
|
| 48 |
const uint64_t* operator*(); |
| 49 |
const uint64_t* operator->(); |
| 50 |
|
| 51 |
bool operator==(const ntHashIterator& it); |
| 52 |
bool operator!=(const ntHashIterator& it); |
| 53 |
|
| 54 |
ntHashIterator& operator++(); |
| 55 |
static const ntHashIterator end(); |
| 56 |
}; |
| 57 |
*/ |
| 58 |
|
| 59 |
void insertSeq(KmerBloomFilter &bloom, const string& seq, unsigned numHashes, unsigned k); |