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
12namespace bpp
13{
39{
40private:
41 std::shared_ptr<LikelihoodCalculationSingleProcess> calcul_;
42
46 Eigen::Index pos_;
47
48 /*
49 * @brief Vector of branch indexes where the data is not used, and
50 * substitution probabilities are computed from the prior process.
51 *
52 */
53
54 std::vector<uint> vPriorBranch_;
55
56public:
66 GivenDataSubstitutionProcessSiteSimulator(std::shared_ptr<LikelihoodCalculationSingleProcess> calcul, size_t pos, bool shrunked = false, std::vector<uint> vPrior = std::vector<uint>()) :
68 calcul_(calcul),
69 pos_(shrunked ? Eigen::Index(pos) : Eigen::Index(calcul->getRootArrayPosition(pos))),
70 vPriorBranch_(vPrior)
71 {
72 init();
73 // Continuous rates not possible for this, since there is no a posteriori for all rates.
74 continuousRates_ = false;
75 }
76
79 calcul_(nhss.calcul_),
80 pos_(nhss.pos_)
81 {}
82
84 {
86 calcul_ = nhss.calcul_;
87 pos_ = nhss.pos_;
88
89 return *this;
90 }
91
93 {
95 }
96
97private:
103 void init() override;
104};
105} // end of namespace bpp.
106#endif // BPP_PHYL_SIMULATION_GIVENDATASUBSTITUTIONPROCESSSITESIMULATOR_H
Site simulation under a unique substitution process, given data.
GivenDataSubstitutionProcessSiteSimulator(std::shared_ptr< LikelihoodCalculationSingleProcess > calcul, size_t pos, bool shrunked=false, std::vector< uint > vPrior=std::vector< uint >())
Build a Site Simulator of histories from the a posteriori likelihoods at a given site.
std::shared_ptr< LikelihoodCalculationSingleProcess > calcul_
GivenDataSubstitutionProcessSiteSimulator * clone() const override
GivenDataSubstitutionProcessSiteSimulator & operator=(const GivenDataSubstitutionProcessSiteSimulator &nhss)
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.