5 #ifndef BPP_SEQ_ALPHABETINDEX_CODONFROMPROTEICALPHABETINDEX2_H
6 #define BPP_SEQ_ALPHABETINDEX_CODONFROMPROTEICALPHABETINDEX2_H
10 #include "../Alphabet/CodonAlphabet.h"
11 #include "../GeneticCode/GeneticCode.h"
25 std::shared_ptr<const CodonAlphabet>
alpha_;
41 throw Exception(
"CodonFromProteicAlphabetIndex2: Not a Proteic Alphabet for CodonAlphabetIndex2.");
67 double getIndex(
int state1,
int state2)
const override
72 double getIndex(
const std::string& state1,
const std::string& state2)
const override
98 void fillIndex_(std::shared_ptr<const AlphabetIndex2>& protAlphIndex_)
100 for (
int i = 0; i < 64; i++)
102 for (
int j = 0; j < 64; j++)
Two dimensionnal alphabet index interface.
double getIndex(int state1, int state2) const override
Get the index associated to a pair of states.
std::shared_ptr< const GeneticCode > gencode_
CodonFromProteicAlphabetIndex2 * clone() const override
CodonFromProteicAlphabetIndex2(std::shared_ptr< const GeneticCode > gencode, std::shared_ptr< const AlphabetIndex2 > protalphindex)
LinearMatrix< double > vIndex_
std::shared_ptr< const CodonAlphabet > alpha_
bool isSymmetric() const override
const Matrix< double > & getIndexMatrix() const override
void fillIndex_(std::shared_ptr< const AlphabetIndex2 > &protAlphIndex_)
virtual ~CodonFromProteicAlphabetIndex2()
CodonFromProteicAlphabetIndex2(const CodonFromProteicAlphabetIndex2 &cfp)
double getIndex(const std::string &state1, const std::string &state2) const override
Get the index associated to a pair of states.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to this index.
CodonFromProteicAlphabetIndex2 & operator=(const CodonFromProteicAlphabetIndex2 &cfp)
const Alphabet & alphabet() const override
Get the alphabet associated to this index.
This alphabet is used to deal NumericAlphabet.