bpp-phyl3  3.0.0
AlignedPhyloLikelihoodMixture.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_MIXTUREOFALIGNEDPHYLOLIKELIHOOD_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_MIXTUREOFALIGNEDPHYLOLIKELIHOOD_H
7 
8 
10 
11 // From SeqLib:
13 
14 #include "../DataFlow/Simplex_DF.h"
15 
16 namespace bpp
17 {
27 {
28 private:
32  std::shared_ptr<ConfiguredSimplex> simplex_;
33 
37  mutable std::shared_ptr<AlignedLikelihoodCalculation> likCal_;
38 
39 public:
42  std::shared_ptr<PhyloLikelihoodContainer> pC,
43  const std::vector<size_t>& nPhylo,
44  bool inCollection = true);
45 
47 
48 protected:
55  simplex_(mlc.simplex_),
56  likCal_(mlc.likCal_)
57  {}
58 
60  {
62  simplex_ = mlc.simplex_;
63  likCal_ = mlc.likCal_;
64  return *this;
65  }
66 
68  {
69  return new AlignedPhyloLikelihoodMixture(*this);
70  }
71 
72 protected:
73  void fireParameterChanged(const ParameterList& parameters) override;
74 
75 public:
77  {
78  return *likCal_;
79  }
80 
81  std::shared_ptr<LikelihoodCalculation> getLikelihoodCalculation () const override
82  {
83  return likCal_;
84  }
85 
87  {
88  return *likCal_;
89  }
90 
91  std::shared_ptr<AlignedLikelihoodCalculation> getAlignedLikelihoodCalculation () const override
92  {
93  return likCal_;
94  }
95 
100 
104  double getPhyloProb(size_t index) const;
105 
109  void setPhyloProb(Simplex const& simplex);
110 };
111 } // end of namespace bpp.
112 #endif // BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_MIXTUREOFALIGNEDPHYLOLIKELIHOOD_H
The AlignedPhyloLikelihoodSet abstract class.
AbstractAlignedPhyloLikelihoodSet & operator=(const AbstractAlignedPhyloLikelihoodSet &soap)
The PhyloLikelihoodSet class, to manage a subset of PhyloLikelihoods from a given PhyloLikelihoodCont...
const Context & context() const override
Likelihood framework based on a mixture of aligned likelihoods.
Vdouble getPhyloProbabilities() const
Get the probabilities of the simplex.
std::shared_ptr< LikelihoodCalculation > getLikelihoodCalculation() const override
double getPhyloProb(size_t index) const
Get the probability of a phylolikelihood.
AlignedLikelihoodCalculation & alignedLikelihoodCalculation() const override
void fireParameterChanged(const ParameterList &parameters) override
AlignedPhyloLikelihoodMixture * clone() const override
void setPhyloProb(Simplex const &simplex)
Set the probabilities of the simplex.
AlignedPhyloLikelihoodMixture(const AlignedPhyloLikelihoodMixture &mlc)
LikelihoodCalculation & likelihoodCalculation() const override
std::shared_ptr< AlignedLikelihoodCalculation > getAlignedLikelihoodCalculation() const override
AlignedPhyloLikelihoodMixture(Context &context, std::shared_ptr< PhyloLikelihoodContainer > pC, const std::vector< size_t > &nPhylo, bool inCollection=true)
std::shared_ptr< AlignedLikelihoodCalculation > likCal_
AlignedPhyloLikelihoodMixture & operator=(const AlignedPhyloLikelihoodMixture &mlc)
std::shared_ptr< ConfiguredSimplex > simplex_
Context for dataflow node construction.
Definition: DataFlow.h:527
Defines the basic types of data flow nodes.
std::vector< double > Vdouble