size_t getNumberOfDistinctPositionsWithoutGap(const SymbolList& l1, const SymbolList& l2) { if (l1.getAlphabet()->getAlphabetType() != l2.getAlphabet()->getAlphabetType()) throw AlphabetMismatchException("SymbolListTools::getNumberOfDistinctPositions.", l1.getAlphabet(), l2.getAlphabet()); const Alphabet* alpha = l1.getAlphabet(); int gapCode = alpha->getGapCharacterCode(); size_t n = min(l1.size(), l2.size()); size_t count = 0; for (size_t i = 0; i < n; i++) { int x = l1[i]; int y = l2[i]; if (alpha->isUnresolved(x)) x = gapCode; if (alpha->isUnresolved(x)) y = gapCode; if (x != gapCode && y != gapCode && x != y) count++; } return count; }
BasicSymbolList::BasicSymbolList(const SymbolList& list): alphabet_(list.getAlphabet()), content_(list.getContent()) {}
EdSymbolList::EdSymbolList(const SymbolList& list): alphabet_(list.getAlphabet()), propagateEvents_(true), content_(list.getContent()), listeners_() {}