5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_PHYLOLIKELIHOODCONTAINER_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_PHYLOLIKELIHOODCONTAINER_H
15 #include "../DataFlow/CollectionNodes.h"
34 std::map<size_t, std::shared_ptr<PhyloLikelihoodInterface>>
mPhylo_;
39 std::shared_ptr<SubstitutionProcessCollection> sColl) :
53 throw Exception(
"PhyloLikelihoodContainer::clone should not be called.");
83 std::shared_ptr<const PhyloLikelihoodInterface>
operator[](
size_t pos)
const
86 return it !=
mPhylo_.end() ? it->second :
nullptr;
89 std::shared_ptr<PhyloLikelihoodInterface>
operator[](
size_t pos)
92 return it !=
mPhylo_.end() ? it->second :
nullptr;
98 return it !=
mPhylo_.end() ? it->second :
nullptr;
104 return it !=
mPhylo_.end() ? it->second :
nullptr;
114 std::vector<size_t> vnum;
118 vnum.push_back(it.first);
145 void setData(std::shared_ptr<const AlignmentDataInterface> sites,
size_t nPhyl)
150 auto sdp = std::dynamic_pointer_cast<SingleDataPhyloLikelihoodInterface>(it->second);
162 std::shared_ptr<const AlignmentDataInterface>
getData(
size_t nPhyl)
const
164 const auto it =
mPhylo_.find(nPhyl);
167 auto sdp = std::dynamic_pointer_cast<SingleDataPhyloLikelihoodInterface>(it->second);
169 return sdp->getData();
Context for dataflow node construction.
The PhyloLikelihoodContainer, owns and assigns numbers to Phylolikelihoods.
std::shared_ptr< const AlignmentDataInterface > getData(size_t nPhyl) const
Get the dataset for which the likelihood must be evaluated.
void setData(std::shared_ptr< const AlignmentDataInterface > sites, size_t nPhyl)
Set the dataset for which the likelihood must be evaluated, iff the pointed PhyloLikelihood is a Sing...
PhyloLikelihoodContainer(Context &context, std::shared_ptr< CollectionNodes > sColl)
std::map< size_t, std::shared_ptr< PhyloLikelihoodInterface > > mPhylo_
std::shared_ptr< PhyloLikelihoodInterface > operator[](size_t pos)
std::vector< size_t > getNumbersOfPhyloLikelihoods() const
PhyloLikelihoodContainer * clone() const override
std::shared_ptr< const CollectionNodes > getCollectionNodes() const
Manage Collection Nodes.
std::shared_ptr< CollectionNodes > collectionNodes_
virtual ~PhyloLikelihoodContainer()
Abstract class destructor.
std::shared_ptr< const PhyloLikelihoodInterface > operator[](size_t pos) const
std::shared_ptr< CollectionNodes > getCollectionNodes()
std::shared_ptr< PhyloLikelihoodInterface > getPhyloLikelihood(size_t pos)
bool hasPhyloLikelihood(size_t pos) const
PhyloLikelihoodContainer(Context &context, std::shared_ptr< SubstitutionProcessCollection > sColl)
void addPhyloLikelihood(size_t pos, std::shared_ptr< PhyloLikelihoodInterface > Ap)
std::shared_ptr< const PhyloLikelihoodInterface > getPhyloLikelihood(size_t pos) const
std::string toString(T t)
Defines the basic types of data flow nodes.