bpp-phyl3  3.0.0
MultiProcessSequenceEvolution.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_MULTIPROCESSSEQUENCEEVOLUTION_H
6 #define BPP_PHYL_LIKELIHOOD_MULTIPROCESSSEQUENCEEVOLUTION_H
7 
9 
10 #include "SequenceEvolution.h"
11 #include "SubstitutionProcess.h"
13 
14 // From SeqLib:
16 
17 using namespace std;
18 
19 namespace bpp
20 {
27  virtual public SequenceEvolution,
29 {
30 protected:
31  std::shared_ptr<SubstitutionProcessCollection> processColl_;
32 
37  std::vector<size_t> nProc_;
38 
39 public:
41  std::shared_ptr<SubstitutionProcessCollection> processColl,
42  std::vector<size_t> nProc,
43  const std::string& prefix = "");
44 
47  processColl_(lik.processColl_),
48  nProc_(lik.nProc_)
49  {}
50 
52  {
53  AbstractParameterAliasable::operator=(lik);
54 
55  processColl_ = lik.processColl_;
56  nProc_ = lik.nProc_;
57 
58  return *this;
59  }
60 
61 public:
65  const SubstitutionProcessCollection& collection() const { return *processColl_; }
66 
67  std::shared_ptr<const SubstitutionProcessCollection> getCollection() const { return processColl_; }
68 
69  SubstitutionProcessCollection& collection() { return *processColl_; }
70 
71  std::shared_ptr<SubstitutionProcessCollection> getCollection() { return processColl_; }
72 
76  size_t getNumberOfSubstitutionProcess() const { return nProc_.size(); }
77 
83  {
84  return processColl_->substitutionProcess(number);
85  }
86 
87  std::shared_ptr<const SubstitutionProcessInterface> getSubstitutionProcess(size_t number) const
88  {
89  return processColl_->getSubstitutionProcess(number);
90  }
91 
92  const std::vector<size_t>& getSubstitutionProcessNumbers() const
93  {
94  return nProc_;
95  }
96 
97  ParameterList getSubstitutionProcessParameters(bool independent) const;
98 
99  ParameterList getSubstitutionModelParameters(bool independent) const;
100 
101  ParameterList getRateDistributionParameters(bool independent) const;
102 
103  ParameterList getRootFrequenciesParameters(bool independent) const;
104 
105  ParameterList getBranchLengthParameters(bool independent) const;
106 
107  virtual ParameterList getNonDerivableParameters() const;
108 
109  virtual void fireParameterChanged(const ParameterList& parameters);
110 
111  void setParameters(const ParameterList& parameters);
112 
116  virtual bool isCompatibleWith(const AlignmentDataInterface& data) const;
117 };
118 } // end of namespace bpp.
119 #endif // BPP_PHYL_LIKELIHOOD_MULTIPROCESSSEQUENCEEVOLUTION_H
Partial implementation of multiple processes of sequences.
std::shared_ptr< SubstitutionProcessCollection > getCollection()
std::shared_ptr< const SubstitutionProcessCollection > getCollection() const
size_t getNumberOfSubstitutionProcess() const
Return the number of process used for computation.
const SubstitutionProcessInterface & substitutionProcess(size_t number) const
Return the SubstitutionProcess of a given index position (in nProc_ vector).
std::vector< size_t > nProc_
the vector of the substitution process numbers, as they are used in this order.
std::shared_ptr< SubstitutionProcessCollection > processColl_
MultiProcessSequenceEvolution(const MultiProcessSequenceEvolution &lik)
const std::vector< size_t > & getSubstitutionProcessNumbers() const
MultiProcessSequenceEvolution & operator=(const MultiProcessSequenceEvolution &lik)
const SubstitutionProcessCollection & collection() const
The collection.
SubstitutionProcessCollection & collection()
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess(size_t number) const
This interface describes the evolution process of a sequence.
Collection of Substitution Process, which owns all the necessary objects: Substitution models,...
This interface describes the substitution process along the tree and sites of the alignment.
Defines the basic types of data flow nodes.