bpp-phyl3
3.0.0
|
Legacy data storage class for probabilistic rewards mappings. More...
#include <Bpp/Phyl/Legacy/Mapping/ProbabilisticRewardMapping.h>
Public Member Functions | |
LegacyProbabilisticRewardMapping (const Tree &tree, std::shared_ptr< const Reward > reward, size_t numberOfSites) | |
Build a new LegacyProbabilisticRewardMapping object. More... | |
LegacyProbabilisticRewardMapping (const Tree &tree) | |
Build a new ProbabilisticRewardMapping object. More... | |
LegacyProbabilisticRewardMapping * | clone () const override |
LegacyProbabilisticRewardMapping (const LegacyProbabilisticRewardMapping &prm)=default | |
LegacyProbabilisticRewardMapping & | operator= (const LegacyProbabilisticRewardMapping &prm)=default |
virtual | ~LegacyProbabilisticRewardMapping () |
virtual double | getReward (int nodeId, size_t siteIndex) const |
virtual void | setTree (const Tree &tree) |
(Re)-set the phylogenetic tree associated to this mapping. More... | |
virtual void | setNumberOfSites (size_t numberOfSites) override |
virtual double & | operator() (size_t nodeIndex, size_t siteIndex) override |
Direct access to rewards. More... | |
virtual const double & | operator() (size_t nodeIndex, size_t siteIndex) const override |
Direct access to rewards. More... | |
std::vector< double > & | operator[] (size_t siteIndex) |
Direct access to rewards. More... | |
const std::vector< double > & | operator[] (size_t siteIndex) const |
Direct access to rewards. More... | |
virtual const Tree & | tree () const =0 |
const TreeTemplate< Node > & | tree () const override |
virtual bool | isEmpty () const =0 |
bool | isEmpty () const override |
virtual size_t | getNumberOfSites () const =0 |
size_t | getNumberOfSites () const override |
virtual size_t | getNumberOfBranches () const =0 |
size_t | getNumberOfBranches () const override |
virtual int | getSitePosition (size_t index) const =0 |
int | getSitePosition (size_t index) const override |
virtual std::vector< double > | getBranchLengths () const =0 |
virtual std::vector< double > | getBranchLengths () const override |
virtual size_t | getNodeIndex (int nodeId) const =0 |
virtual size_t | getNodeIndex (int nodeId) const override |
virtual void | setSitePosition (size_t index, int position)=0 |
Set the position of a given site. More... | |
void | setSitePosition (size_t index, int position) override |
Set the position of a given site. More... | |
virtual const Node * | getNode (size_t nodeIndex) const |
Private Attributes | |
std::shared_ptr< const Reward > | reward_ |
std::vector< std::vector< double > > | mapping_ |
Rewards storage. More... | |
std::unique_ptr< const TreeTemplate< Node > > | tree_ |
std::vector< int > | sitesPositions_ |
std::vector< const Node * > | nodes_ |
size_t | nbSites_ |
size_t | nbBranches_ |
Legacy data storage class for probabilistic rewards mappings.
A 'probabilistic' mapping contains an single value for each branch and each site. This number is an average reward. Probabilistic was coined there by opposition to the'stochastic' mapping, where a path (sequence of rewards along the branch) is available for each branch and site.
Definition at line 28 of file ProbabilisticRewardMapping.h.
|
inline |
Build a new LegacyProbabilisticRewardMapping object.
tree | The tree object to use. It will be cloned for internal use. |
reward | A pointer toward the Reward object that has been used for the mapping, if any. |
numberOfSites | The number of sites to map. |
Definition at line 49 of file ProbabilisticRewardMapping.h.
References setNumberOfSites().
Referenced by clone().
|
inline |
Build a new ProbabilisticRewardMapping object.
tree | The tree object to use. It will be cloned for internal use. |
Definition at line 62 of file ProbabilisticRewardMapping.h.
|
default |
|
inlinevirtual |
Definition at line 78 of file ProbabilisticRewardMapping.h.
|
inlineoverridevirtual |
Implements bpp::LegacyAbstractRewardMapping.
Definition at line 69 of file ProbabilisticRewardMapping.h.
References LegacyProbabilisticRewardMapping().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 174 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_, and bpp::LegacyAbstractMapping::nodes_.
|
inlinevirtualinherited |
Definition at line 162 of file Mapping.h.
References bpp::LegacyAbstractMapping::nodes_.
Referenced by bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
pure virtualinherited |
nodeId | An id of the node to look for in the map. |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
nodeId | An id of the node to look for in the map. |
Implements bpp::LegacyMappingInterface.
Definition at line 184 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_, bpp::LegacyAbstractMapping::nodes_, and bpp::TextTools::toString().
Referenced by bpp::LegacyProbabilisticSubstitutionMapping::getNumberOfSubstitutions(), getReward(), bpp::LegacyRewardMappingTools::readFromStream(), and bpp::LegacySubstitutionMappingTools::readFromStream().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
Referenced by bpp::LegacySubstitutionMappingTools::computeNormForSite(), bpp::LegacyRewardMappingTools::computeSumForSite(), bpp::LegacySubstitutionMappingTools::computeSumForSite(), bpp::LegacySubstitutionMappingTools::computeTotalSubstitutionVectorForSitePerBranch(), and bpp::LegacySubstitutionMappingTools::computeTotalSubstitutionVectorForSitePerType().
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 160 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_.
Referenced by setNumberOfSites(), bpp::LegacyProbabilisticSubstitutionMapping::setNumberOfSites(), setTree(), bpp::LegacyProbabilisticSubstitutionMapping::setTree(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
Referenced by bpp::LegacyRewardMappingTools::computeSumForBranch(), and bpp::LegacySubstitutionMappingTools::computeSumForBranch().
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 158 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbSites_.
Referenced by setTree(), bpp::LegacyProbabilisticSubstitutionMapping::setTree(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
inlinevirtual |
Definition at line 81 of file ProbabilisticRewardMapping.h.
References bpp::LegacyAbstractMapping::getNodeIndex(), and mapping_.
|
pure virtualinherited |
index | The site index. |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
index | The site index. |
Implements bpp::LegacyMappingInterface.
Definition at line 146 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::sitesPositions_.
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 130 of file Mapping.h.
References bpp::LegacyAbstractMapping::tree_.
Referenced by bpp::LegacyAbstractMapping::getSitePosition(), bpp::LegacyAbstractMapping::setSitePosition(), and bpp::LegacyAbstractMapping::tree().
|
inlineoverridevirtual |
Direct access to rewards.
Implements bpp::LegacyRewardMappingInterface.
Definition at line 110 of file ProbabilisticRewardMapping.h.
References mapping_.
|
inlineoverridevirtual |
Direct access to rewards.
Implements bpp::LegacyRewardMappingInterface.
Definition at line 100 of file ProbabilisticRewardMapping.h.
References mapping_.
|
default |
|
inline |
Direct access to rewards.
Definition at line 120 of file ProbabilisticRewardMapping.h.
References mapping_.
|
inline |
Direct access to rewards.
Definition at line 130 of file ProbabilisticRewardMapping.h.
References mapping_.
|
overridevirtual |
Reimplemented from bpp::LegacyAbstractMapping.
Definition at line 18 of file ProbabilisticRewardMapping.cpp.
References bpp::LegacyAbstractMapping::getNumberOfBranches(), mapping_, and bpp::LegacyAbstractMapping::setNumberOfSites().
Referenced by LegacyProbabilisticRewardMapping(), and bpp::LegacyRewardMappingTools::readFromStream().
|
inlineoverridevirtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implements bpp::LegacyMappingInterface.
Definition at line 152 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::sitesPositions_.
Referenced by bpp::LegacyRewardMappingTools::readFromStream(), and bpp::LegacySubstitutionMappingTools::readFromStream().
|
pure virtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implemented in bpp::LegacyAbstractMapping.
|
virtual |
(Re)-set the phylogenetic tree associated to this mapping.
tree | The new tree. |
Definition at line 9 of file ProbabilisticRewardMapping.cpp.
References bpp::LegacyAbstractMapping::getNumberOfBranches(), bpp::LegacyAbstractMapping::getNumberOfSites(), mapping_, bpp::LegacyAbstractMapping::setTree(), and bpp::LegacyAbstractMapping::tree().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 132 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::tree_.
Referenced by bpp::LegacyAbstractMapping::setTree(), setTree(), and bpp::LegacyProbabilisticSubstitutionMapping::setTree().
|
private |
Rewards storage.
Rewards are stored by sites.
Definition at line 39 of file ProbabilisticRewardMapping.h.
Referenced by getReward(), operator()(), operator[](), setNumberOfSites(), and setTree().
|
privateinherited |
Definition at line 93 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getBranchLengths(), bpp::LegacyAbstractMapping::getNodeIndex(), bpp::LegacyAbstractMapping::getNumberOfBranches(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setTree().
|
privateinherited |
Definition at line 92 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getNumberOfSites(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setNumberOfSites().
|
privateinherited |
Definition at line 91 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getBranchLengths(), bpp::LegacyAbstractMapping::getNode(), bpp::LegacyAbstractMapping::getNodeIndex(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setTree().
|
private |
Definition at line 32 of file ProbabilisticRewardMapping.h.
|
privateinherited |
Definition at line 90 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getSitePosition(), bpp::LegacyAbstractMapping::operator=(), bpp::LegacyAbstractMapping::setNumberOfSites(), and bpp::LegacyAbstractMapping::setSitePosition().
|
privateinherited |
Definition at line 89 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::isEmpty(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), bpp::LegacyAbstractMapping::setTree(), and bpp::LegacyAbstractMapping::tree().