bpp-phyl  2.2.0
bpp::AbstractRewardMapping Class Referenceabstract

Partial implementation of the reward mapping interface. More...

#include <Bpp/Phyl/Mapping/RewardMapping.h>

+ Inheritance diagram for bpp::AbstractRewardMapping:
+ Collaboration diagram for bpp::AbstractRewardMapping:

Public Member Functions

 AbstractRewardMapping (const Tree &tree)
 
 AbstractRewardMapping (const AbstractRewardMapping &arm)
 
AbstractRewardMappingclone () const =0
 
AbstractRewardMappingoperator= (const AbstractRewardMapping &arm)
 
virtual ~AbstractRewardMapping ()
 
virtual double & operator() (size_t nodeIndex, size_t siteIndex)=0
 
virtual const double & operator() (size_t nodeIndex, size_t siteIndex) const =0
 
virtual const TreegetTree () const =0
 
virtual bool isEmpty () const =0
 
virtual size_t getNumberOfSites () const =0
 
virtual size_t getNumberOfBranches () const =0
 
virtual int getSitePosition (size_t index) const =0
 
virtual std::vector< double > getBranchLengths () const =0
 
virtual size_t getNodeIndex (int nodeId) const =0 throw (NodeNotFoundException)
 
virtual void setSitePosition (size_t index, int position)=0
 Set the position of a given site. More...
 
bool isEmpty () const
 
const TreeTemplate< Node > & getTree () const throw (Exception)
 
void setTree (const Tree &tree)
 
int getSitePosition (size_t index) const throw (Exception)
 
void setSitePosition (size_t index, int position) throw (Exception)
 Set the position of a given site. More...
 
size_t getNumberOfSites () const
 
size_t getNumberOfBranches () const
 
virtual const NodegetNode (size_t nodeIndex) const
 
virtual void setNumberOfSites (size_t numberOfSites)
 
virtual std::vector< double > getBranchLengths () const
 
virtual size_t getNodeIndex (int nodeId) const throw (NodeNotFoundException)
 

Detailed Description

Partial implementation of the reward mapping interface.

This implementation copies the input tree in a TreeTemplate<Node> object.

Definition at line 87 of file RewardMapping.h.

Constructor & Destructor Documentation

◆ AbstractRewardMapping() [1/2]

bpp::AbstractRewardMapping::AbstractRewardMapping ( const Tree tree)
inline

Definition at line 94 of file RewardMapping.h.

◆ AbstractRewardMapping() [2/2]

bpp::AbstractRewardMapping::AbstractRewardMapping ( const AbstractRewardMapping arm)
inline

Definition at line 96 of file RewardMapping.h.

◆ ~AbstractRewardMapping()

virtual bpp::AbstractRewardMapping::~AbstractRewardMapping ( )
inlinevirtual

Definition at line 109 of file RewardMapping.h.

Member Function Documentation

◆ clone()

AbstractRewardMapping* bpp::AbstractRewardMapping::clone ( ) const
pure virtual

◆ getBranchLengths() [1/2]

virtual std::vector<double> bpp::Mapping::getBranchLengths ( ) const
pure virtualinherited
Returns
A vector with all tree branch lengths.

Implemented in bpp::AbstractMapping.

◆ getBranchLengths() [2/2]

virtual std::vector<double> bpp::AbstractMapping::getBranchLengths ( ) const
inlinevirtualinherited
Returns
A vector with all tree branch lengths.

Implements bpp::Mapping.

Definition at line 222 of file Mapping.h.

References bpp::AbstractMapping::nbBranches_, and bpp::AbstractMapping::nodes_.

◆ getNode()

virtual const Node* bpp::AbstractMapping::getNode ( size_t  nodeIndex) const
inlinevirtualinherited

Definition at line 212 of file Mapping.h.

References bpp::AbstractMapping::nodes_.

◆ getNodeIndex() [1/2]

