5 #ifndef BPP_PHYL_MAPPING_PROBABILISTICSUBSTITUTIONMAPPING_H
6 #define BPP_PHYL_MAPPING_PROBABILISTICSUBSTITUTIONMAPPING_H
10 #include "../Likelihood/DataFlow/DataFlowCWise.h"
74 for ( ; !nIT->end(); nIT->next())
88 for ( ; !nIT->end(); nIT->next())
150 double getCount(
unsigned int branchId,
size_t site,
size_t type)
const
155 const std::vector<double>&
getCounts(
unsigned int branchId,
size_t site)
const
172 double&
operator()(
unsigned int branchId,
size_t siteIndex,
size_t type)
override
174 return (*
getEdge(branchId))(siteIndex, type);
195 virtual const double&
operator()(
unsigned int branchId,
size_t siteIndex,
size_t type)
const override
197 return (*
getEdge(branchId))(siteIndex, type);
Partial implementation of the mapping interface.
Partial implementation of the substitution mapping interface.
AbstractSubstitutionMapping & operator=(const AbstractSubstitutionMapping &absm)
size_t getNumberOfEdges() const
virtual std::unique_ptr< EdgeIterator > allEdgesIterator()=0
virtual std::shared_ptr< E > getEdge(EdgeIndex edgeIndex) const=0
AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > & operator=(bpp::AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > const &treeGraphObserver)
Data storage class for probabilistic substitution mappings.
ProbabilisticSubstitutionMapping * clone() const override
const std::vector< double > & getCounts(unsigned int branchId, size_t site) const
PhyloBranchMapping & getBranch(unsigned int branchIndex) override
ProbabilisticSubstitutionMapping(const ProbabilisticSubstitutionMapping &psm)
PatternType rootPatternLinks_
Links between sites and patterns.
ProbabilisticSubstitutionMapping(const PhyloTree &tree, size_t nbTypes, size_t numberOfSites)
Build a new ProbabilisticSubstitutionMapping object.
virtual const double & operator()(unsigned int branchId, size_t siteIndex, size_t type) const override
Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes)
const PhyloBranchMapping & getBranch(unsigned int branchIndex) const override
const PatternType getPatterns() const
returns the vector of site patterns
size_t getNumberOfDistinctSites() const
bool usePatterns() const
Does it use site patterns?
ProbabilisticSubstitutionMapping(const PhyloTree &tree)
Build a new ProbabilisticSubstitutionMapping object.
void setNumberOfSites(size_t numberOfSites) override
void setNumberOfSitesAndTypes(size_t numberOfSites, size_t numberOfTypes)
AssociationTreeGlobalGraphObserver< PhyloNode, PhyloBranchMapping > mapTree
double & operator()(unsigned int branchId, size_t siteIndex, size_t type) override
Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes)
void setNumberOfSubstitutionTypes(size_t numberOfTypes) override
void fillMappingVectorForSite(size_t siteIndex, VVdouble &counts) const
Fill a VVdouble with the counts at a given site. The 1st coordinate of this VVdouble correspond to ed...
mapTree::NodeIterator NodeIterator
double getCount(unsigned int branchId, size_t site, size_t type) const
Retrieve the counts, with REAL site positions.
virtual ~ProbabilisticSubstitutionMapping()
size_t numberOfDistinctSites_
ProbabilisticSubstitutionMapping(const PhyloTree &tree, size_t nbTypes, const PatternType &rootpatterns, size_t nbDistinctSites)
the same with rootPatternLinks
mapTree::EdgeIterator EdgeIterator
ProbabilisticSubstitutionMapping & operator=(const ProbabilisticSubstitutionMapping &psm)
const size_t getSiteIndex(size_t site) const
size_t getNumberOfBranches() const override
Defines the basic types of data flow nodes.
Eigen::Matrix< size_t, -1, 1 > PatternType
std::vector< Vdouble > VVdouble