5 #ifndef _LEGACY_MARGINAL_ANCESTRAL_STATES_RECONSTRUCTION_H_
6 #define _LEGACY_MARGINAL_ANCESTRAL_STATES_RECONSTRUCTION_H_
8 #include "../AncestralStateReconstruction.h"
39 std::vector<double>
r_;
40 std::vector<double>
l_;
47 nbSites_ (drl->likelihoodData().getNumberOfSites()),
49 nbClasses_ (drl->likelihoodData().getNumberOfClasses()),
50 nbStates_ (drl->likelihoodData().getNumberOfStates()),
52 r_ (drl->rateDistribution().getProbabilities()),
53 l_ (drl->likelihoodData().getRootRateSiteLikelihoodArray())
118 std::map<
int, std::vector<size_t>>& ancestors,
Interface for ancestral states reconstruction methods.
Likelihood ancestral states reconstruction: marginal method.
LegacyMarginalAncestralStateReconstruction * clone() const
std::shared_ptr< const DRTreeLikelihoodInterface > likelihood_
virtual ~LegacyMarginalAncestralStateReconstruction()
std::shared_ptr< const Alphabet > alphabet_
std::map< int, std::vector< size_t > > getAllAncestralStates() const override
Get all ancestral states for all nodes.
std::vector< size_t > rootPatternLinks_
LegacyMarginalAncestralStateReconstruction(std::shared_ptr< const DRTreeLikelihoodInterface > drl)
LegacyMarginalAncestralStateReconstruction(const LegacyMarginalAncestralStateReconstruction &masr)=default
std::vector< size_t > getAncestralStatesForNode(int nodeId) const override
Get ancestral states for a given node as a vector of int.
std::unique_ptr< Sequence > getAncestralSequenceForNode(int nodeId, VVdouble *probs, bool sample) const
Get the ancestral sequence for a given node.
std::vector< size_t > getAncestralStatesForNode(int nodeId, VVdouble &probs, bool sample) const
Get ancestral states for a given node as a vector of int.
std::unique_ptr< Sequence > getAncestralSequenceForNode(int nodeId) const override
Get the ancestral sequence for a given node.
void recursiveMarginalAncestralStates(const Node *node, std::map< int, std::vector< size_t >> &ancestors, AlignedSequenceContainer &data) const
LegacyMarginalAncestralStateReconstruction & operator=(const LegacyMarginalAncestralStateReconstruction &masr)=default
std::unique_ptr< SiteContainerInterface > getAncestralSequences() const override
Get all the ancestral sequences for all nodes.
TreeTemplate< Node > tree_
The phylogenetic node class.
The phylogenetic tree class.
Defines the basic types of data flow nodes.
std::vector< Vdouble > VVdouble