From 615405ae7a95bf9f9453f67e26275cb8d9616527 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 4 Mar 2014 15:48:11 -0500 Subject: fakehash --- kmer_utils.c | 14 +++++++++++++- kmer_utils.h | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/kmer_utils.c b/kmer_utils.c index 8f2f324..b96f831 100644 --- a/kmer_utils.c +++ b/kmer_utils.c @@ -8,7 +8,19 @@ using namespace std; -typedef unordered_map kmer_map; +typedef struct { + size_t operator() (const size_t &k) const { + return k; + } +} kmer_noHash_hash; + +typedef struct { + bool operator() (const size_t &x, const size_t &y) const { + return x == y; + } +} kmer_eq; + +typedef unordered_map kmer_map; const unsigned char alpha[256] = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, diff --git a/kmer_utils.h b/kmer_utils.h index 10d7ea4..a9d9a1d 100644 --- a/kmer_utils.h +++ b/kmer_utils.h @@ -11,7 +11,20 @@ size_t strnstrip(char *s, int c, size_t len); unsigned long long pow_four(unsigned long long x); // Variables -typedef unordered_map kmer_map; +typedef struct { + size_t operator() (const size_t &k) const { + return k; + } +} kmer_noHash_hash; + +typedef struct { + bool operator() (const size_t &x, const size_t &y) const { + return x == y; + } +} kmer_eq; + +typedef unordered_map kmer_map; + unsigned char alpha[256]; // file loading functions kmer_map *get_sparse_kmer_counts_from_filename(const char *fn, const unsigned int kmer); -- cgit v1.2.3