16 alphabet_(alpha), content_(alpha->getResolvedChars().size(), 0)
22 alphabet_(alpha), content_(alpha->getResolvedChars().size(), 0)
29 alphabet_(alpha), content_(alpha->getResolvedChars().size(), 0)
38 alphabet_(list.getAlphabet()), content_(list.getContent())
42 alphabet_(list.alphabet_), content_(list.content_)
46 alphabet_(list.getAlphabet()), content_(list.getAlphabet()->getResolvedChars().size(), list.size())
48 size_t nbc =
getAlphabet()->getResolvedChars().size();
51 for (
size_t i = 0; i <
size(); ++i)
53 for (
size_t s = 0; s < nbc; ++s)
83 std::vector<std::string> column_names = list.
getRowNames();
84 std::vector<std::string> resolved_chars =
alphabet_->getResolvedChars();
87 if (column_names[i] != resolved_chars[i])
134 if (list.size() == 0)
152 std::vector<double> padded_element(element);
162 throw BadSizeException(
"ProbabilisticSymbolList::addElement: too long element: ",
177 std::vector<double> padded_element(element);
192 std::vector<double> padded_element(element);
The CruxSymbolList interface.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get the alphabet associated to the list.
virtual double getStateValueAt(size_t position, int state) const =0
get value of a state at a position
The ProbabilisticSymbolList interface.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
ProbabilisticSymbolList object.
ProbabilisticSymbolList & operator=(const ProbabilisticSymbolListInterface &list)
The generic assignment operator.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to the list.
DTable content_
The list content.
size_t size() const override
Get the number of elements in the list.
ProbabilisticSymbolList(std::shared_ptr< const Alphabet > &alpha)
Build a new void ProbabilisticSymbolList object with the specified alphabet.
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.
void setElement(size_t pos, const std::vector< double > &element) override
size_t getNumberOfColumns() const
void setRowNames(const std::vector< std::string > &rowNames)
void setColumn(const std::vector< T > &newColumn, size_t pos)
std::string getRowName(size_t index) const
std::vector< std::string > getRowNames()
void addColumn(const std::vector< T > &newColumn, int pos=-1)
size_t getNumberOfRows() const
virtual const std::vector< T > & getContent() const =0
std::string toString(T t)
This alphabet is used to deal NumericAlphabet.