18 const std::string& prefix) :
27 submod->enableEigenDecomposition(
false);
35 const std::vector<std::set<size_t>>& vPos,
36 const std::string& prefix) :
43 throw Exception(
"AbstractKroneckerWordSubstitutionModel::AbstractKroneckerWordSubstitutionModel: Bad set of changing positions ");
48 submod->enableEigenDecomposition(
false);
55 unique_ptr<SubstitutionModelInterface> pmodel,
57 const string& prefix) :
66 submod->enableEigenDecomposition(
false);
73 unique_ptr<SubstitutionModelInterface> pmodel,
75 const std::vector<std::set<size_t>>& vPos,
76 const std::string& prefix) :
83 throw Exception(
"AbstractKroneckerWordSubstitutionModel::AbstractKroneckerWordSubstitutionModel: Bad set of changing positions ");
88 submod->enableEigenDecomposition(
false);
95 std::shared_ptr<const Alphabet> alph,
96 std::shared_ptr<const StateMapInterface> stateMap,
97 const string& prefix) :
106 submod->enableEigenDecomposition(
false);
114 sChangingPos_(wrsm.sChangingPos_),
115 vGenerators_(wrsm.vGenerators_)
138 throw Exception(
"AbstractKroneckerWordSubstitutionModel::setChangingPositions: Bad set of changing positions ");
150 for (
size_t k = 0; k < nbmod; k++)
152 size *=
VSubMod_[k]->getNumberOfStates();
163 if (*(--(i.end())) > nbmod || *(i.begin()) == 0)
180 for (
size_t k = 1; k < nbmod - 1; k++)
195 for (
const auto& iPos : i)
197 size_t posok = iPos - 1;
204 ss *=
VSubMod_[pos]->getNumberOfStates();
Abstract Kronecker Word Model.
AbstractKroneckerWordSubstitutionModel & operator=(const AbstractKroneckerWordSubstitutionModel &)
bool checkChangingPositions_()
checks that the vector of changing positions is valid
std::vector< RowMatrix< double > > vGenerators_
vector of generators for computation purposes
AbstractKroneckerWordSubstitutionModel(ModelList &modelList, const std::string &prefix)
Build a new AbstractKroneckerWordSubstitutionModel object from a vector of pointers to SubstitutionMo...
void fillBasicGenerator_()
First fill of the generator, from the position model.
std::vector< std::set< size_t > > sChangingPos_
vector of sets of simultaneously changing positions.
void setChangingPositions(const std::vector< std::set< size_t >> &vPos)
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
RowMatrix< double > generator_
The generator matrix of the model.
const Matrix< double > & generator() const
bool enableEigenDecomposition()
Tell if eigenValues and Vectors must be computed.
size_t getNumberOfStates() const override
Get the number of states.
Abstract Basal class for words of substitution models.
std::vector< std::shared_ptr< SubstitutionModelInterface > > VSubMod_
AbstractWordSubstitutionModel & operator=(const AbstractWordSubstitutionModel &)
A list of models, for building a WordSubstitutionModel.
Defines the basic types of data flow nodes.