49 SimpleScore::SimpleScore(
const Alphabet* alphabet,
double match,
double mismatch) :
50 distanceMatrix_(alphabet->getSize(), alphabet->getSize()),
55 for (
size_t i = 0; i < n; ++i)
57 for (
size_t j = 0; j < n; ++j)
67 size_t stateIndex1 = alphabet_->getStateIndex(state1);
68 size_t stateIndex2 = alphabet_->getStateIndex(state2);
69 return distanceMatrix_(stateIndex1, stateIndex2);
75 size_t stateIndex1 = alphabet_->getStateIndex(state1);
76 size_t stateIndex2 = alphabet_->getStateIndex(state2);
77 return distanceMatrix_(stateIndex1, stateIndex2);
An alphabet exception thrown when trying to specify a bad char to the alphabet.
LinearMatrix< double > * getIndexMatrix() const
This alphabet is used to deal NumericAlphabet.
const Alphabet * alphabet_
virtual unsigned int getSize() const =0
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet). This is the method you'll need in most cases.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
double getIndex(int state1, int state2) const
Get the index associated to a pair of states.
LinearMatrix< double > distanceMatrix_