5 #ifndef BPP_PHYL_LIKELIHOOD_MARGINALANCESTRALRECONSTRUCTION_H
6 #define BPP_PHYL_LIKELIHOOD_MARGINALANCESTRALRECONSTRUCTION_H
9 #include "../AncestralStateReconstruction.h"
33 std::shared_ptr<LikelihoodCalculationSingleProcess>
likelihood_;
34 std::shared_ptr<const ParametrizablePhyloTree>
tree_;
45 tree_ (drl->substitutionProcess().getParametrizablePhyloTree()),
49 nbStates_ (drl->stateMap().getNumberOfModelStates()),
53 throw Exception(
"MarginalAncestralReconstruction::MarginalAncestralReconstruction: missing ParametrizablePhyloTree.");
152 const std::shared_ptr<PhyloNode> node,
153 std::map<uint, std::vector<size_t>>& ancestors,
Interface for ancestral states reconstruction methods.
Likelihood ancestral states reconstruction: marginal method.
std::unique_ptr< AlignedSequenceContainer > getAncestralSequences() const override
Get all the ancestral sequences for all nodes.
MarginalAncestralReconstruction(std::shared_ptr< LikelihoodCalculationSingleProcess > drl)
std::shared_ptr< const Alphabet > alphabet_
std::vector< size_t > getAncestralStatesForNode(uint nodeId) const override
Get ancestral states for a given node as a vector of int.
std::unique_ptr< Sequence > getAncestralSequenceForNode(uint nodeId) const override
Get the ancestral sequence for a given node.
MarginalAncestralReconstruction * clone() const
MarginalAncestralReconstruction(const MarginalAncestralReconstruction &masr)
void recursiveMarginalAncestralStates(const std::shared_ptr< PhyloNode > node, std::map< uint, std::vector< size_t >> &ancestors, AlignmentDataInterface &data) const
virtual ~MarginalAncestralReconstruction()
std::shared_ptr< const ParametrizablePhyloTree > tree_
std::shared_ptr< const Alphabet > getAlphabet() const
MarginalAncestralReconstruction & operator=(const MarginalAncestralReconstruction &masr)
std::unique_ptr< Sequence > getAncestralSequenceForNode(uint nodeId, VVdouble *probs, bool sample) const
Get an ancestral sequence for a given node.
std::shared_ptr< LikelihoodCalculationSingleProcess > likelihood_
std::map< uint, std::vector< size_t > > getAllAncestralStates() const override
Get all ancestral states for all nodes.
PatternType rootPatternLinks_
std::vector< size_t > getAncestralStatesForNode(uint nodeId, VVdouble &probs, bool sample) const
Get ancestral states for a given node as a vector of int.
Defines the basic types of data flow nodes.
Eigen::Matrix< size_t, -1, 1 > PatternType
std::vector< Vdouble > VVdouble