Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FEATURE] Improve dna4 complement perf by 5%
Co-authored-by: Enrico Seiler <enrico.seiler@hotmail.de>
  • Loading branch information
smehringer and eseiler committed Oct 21, 2022
commit 50e66c06545365bc5bcb3f2c6a8c7e9e7446be81
6 changes: 6 additions & 0 deletions include/seqan3/alphabet/nucleotide/dna4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class dna4 : public nucleotide_base<dna4, 4>
}
//!\}

//!\brief Returns the complement of the current nucleotide.
constexpr dna4 complement() const noexcept
{
return dna4{}.assign_rank(to_rank() ^ 0b11);
}

private:
/*!\brief The lookup table used in #rank_to_char.
* \details
Expand Down