bpp-phyl3  3.0.0
GivenDataSubstitutionProcessSiteSimulator.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_SIMULATION_GIVENDATASUBSTITUTIONPROCESSSITESIMULATOR_H
6 #define BPP_PHYL_SIMULATION_GIVENDATASUBSTITUTIONPROCESSSITESIMULATOR_H
7 
9 
11 
12 namespace bpp
13 {
39 {
40 private:
41  std::shared_ptr<LikelihoodCalculationSingleProcess> calcul_;
42 
46  Eigen::Index pos_;
47 
48 public:
57  GivenDataSubstitutionProcessSiteSimulator(std::shared_ptr<LikelihoodCalculationSingleProcess> calcul, size_t pos, bool shrunked = false) :
59  calcul_(calcul),
60  pos_(shrunked ? Eigen::Index(pos) : Eigen::Index(calcul->getRootArrayPosition(pos)))
61  {
62  init();
63  // Continuous rates not possible for this, since there is no a posteriori for all rates.
64  continuousRates_ = false;
65  }
66 
69  calcul_(nhss.calcul_),
70  pos_(nhss.pos_)
71  {}
72 
74  {
76  calcul_ = nhss.calcul_;
77  pos_ = nhss.pos_;
78 
79  return *this;
80  }
81 
83  {
85  }
86 
87 private:
93  void init() override;
94 };
95 } // end of namespace bpp.
96 #endif // BPP_PHYL_SIMULATION_GIVENDATASUBSTITUTIONPROCESSSITESIMULATOR_H
Site simulation under a unique substitution process, given data.
std::shared_ptr< LikelihoodCalculationSingleProcess > calcul_
GivenDataSubstitutionProcessSiteSimulator(std::shared_ptr< LikelihoodCalculationSingleProcess > calcul, size_t pos, bool shrunked=false)
Build a Site Simulator of histories from the a posteriori likelihoods at a given site.
GivenDataSubstitutionProcessSiteSimulator & operator=(const GivenDataSubstitutionProcessSiteSimulator &nhss)
GivenDataSubstitutionProcessSiteSimulator * clone() const override
GivenDataSubstitutionProcessSiteSimulator(const GivenDataSubstitutionProcessSiteSimulator &nhss)
Eigen::Index pos_
Position of the copied site, in SHRUNKED data.
Site simulation under a unique substitution process.
SimpleSubstitutionProcessSiteSimulator & operator=(const SimpleSubstitutionProcessSiteSimulator &nhss)
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess() const
Get the substitution process associated to this instance.
Defines the basic types of data flow nodes.