You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maps[m] = new ParallelMap(0, KeyHasher(seqBuf[m].seq, prefix, k), KeyEqualTo(seqBuf[m].seq, prefix, k));
And:
struct KeyHasher {
uint8_t prefix;
uint32_t k;
uint64_t* pows;
Buf2bit<> *seqBuf;
KeyHasher() {}
KeyHasher(Buf2bit<> *seqBuf, uint8_t prefix, uint32_t k) : prefix(prefix), k(k), seqBuf(seqBuf) {
pows = new uint64_t[prefix];
for(uint8_t p = 0; p<prefix; ++p) // precomputes the powers of k
pows[p] = (uint64_t) pow(4,p);
}
std::size_t operator()(const Key& key) const {
uint64_t fw = 0, rv = 0, offset = key.getKmer(); // hashes for both forward and reverse complement sequence
for(uint8_t c = 0; c<prefix; ++c) { // for each position up to prefix len
fw += seqBuf->at(offset+c) * pows[c]; // base * 2^N
rv += (3-seqBuf->at(offset+k-1-c)) * pows[c]; // we walk the kmer backward to compute the rvcp
}
// return fw < rv ? 0 : 0; // even if they end up in the same bucket it's fine!
return fw < rv ? fw : rv;
}
};
Hi @greg7mdp
I was looking here #125
And I thought I could use the same syntax for parallel_hash_map but it doesn't work:
What is the right syntax?
Thanks!!
The text was updated successfully, but these errors were encountered: