5 #ifndef BPP_PHYL_LIKELIHOOD_DATAFLOW_FORWARDLIKELIHOODTREE_H
6 #define BPP_PHYL_LIKELIHOOD_DATAFLOW_FORWARDLIKELIHOODTREE_H
27 return {nbState, nbSite};
123 std::shared_ptr<ProcessTree> tree,
152 std::shared_ptr<ProcessEdge> edge,
160 std::shared_ptr<ProcessNode> node,
167 const std::string& sequenceName,
258 return getNode(nodeId)->targetValue();
263 return getEdge(edgeId)->targetValue();
void rootAt(const std::shared_ptr< N > root)
AssociationGraphObserver< N, E >::EdgeIndex EdgeIndex
AssociationGraphObserver< N, E >::NodeIndex NodeIndex
virtual std::shared_ptr< N > getNode(NodeIndex nodeIndex) const=0
virtual void deleteNode(std::shared_ptr< N > nodeObject)=0
virtual std::shared_ptr< N > getRoot() const=0
virtual std::shared_ptr< E > getEdge(EdgeIndex edgeIndex) const=0
virtual void createNode(std::shared_ptr< N > newNodeObject)=0
static std::shared_ptr< Self > create(Context &c, const Dimension< T > &dim)
Build a new ConstantZero node of the given dimension.
Context for dataflow node construction.
MatrixDimension likelihoodMatrixDim_
void initialize(const AlignmentDataInterface &sites)
std::shared_ptr< ProcessTree > processTree_
ForwardLikelihoodTree(Context &c, std::shared_ptr< ProcessTree > tree, const StateMapInterface &statemap)
ConditionalLikelihoodForwardRef makeInitialConditionalLikelihood(const std::string &sequenceName, const AlignmentDataInterface &sites)
Compute ConditionalLikelihood for leaf.
const StateMapInterface & statemap_
std::map< Speciesindex, DAGindexes > mapNodesIndexes_
const ValueRef< MatrixLik > getForwardLikelihoodArray(uint nodeId) const
const ValueRef< MatrixLik > getForwardLikelihoodArrayAtRoot() const
ForwardLikelihoodBelowRef makeForwardLikelihoodAtEdge(std::shared_ptr< ProcessEdge > edge, const AlignmentDataInterface &sites)
Compute ConditionalLikelihood after reading edge on the forward process (ie at top of the edge).
std::shared_ptr< const ProcessTree > getProcessTree() const
std::map< Speciesindex, DAGindexes > mapEdgesIndexes_
const DAGindexes & getDAGEdgesIndexes(const Speciesindex speciesIndex) const
void setSpeciesMapIndexes_()
Map the species indexes and the likelihood DAG indexes.
ConditionalLikelihoodForwardRef makeForwardLikelihoodAtNode(std::shared_ptr< ProcessNode > node, const AlignmentDataInterface &sites)
const DAGindexes & getDAGNodesIndexes(const Speciesindex speciesIndex) const
double getProbaAtNode(PhyloTree::NodeIndex nodeId)
ProbaRef makeProbaAtNode_(PhyloTree::EdgeIndex edgeIndex, std::shared_ptr< ForwardLikelihoodTree > tree)
double getProbaAtEdge(PhyloTree::EdgeIndex edgeId)
ProbabilityDAG(std::shared_ptr< ForwardLikelihoodTree > tree)
ProbaRef makeProbaAtEdge_(PhyloTree::EdgeIndex edgeIndex, std::shared_ptr< ForwardLikelihoodTree > tree)
computation of the probabilities with the same approach as for BackwardLikelihoodTree.
Map the states of a given alphabet which have a model state.
virtual size_t getNumberOfSites() const=0
Defines the basic types of data flow nodes.
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
std::vector< uint > DAGindexes
Helper: create a map with mutable dataflow nodes for each branch of the tree. The map is indexed by b...
ValueRef< MatrixLik > ConditionalLikelihoodForwardRef
Dimension< TransitionFunction > transitionFunctionDimension(Eigen::Index nbState)
MatrixDimension conditionalLikelihoodDimension(Eigen::Index nbState, Eigen::Index nbSite)
std::shared_ptr< Value< double > > ProbaRef
ValueRef< MatrixLik > ForwardLikelihoodBelowRef
Basic matrix dimension type.