5 #ifndef BPP_SEQ_ALPHABETINDEX_USERALPHABETINDEX1_H 6 #define BPP_SEQ_ALPHABETINDEX_USERALPHABETINDEX1_H 23 std::shared_ptr<const Alphabet>
alph_;
29 index_(alph->getSize(), 0)
51 return index_[alph_->getStateIndex(state) - 1];
56 index_[alph_->getStateIndex(state) - 1] = val;
59 double getIndex(
const std::string& state)
const 61 return index_[alph_->getStateIndex(state) - 1];
64 void setIndex(
const std::string& state,
double val)
66 index_[alph_->getStateIndex(state) - 1] = val;
76 #endif // BPP_SEQ_ALPHABETINDEX_USERALPHABETINDEX1_H std::vector< double > index_
double getIndex(int state) const
Get the index associated to a state.
std::shared_ptr< const Alphabet > alph_
This alphabet is used to deal NumericAlphabet.
const Alphabet & alphabet() const
Get the alphabet associated to this index.
virtual ~UserAlphabetIndex1()
UserAlphabetIndex1(std::shared_ptr< const Alphabet > alph)
UserAlphabetIndex1 * clone() const override
std::shared_ptr< const Alphabet > getAlphabet() const
Get the alphabet associated to this index.
const std::vector< double > & indexVector() const
double getIndex(const std::string &state) const
Get the index associated to a state.
One dimensionnal alphabet index interface.
UserAlphabetIndex1 & operator=(const UserAlphabetIndex1 &uAlph)
UserAlphabetIndex1(const UserAlphabetIndex1 &uAlph)
Alphabet index given by user.
void setIndex(int state, double val)
void setIndex(const std::string &state, double val)