bpp-phyl3
3.0.0
|
Organization of submodels in mixed substitution models in a path. See class ModelScenario for a thorough description. More...
#include <Bpp/Phyl/Likelihood/ModelPath.h>
Classes | |
class | PathNode |
A vector<int> where all elements are different and in INCREASING ORDER. So inclusion should be done through dedicated methods. More... | |
Public Member Functions | |
ModelPath () | |
ModelPath (const ModelPath &) | |
ModelPath & | operator= (const ModelPath &) |
~ModelPath () | |
size_t | size () const |
std::shared_ptr< MixedTransitionModelInterface > | getLeadModel () |
gets the leader model. More... | |
const std::shared_ptr< MixedTransitionModelInterface > | getLeadModel () const |
void | setLeadModel (std::shared_ptr< MixedTransitionModelInterface > model) |
sets the leader model. More... | |
void | setModel (std::shared_ptr< MixedTransitionModelInterface > mMod, const Vuint &vnS) |
sets submodel numbers in the mixed model. Checks if all the numbers are valid. More... | |
void | changeModel (std::shared_ptr< MixedTransitionModelInterface > mMod1, std::shared_ptr< MixedTransitionModelInterface > mMod2) |
change from a model to another More... | |
void | removeModel (std::shared_ptr< MixedTransitionModelInterface > mMod) |
Remove a model. More... | |
void | addToModel (std::shared_ptr< MixedTransitionModelInterface > mMod, const Vuint &vnS) |
adds submodel numbers to the mixed model. Checks if all the numbers are valid. More... | |
ModelPath & | operator+= (const ModelPath &) |
Cumulates the PathNodes of the given ModelPath into this one. More... | |
ModelPath & | operator-= (const ModelPath &) |
Remove from the PathNodes of this object the matching ones of the ModelPath. More... | |
bool | operator<= (const ModelPath &) const |
checks if this ModelPath is included in another one. Which means that all submodels of this path are in the other part. More... | |
bool | operator>= (const ModelPath &) const |
checks if this ModelPath includes another one. More... | |
bool | intersects (const ModelPath &) const |
checks if this ModelPath intersects another one. Which means that one submodel explicitly declared in a ModelPath is in the other. More... | |
double | getProbability () const |
returns the probability More... | |
void | setProbability (double x) |
sets the probability More... | |
bool | hasModel (std::shared_ptr< MixedTransitionModelInterface > mMod) const |
checks if there is a pathnode associated with a model More... | |
bool | hasModel (std::shared_ptr< const MixedTransitionModelInterface > mMod) const |
const PathNode & | getPathNode (std::shared_ptr< MixedTransitionModelInterface > mMod) const |
gets the pathnode associated with a model More... | |
const PathNode & | getPathNode (std::shared_ptr< const MixedTransitionModelInterface > mMod) const |
std::vector< std::shared_ptr< MixedTransitionModelInterface > > | getModels () const |
gets the MixedTransitionModel used in the ModelPath More... | |
std::string | toString () const |
string description More... | |
Private Attributes | |
std::map< std::shared_ptr< MixedTransitionModelInterface >, PathNode > | mModPath_ |
std::shared_ptr< MixedTransitionModelInterface > | leadMod_ |
double | proba_ |
probability of this ModelPath. More... | |
Organization of submodels in mixed substitution models in a path. See class ModelScenario for a thorough description.
A path is defined through an hypergraph, ie a list of hypernodes.
Definition at line 21 of file ModelPath.h.
|
inline |
Definition at line 116 of file ModelPath.h.
ModelPath::ModelPath | ( | const ModelPath & | hn | ) |
Definition at line 14 of file ModelPath.cpp.
|
inline |
Definition at line 119 of file ModelPath.h.
void ModelPath::addToModel | ( | std::shared_ptr< MixedTransitionModelInterface > | mMod, |
const Vuint & | vnS | ||
) |
adds submodel numbers to the mixed model. Checks if all the numbers are valid.
mMod | the mixed model |
vnS | vector of numbers of the submodel |
Definition at line 53 of file ModelPath.cpp.
References mModPath_.
Referenced by operator+=().
void ModelPath::changeModel | ( | std::shared_ptr< MixedTransitionModelInterface > | mMod1, |
std::shared_ptr< MixedTransitionModelInterface > | mMod2 | ||
) |
change from a model to another
mMod1 | the ancient mixed model |
mMod2 | the new mixed model |
if mMod1 is the lead model, mMod2 becomes the lead model
Definition at line 39 of file ModelPath.cpp.
References leadMod_, mModPath_, and setModel().
|
inline |
|
inline |
Definition at line 134 of file ModelPath.h.
References leadMod_.
vector< shared_ptr< MixedTransitionModelInterface > > ModelPath::getModels | ( | ) | const |
gets the MixedTransitionModel used in the ModelPath
Definition at line 132 of file ModelPath.cpp.
References mModPath_.
Referenced by bpp::ModelScenario::complete(), and bpp::PhylogeneticsApplicationTools::printParameters().
|
inline |
Definition at line 254 of file ModelPath.h.
References mModPath_.
|
inline |
gets the pathnode associated with a model
Definition at line 251 of file ModelPath.h.
References mModPath_.
Referenced by bpp::ProcessComputationTree::buildFollowingPath_(), bpp::ModelScenario::computeModelPathsProbabilities(), and bpp::PhylogeneticsApplicationTools::printParameters().
|
inline |
returns the probability
Definition at line 225 of file ModelPath.h.
References proba_.
Referenced by bpp::ModelScenario::computeModelPathsProbabilities().
|
inline |
Definition at line 238 of file ModelPath.h.
References mModPath_.
|
inline |
checks if there is a pathnode associated with a model
Definition at line 235 of file ModelPath.h.
References mModPath_.
Referenced by bpp::ProcessComputationTree::buildFollowingPath_(), and bpp::ModelScenario::computeModelPathsProbabilities().
bool ModelPath::intersects | ( | const ModelPath & | hn | ) | const |
checks if this ModelPath intersects another one. Which means that one submodel explicitly declared in a ModelPath is in the other.
Definition at line 83 of file ModelPath.cpp.
References mModPath_.
Referenced by bpp::ModelScenario::hasExclusivePaths().
Cumulates the PathNodes of the given ModelPath into this one.
Definition at line 103 of file ModelPath.cpp.
References addToModel(), and mModPath_.
Remove from the PathNodes of this object the matching ones of the ModelPath.
Definition at line 115 of file ModelPath.cpp.
References mModPath_.
bool ModelPath::operator<= | ( | const ModelPath & | hn | ) | const |
checks if this ModelPath is included in another one. Which means that all submodels of this path are in the other part.
Definition at line 64 of file ModelPath.cpp.
References mModPath_.
Definition at line 20 of file ModelPath.cpp.
bool ModelPath::operator>= | ( | const ModelPath & | hn | ) | const |
checks if this ModelPath includes another one.
Definition at line 78 of file ModelPath.cpp.
|
inline |
Remove a model.
if the model is the leadmodel, the leadmodel is set to 0.
Definition at line 176 of file ModelPath.h.
|
inline |
sets the leader model.
The model must be in the map before.
Definition at line 144 of file ModelPath.h.
void ModelPath::setModel | ( | std::shared_ptr< MixedTransitionModelInterface > | mMod, |
const Vuint & | vnS | ||
) |
sets submodel numbers in the mixed model. Checks if all the numbers are valid.
mMod | the mixed model |
vnS | vector of indexes of the submodels |
Definition at line 28 of file ModelPath.cpp.
References mModPath_.
Referenced by changeModel().
|
inline |
sets the probability
Definition at line 230 of file ModelPath.h.
References proba_.
Referenced by bpp::ModelScenario::computeModelPathsProbabilities().
|
inline |
Definition at line 121 of file ModelPath.h.
References mModPath_.
std::string ModelPath::toString | ( | ) | const |
string description
Definition at line 147 of file ModelPath.cpp.
References bpp::BranchModelInterface::getName(), bpp::MixtureOfTransitionModels::getName(), and mModPath_.
|
private |
The leading model (ie which that decides of the submodels probabilities).
Definition at line 108 of file ModelPath.h.
Referenced by changeModel(), getLeadModel(), removeModel(), and setLeadModel().
|
private |
Which submodels of MixedTransitionModels are used.
Definition at line 103 of file ModelPath.h.
Referenced by addToModel(), changeModel(), getModels(), getPathNode(), hasModel(), intersects(), operator+=(), operator-=(), operator<=(), operator=(), removeModel(), setLeadModel(), setModel(), size(), and toString().
|
private |
probability of this ModelPath.
Definition at line 113 of file ModelPath.h.
Referenced by getProbability(), operator=(), and setProbability().