Commit 5d75092b authored by Mikaël Salson's avatar Mikaël Salson

kmerstore.h: comparison operators for Kmer

Needed with the Aho-Corasick automaton (because of using a map)
parent dcac324d
......@@ -63,4 +63,27 @@ ostream &operator<<(ostream &os, const Kmer &kmer) {
return os;
}
bool operator==(const Kmer &k1, const Kmer &k2) {
return k1.count == k2.count;
}
bool operator<(const Kmer &k1, const Kmer &k2) {
return k1.count < k2.count;
}
bool operator>(const Kmer &k1, const Kmer &k2) {
return k1.count > k2.count;
}
bool operator<=(const Kmer &k1, const Kmer &k2) {
return ! (k1 > k2);
}
bool operator>=(const Kmer &k1, const Kmer &k2) {
return ! (k1 < k2);
}
bool operator!=(const Kmer &k1, const Kmer &k2) {
return ! (k1 == k2);
}
......@@ -48,6 +48,13 @@ public:
bool isUnknown() const;
} ;
ostream &operator<<(ostream &os, const Kmer &kmer);
bool operator==(const Kmer &k1, const Kmer &k2);
bool operator<(const Kmer &k1, const Kmer &k2);
bool operator>(const Kmer &k1, const Kmer &k2);
bool operator<=(const Kmer &k1, const Kmer &k2);
bool operator>=(const Kmer &k1, const Kmer &k2);
bool operator!=(const Kmer &k1, const Kmer &k2);
/* K-mer indexing */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment