40 #ifndef _SYMBOLLISTTOOLS_H_ 41 #define _SYMBOLLISTTOOLS_H_ 45 #include <Bpp/Numeric/VectorExceptions.h> 72 for(std::vector<int>::const_iterator seqit = list.
getContent().begin();
92 if(list1.size() != list2.size())
throw DimensionException(
"SymbolListTools::getCounts: the two sites must have the same size.", list1.size(), list2.size());
93 for(
size_t i = 0; i < list1.size(); i++)
94 counts[list1[i]][list2[i]]++;
109 static void getCounts(
const SymbolList& list, std::map<int, double>& counts,
bool resolveUnknowns);
128 static void getCounts(
const SymbolList& list1,
const SymbolList& list2, std::map<
int, std::map<int, double> >& counts,
bool resolveUnknowns)
throw (DimensionException);
139 static void getFrequencies(
const SymbolList& list, std::map<int, double>& frequencies,
bool resolveUnknowns =
false);
151 static void getFrequencies(
const SymbolList& list1,
const SymbolList& list2, std::map<
int, std::map<int, double> >& frequencies,
bool resolveUnknowns =
false) throw (DimensionException);
206 #endif // _SYMBOLLISTTOOLS_H_
The SymbolList interface.
This alphabet is used to deal NumericAlphabet.
The alphabet exception base class.
virtual const std::vector< int > & getContent() const =0
Get the whole content of the list as a vector of int.
Exception thrown when two alphabets do not match.