Commit b7ca7e1f authored by Haowen Zhang's avatar Haowen Zhang Committed by swiftgenomics
Browse files

Add more comment for khash in Index.

parent 25e218d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#include "temp_mapping.h"
#include "utils.h"

#define CHROMAP_VERSION "0.2.3-r424"
#define CHROMAP_VERSION "0.2.3-r426"

namespace chromap {

+6 −1
Original line number Diff line number Diff line
@@ -15,9 +15,14 @@

namespace chromap {

// Note that the max kmer size is 28 and it is saved in a unsigned 64-bit
// integer. So it can right shift by one bit is lossless and safe. The minimizer
// only occurs once when the lowest bit of the key value is set to 1.
#define KHashFunctionForIndex(a) ((a) >> 1)
#define KHashEqForIndex(a, b) ((a) >> 1 == (b) >> 1)
KHASH_INIT(k64, uint64_t, uint64_t, 1, KHashFunctionForIndex, KHashEqForIndex);
KHASH_INIT(/*name=*/k64, /*khkey_t=*/uint64_t, /*khval_t=*/uint64_t,
           /*kh_is_map=*/1, /*__hash_func=*/KHashFunctionForIndex,
           /*__hash_equal=*/KHashEqForIndex);

class Index {
 public: