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
17using namespace std;
18
19namespace bpp
20{
27 virtual public SequenceEvolution,
29{
30protected:
31 std::shared_ptr<SubstitutionProcessCollection> processColl_;
32
37 std::vector<size_t> nProc_;
38
39public:
41 std::shared_ptr<SubstitutionProcessCollection> processColl,
42 std::vector<size_t> nProc,
43 const std::string& prefix = "");
44
48 nProc_(lik.nProc_)
49 {}
50
52 {
54
56 nProc_ = lik.nProc_;
57
58 return *this;
59 }
60
61public:
66
67 std::shared_ptr<const SubstitutionProcessCollection> getCollection() const { return processColl_; }
68
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
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
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Partial implementation of multiple processes of sequences.
virtual bool isCompatibleWith(const AlignmentDataInterface &data) const
test if data fits this model
const SubstitutionProcessInterface & substitutionProcess(size_t number) const
Return the SubstitutionProcess of a given index position (in nProc_ vector).
ParameterList getRateDistributionParameters(bool independent) const
Get the parameters associated to the rate distribution(s).
void setParameters(const ParameterList &parameters)
ParameterList getRootFrequenciesParameters(bool independent) const
Get the parameters associated to the root frequencies(s).
size_t getNumberOfSubstitutionProcess() const
Return the number of process used for computation.
std::shared_ptr< const SubstitutionProcessCollection > getCollection() const
MultiProcessSequenceEvolution(std::shared_ptr< SubstitutionProcessCollection > processColl, std::vector< size_t > nProc, const std::string &prefix="")
ParameterList getBranchLengthParameters(bool independent) const
Get the branch lengths parameters.
virtual void fireParameterChanged(const ParameterList &parameters)
ParameterList getSubstitutionProcessParameters(bool independent) const
Get the parameters associated to substitution processes(s).
const SubstitutionProcessCollection & collection() const
The collection.
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)
std::shared_ptr< SubstitutionProcessCollection > getCollection()
virtual ParameterList getNonDerivableParameters() const
All non derivable parameters.
SubstitutionProcessCollection & collection()
ParameterList getSubstitutionModelParameters(bool independent) const
Get the parameters associated to substitution model(s).
std::shared_ptr< const SubstitutionProcessInterface > getSubstitutionProcess(size_t number) const
MultiProcessSequenceEvolution & operator=(const MultiProcessSequenceEvolution &lik)
const std::vector< size_t > & getSubstitutionProcessNumbers() 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.