5 #ifndef BPP_SEQ_PROBABILISTICSYMBOLLIST_H
6 #define BPP_SEQ_PROBABILISTICSYMBOLLIST_H
103 ProbabilisticSymbolList(
const std::vector< std::vector<double>>& list, std::shared_ptr<const Alphabet>& alpha);
148 void setContent(
const std::vector<std::vector<double>>& list)
override;
159 std::string
toString()
const override;
161 void addElement(
const std::vector<double>& element)
override;
163 void addElement(
size_t pos,
const std::vector<double>& element)
override;
165 void setElement(
size_t pos,
const std::vector<double>& element)
override;
167 const std::vector<double>&
getElement(
size_t pos)
const override
182 const std::vector<std::vector<double>>&
getContent()
const override
192 const std::vector<double>&
getValue(
size_t pos)
const override
197 const std::vector<double>&
operator[](
size_t pos)
const override
214 double operator()(
size_t siteIndex,
int state)
const override
221 throw Exception(
"ProbabilisticSymbolList::shuffle not implemented, yet.");
The CruxSymbolList interface.
The ProbabilisticSymbolList interface.
virtual ~ProbabilisticSymbolListInterface()
ProbabilisticSymbolListInterface()
virtual const DTable & getTable() const =0
virtual void setContent(const DTable &list)=0
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
std::vector< double > SymbolType
ProbabilisticSymbolList object.
virtual ~ProbabilisticSymbolList()
double operator()(size_t siteIndex, int state) const override
get value of a state at a position
virtual void deleteElement(size_t pos) override
Remove the element at position 'pos'.
ProbabilisticSymbolList & operator=(const ProbabilisticSymbolListInterface &list)
The generic assignment operator.
const std::vector< double > & getElement(size_t pos) const override
Get the element at position 'pos' as a character.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to the list.
DTable content_
The list content.
ProbabilisticSymbolList * clone() const override
double getStateValueAt(size_t siteIndex, int state) const override
get value of a state at a position
size_t size() const override
Get the number of elements in the list.
const std::vector< double > & operator[](size_t pos) const override
Operator [] overloaded for quick access to a character in list.
ProbabilisticSymbolList(std::shared_ptr< const Alphabet > &alpha)
Build a new void ProbabilisticSymbolList object with the specified alphabet.
std::vector< double > & operator[](size_t pos) override
Operator [] overloaded for quick access to a character in list.
virtual void deleteElements(size_t pos, size_t len) override
Remove the elements at position 'pos'.
const std::vector< std::vector< double > > & getContent() const override
void addElement(const std::vector< double > &element) override
std::string toString() const override
Convert the list as a string.
std::shared_ptr< const Alphabet > alphabet_
The Alphabet attribute must be initialized in the constructor and then can never be changed.
const DTable & getTable() const override
void setElement(size_t pos, const std::vector< double > &element) override
const Alphabet & alphabet() const override
Get the alphabet associated to the list.
void shuffle() override
Randomly shuffle the content of the list, with linear complexity.
const std::vector< double > & getValue(size_t pos) const override
checked access to a character in list.
size_t getNumberOfColumns() const
std::vector< T > & getColumn(size_t index)
void deleteColumn(size_t index)
const std::vector< std::vector< T > > & getData() const
void deleteColumns(size_t index, size_t len)
The CoreSymbolList interface.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
This alphabet is used to deal NumericAlphabet.