bpp-phyl3  3.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PartitionSequenceEvolution.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_PARTITIONSEQUENCEEVOLUTION_H
6 #define BPP_PHYL_LIKELIHOOD_PARTITIONSEQUENCEEVOLUTION_H
7 
8 
10 
11 namespace bpp
12 {
22 {
23 private:
27  std::vector<size_t> vProc_;
28 
29  size_t vSize_;
30 
38  std::map<size_t, std::vector<size_t>> mProcPos_;
39 
40 public:
41  /*
42  * @brief constructor
43  *
44  * @param the used SubstitutionProcessCollection
45  * @param A vector of the number of the processes along the sequence.
46  */
48  std::shared_ptr<SubstitutionProcessCollection> processColl,
49  std::vector<size_t>& posProc);
50 
53  vProc_(mlc.vProc_),
54  vSize_(mlc.vSize_),
55  mProcPos_(mlc.mProcPos_) {}
56 
58  {
60  vProc_ = mlc.vProc_;
61  vSize_ = mlc.vSize_;
62 
63  mProcPos_ = mlc.mProcPos_;
64 
65  return *this;
66  }
67 
69 
71 
72 public:
73  size_t getNumberOfSites() const
74  {
75  return vSize_;
76  }
77 
78  const std::vector<size_t>& getProcessNumbersPerSite() const
79  {
80  return vProc_;
81  }
82 
83  /*
84  * @brief Get Substitution Process Number for a given site.
85  * @param i the index of the site
86  *
87  */
88  size_t getSubstitutionProcessNumber(size_t i) const
89  {
90  if (i >= vSize_)
91  throw IndexOutOfBoundsException("PartitionSequenceEvolution::getSubstitutionProcess", i, 0, vSize_);
92  return vProc_[i];
93  }
94 
95  std::map<size_t, std::vector<size_t>>& mapOfProcessSites()
96  {
97  return mProcPos_;
98  }
99 
100  const std::map<size_t, std::vector<size_t>>& mapOfProcessSites() const
101  {
102  return mProcPos_;
103  }
104 };
105 } // end of namespace bpp.
106 #endif // BPP_PHYL_LIKELIHOOD_PARTITIONSEQUENCEEVOLUTION_H
Partial implementation of multiple processes of sequences.
MultiProcessSequenceEvolution & operator=(const MultiProcessSequenceEvolution &lik)
Sequence evolution framework based on a mixture of substitution processes.
std::map< size_t, std::vector< size_t > > & mapOfProcessSites()
std::vector< size_t > vProc_
vector of the substitution process numbers along the sequence.
PartitionSequenceEvolution & operator=(const PartitionSequenceEvolution &mlc)
const std::map< size_t, std::vector< size_t > > & mapOfProcessSites() const
std::map< size_t, std::vector< size_t > > mProcPos_
On the reverse, for each process number, the vector of the sites where it is used.
PartitionSequenceEvolution(std::shared_ptr< SubstitutionProcessCollection > processColl, std::vector< size_t > &posProc)
const std::vector< size_t > & getProcessNumbersPerSite() const
size_t getSubstitutionProcessNumber(size_t i) const
PartitionSequenceEvolution(const PartitionSequenceEvolution &mlc)
PartitionSequenceEvolution * clone() const
Defines the basic types of data flow nodes.