5 #ifndef BPP_SEQ_ALPHABETINDEX_SIMPLEINDEXDISTANCE_H
6 #define BPP_SEQ_ALPHABETINDEX_SIMPLEINDEXDISTANCE_H
14 #include "../Alphabet/AlphabetExceptions.h"
31 std::shared_ptr<AlphabetIndex1>
index_;
65 double getIndex(
int state1,
int state2)
const override
70 double getIndex(
const std::string& state1,
const std::string& state2)
const override
75 std::shared_ptr<const Alphabet>
getAlphabet()
const override {
return index_->getAlphabet(); }
86 for (
size_t i = 0; i <
size_; ++i)
88 for (
size_t j = 0; j <
size_; ++j)
91 if (
sym_) d = NumTools::abs<double>(d);
Two dimensionnal alphabet index interface.
Simple dissimilarity distance.
void computeIndexMatrix_()
virtual ~SimpleIndexDistance()
RowMatrix< double > indexMatrix_
std::shared_ptr< const AlphabetIndex1 > getAlphabetIndex1() const
const Matrix< double > & getIndexMatrix() const override
double getIndex(int state1, int state2) const override
Get the index associated to a pair of states.
const Alphabet & alphabet() const override
Get the alphabet associated to this index.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to this index.
bool isSymmetric() const override
SimpleIndexDistance(std::shared_ptr< AlphabetIndex1 > index)
std::shared_ptr< AlphabetIndex1 > index_
SimpleIndexDistance & operator=(const SimpleIndexDistance &sid)
double getIndex(const std::string &state1, const std::string &state2) const override
Get the index associated to a pair of states.
SimpleIndexDistance * clone() const override
SimpleIndexDistance(const SimpleIndexDistance &sid)
void setSymmetric(bool yn)
This alphabet is used to deal NumericAlphabet.