46 #include "../Alphabet/AlphabetTools.h" 47 #include <Bpp/Numeric/NumTools.h> 51 MiyataAAChemicalDistance::MiyataAAChemicalDistance() :
52 distanceMatrix_(20, 20),
56 #include "__MiyataMatrixCode" 62 size_t stateIndex1 = alpha_->getStateIndex(state1);
63 size_t stateIndex2 = alpha_->getStateIndex(state2);
64 double d = distanceMatrix_(stateIndex1, stateIndex2);
65 return sym_ ? NumTools::abs<double>(d) : d;
71 double d = distanceMatrix_(
72 static_cast<size_t>(alpha_->charToInt(state1)),
73 static_cast<size_t>(alpha_->charToInt(state2)));
74 return sym_ ? NumTools::abs(d) : d;
82 for (
unsigned int i = 0; i < 20; i++)
84 for (
unsigned int j = 0; j < 20; j++)
86 (*m)(i, j) = NumTools::abs<double>((*m)(i, j));
An alphabet exception thrown when trying to specify a bad char to the alphabet.
This alphabet is used to deal NumericAlphabet.
Matrix< double > * getIndexMatrix() const
double getIndex(int state1, int state2) const
Get the index associated to a pair of states.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
LinearMatrix< double > distanceMatrix_