INNER CODE UNIT · C++
eq_comparer
refresh-bio/FAMSA · src/msa.cpp:340
auto eq_comparer = [](const CSequence* a, const CSequence* b)->bool {
return a->length == b->length && std::equal(a->data, a->data + a->length, b->data);
};
// update original2sorted mappings to take into account duplicates
int cur_sorted_index = 0;
for (int i = 1; i < (int)sorted_seqs.size(); ++i) {
if (!eq_comparer(sorted_seqs[i], sorted_seqs[i - 1])) {
++cur_sorted_index;
}
original2sorted[i] = cur_sorted_index;
}
auto newend = std::unique(sorted_seqs.begin(), sorted_seqs.end(), eq_comparer);
sorted_seqs.erase(newend, sorted_seqs.end());
}