Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
5d75092b
Commit
5d75092b
authored
Jun 15, 2016
by
Mikaël Salson
Browse files
kmerstore.h: comparison operators for Kmer
Needed with the Aho-Corasick automaton (because of using a map)
parent
dcac324d
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/kmerstore.cpp
View file @
5d75092b
...
...
@@ -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
);
}
algo/core/kmerstore.h
View file @
5d75092b
...
...
@@ -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 */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment