5 #ifndef BPP_PHYL_MODEL_ABSTRACTWORDSUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_ABSTRACTWORDSUBSTITUTIONMODEL_H
30 std::vector<std::shared_ptr<SubstitutionModelInterface>>
models_;
42 ModelList(std::vector<std::unique_ptr<SubstitutionModelInterface>>& models) :
45 std::vector<std::shared_ptr<const Alphabet>> alphabets(models.size());
46 for (
size_t i = 0; i < models.size(); ++i)
48 alphabets[i] = models[i]->getAlphabet();
49 models_[i] = std::move(models[i]);
62 std::shared_ptr<SubstitutionModelInterface>
getModel(
size_t i)
115 std::vector<std::shared_ptr<SubstitutionModelInterface>>
VSubMod_;
149 const std::string& prefix);
163 std::unique_ptr<SubstitutionModelInterface> model,
165 const std::string& prefix);
180 std::shared_ptr<const Alphabet> alph,
181 std::shared_ptr<const StateMapInterface>
stateMap,
182 const std::string& prefix);
212 virtual void setFreq(std::map<int, double>& freqs);
const StateMapInterface & stateMap() const override
Abstract Basal class for words of substitution models.
virtual void completeMatrices_()=0
Called by updateMatrices to handle specific modifications for inheriting classes.
virtual ~AbstractWordSubstitutionModel()
virtual void setFreq(std::map< int, double > &freqs)
Estimation of the parameters of the models so that the equilibrium frequencies match the given ones.
virtual void fillBasicGenerator_()
First fill of the generator, from the position model.
void updateMatrices_()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
std::vector< double > Vrate_
size_t getNumberOfModels() const
bool newAlphabet_
boolean flag to check if a specific WordAlphabet has been built
void setNamespace(const std::string &prefix)
AbstractWordSubstitutionModel(ModelList &modelList, const std::string &prefix)
Build a new AbstractWordSubstitutionModel object from a vector of pointers to SubstitutionModels.
std::vector< std::shared_ptr< SubstitutionModelInterface > > VSubMod_
const SubstitutionModelInterface & nModel(size_t i) const
returns the ith model, or throw an exception if i is not a valid number.
std::vector< std::string > VnestedPrefix_
AbstractWordSubstitutionModel & operator=(const AbstractWordSubstitutionModel &)
A list of models, for building a WordSubstitutionModel.
std::shared_ptr< SubstitutionModelInterface > getModel(size_t i)
ModelList & operator=(const ModelList &ml)
std::vector< std::shared_ptr< SubstitutionModelInterface > > models_
Position-specific models are stored as shared_ptr to allow several positions to share the same model....
ModelList(std::vector< std::unique_ptr< SubstitutionModelInterface >> &models)
Create a ModelList from one template substitution model.
std::shared_ptr< const WordAlphabet > getWordAlphabet()
std::shared_ptr< WordAlphabet > wordAlphabet_
ModelList(const ModelList &ml)
Interface for all substitution models.
Defines the basic types of data flow nodes.