Commit 08bc75c1 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

KmerAffect: Length ~0 is ignored in comparison

This makes possible to compare affectations regardless of their length.
parent 9b256a64
......@@ -41,7 +41,7 @@ size_t affect_length(const affect_t &affect) {
bool operator==(const affect_t &a1, const affect_t &a2) {
return a1.c == a2.c &&
(affect_char(a1) == AFFECT_AMBIGUOUS_CHAR || affect_char(a1) == AFFECT_UNKNOWN_CHAR
||a1.length == a2.length);
|| a1.length == (unsigned char) ~0 || a2.length == (unsigned char)~0 || a1.length == a2.length);
}
bool operator<(const affect_t &a1, const affect_t &a2) {
return a1.c < a2.c;
......
......@@ -84,7 +84,7 @@ public:
* @post affect_strand(affect) == strand AND affect_char(affect) == kmer[0] AND
* affect_length(affect) == length
*/
KmerAffect(const string &label, int strand, size_t length);
KmerAffect(const string &label, int strand, size_t length=~0);
/**
* Add another affectation to the current one.
......@@ -192,11 +192,11 @@ const KmerAffect AFFECT_UNKNOWN = KmerAffect(AFFECT_UNKNOWN_SYMBOL, 0, 1);
*/
const KmerAffect AFFECT_AMBIGUOUS = KmerAffect(AFFECT_AMBIGUOUS_SYMBOL, 1, 1);
const KmerAffect AFFECT_V = KmerAffect("V", 1, 1);
const KmerAffect AFFECT_J = KmerAffect("J", 1, 1);
const KmerAffect AFFECT_V = KmerAffect("V", 1);
const KmerAffect AFFECT_J = KmerAffect("J", 1);
const KmerAffect AFFECT_V_BWD = KmerAffect("V", -1, 1);
const KmerAffect AFFECT_J_BWD = KmerAffect("J", -1, 1);
const KmerAffect AFFECT_V_BWD = KmerAffect("V", -1);
const KmerAffect AFFECT_J_BWD = KmerAffect("J", -1);
////////////////////////////////////////////////////////////////////////////////////////////////////
......
Supports Markdown
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