virtual size_t bpp::Mapping::getNodeIndex ( int  nodeId) const
throw (NodeNotFoundException
)
pure virtualinherited
Parameters
nodeIdAn id of the node to look for in the map.
Returns
The mapping index for the specified node id.

Implemented in bpp::AbstractMapping.

◆ getNodeIndex() [2/2]

virtual size_t bpp::AbstractMapping::getNodeIndex ( int  nodeId) const
throw (NodeNotFoundException
)
inlinevirtualinherited

◆ getNumberOfBranches() [1/2]

virtual size_t bpp::Mapping::getNumberOfBranches ( ) const
pure virtualinherited

◆ getNumberOfBranches() [2/2]

size_t bpp::AbstractMapping::getNumberOfBranches ( ) const
inlinevirtualinherited

◆ getNumberOfSites() [1/2]

virtual size_t bpp::Mapping::getNumberOfSites ( ) const
pure virtualinherited

◆ getNumberOfSites() [2/2]

◆ getSitePosition() [1/2]

virtual int bpp::Mapping::getSitePosition ( size_t  index) const
pure virtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implemented in bpp::AbstractMapping.

◆ getSitePosition() [2/2]

int bpp::AbstractMapping::getSitePosition ( size_t  index) const
throw (Exception
)
inlinevirtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implements bpp::Mapping.

Definition at line 196 of file Mapping.h.

References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::sitesPositions_.

◆ getTree() [1/2]

virtual const Tree& bpp::Mapping::getTree ( ) const
pure virtualinherited
Returns
Get the phylogenetic tree associated to this mapping.

Implemented in bpp::AbstractMapping.

◆ getTree() [2/2]

const TreeTemplate<Node>& bpp::AbstractMapping::getTree ( ) const
throw (Exception
)
inlinevirtualinherited
Returns
Get the phylogenetic tree associated to this mapping.

Implements bpp::Mapping.

Definition at line 182 of file Mapping.h.

References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::tree_.

◆ isEmpty() [1/2]

virtual bool bpp::Mapping::isEmpty ( ) const
pure virtualinherited
Returns
True is the map is empty, that is, if no tree is associated to the map yet.

Implemented in bpp::AbstractMapping.

◆ isEmpty() [2/2]

bool bpp::AbstractMapping::isEmpty ( ) const
inlinevirtualinherited
Returns
True is the map is empty, that is, if no tree is associated to the map yet.

Implements bpp::Mapping.

Definition at line 180 of file Mapping.h.

References bpp::AbstractMapping::tree_.

Referenced by bpp::AbstractMapping::getSitePosition(), bpp::AbstractMapping::getTree(), and bpp::AbstractMapping::setSitePosition().

◆ operator()() [1/2]

virtual double& bpp::RewardMapping::operator() ( size_t  nodeIndex,
size_t  siteIndex 
)
pure virtualinherited

◆ operator()() [2/2]

virtual const double& bpp::RewardMapping::operator() ( size_t  nodeIndex,
size_t  siteIndex 
) const
pure virtualinherited

◆ operator=()

AbstractRewardMapping& bpp::AbstractRewardMapping::operator= ( const AbstractRewardMapping arm)
inline

◆ setNumberOfSites()

virtual void bpp::AbstractMapping::setNumberOfSites ( size_t  numberOfSites)
inlinevirtualinherited

◆ setSitePosition() [1/2]

virtual void bpp::Mapping::setSitePosition ( size_t  index,
int  position 
)
pure virtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implemented in bpp::AbstractMapping.

◆ setSitePosition() [2/2]

void bpp::AbstractMapping::setSitePosition ( size_t  index,
int  position 
)
throw (Exception
)
inlinevirtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implements bpp::Mapping.

Definition at line 202 of file Mapping.h.

References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::sitesPositions_.

◆ setTree()

void bpp::AbstractMapping::setTree ( const Tree tree)
inlineinherited

The documentation for this class was generated from the following file: