bpp-phyl3  3.0.0
bpp::PhyloBranchReward Class Reference

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

+ Inheritance diagram for bpp::PhyloBranchReward:
+ Collaboration diagram for bpp::PhyloBranchReward:

Public Member Functions

 PhyloBranchReward ()
 Constructors. More...
 
 PhyloBranchReward (double length)
 
 PhyloBranchReward (const PhyloBranch &branch)
 
 PhyloBranchReward (const PhyloBranchReward &branch)
 Copy constructor. More...
 
PhyloBranchRewardoperator= (const PhyloBranchReward &branch)
 Assignation operator. More...
 
PhyloBranchRewardclone () const
 
 ~PhyloBranchReward ()
 destructor. In Graph, nothing is changed. More...
 
void setNumberOfSites (size_t nbSites)
 Sets a number of sites. More...
 
size_t getNumberOfSites () const
 Gets the number of sites. More...
 
double getSiteReward (size_t site) const
 
void setSiteReward (size_t site, double rew)
 
double operator() (size_t site) const
 Gets the rewards at a given site on a given type. More...
 
double & operator() (size_t site)
 
const VdoublegetRewards () const
 return rewards More...
 
VdoublegetRewards ()
 
bool hasLength () const
 Has the length been set? More...
 
void deleteLength ()
 Delete length. More...
 
double getLength () const
 What is the branch length? More...
 
void setLength (double newLength)
 
void setProperty (const std::string &name, const Clonable &property)
 Set/add a branch property. More...
 
ClonablegetProperty (const std::string &name)
 
const ClonablegetProperty (const std::string &name) const
 
ClonableremoveProperty (const std::string &name)
 
void deleteProperty (const std::string &name)
 
void removeProperties ()
 Remove all branch properties. More...
 
void deleteProperties ()
 Delete all branch properties. More...
 
bool hasProperty (const std::string &name) const
 
std::vector< std::string > getPropertyNames () const
 
bool hasBootstrapValue () const
 
double getBootstrapValue () const
 

Protected Attributes

Vdouble rewards_
 
bool isLengthDefined_
 
double length_
 
std::map< std::string, Clonable * > properties_
 

Detailed Description

Definition at line 25 of file PhyloBranchReward.h.

Constructor & Destructor Documentation

◆ PhyloBranchReward() [1/4]

bpp::PhyloBranchReward::PhyloBranchReward ( )
inline

Constructors.

Warning
phyloTree_ does not know the edge exists.

Definition at line 44 of file PhyloBranchReward.h.

Referenced by clone().

◆ PhyloBranchReward() [2/4]

bpp::PhyloBranchReward::PhyloBranchReward ( double  length)
inline

Definition at line 49 of file PhyloBranchReward.h.

◆ PhyloBranchReward() [3/4]

bpp::PhyloBranchReward::PhyloBranchReward ( const PhyloBranch branch)
inline

Definition at line 54 of file PhyloBranchReward.h.

◆ PhyloBranchReward() [4/4]

bpp::PhyloBranchReward::PhyloBranchReward ( const PhyloBranchReward branch)
inline

Copy constructor.

Parameters
branchThe branch to copy.

Definition at line 65 of file PhyloBranchReward.h.

◆ ~PhyloBranchReward()

bpp::PhyloBranchReward::~PhyloBranchReward ( )
inline

destructor. In Graph, nothing is changed.

Definition at line 89 of file PhyloBranchReward.h.

Member Function Documentation

◆ clone()

PhyloBranchReward* bpp::PhyloBranchReward::clone ( ) const
inline

Definition at line 83 of file PhyloBranchReward.h.

References PhyloBranchReward().

◆ deleteLength()

void bpp::PhyloBranch::deleteLength ( )
inlineinherited

Delete length.

Definition at line 90 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_.

◆ deleteProperties()

void bpp::PhyloBranch::deleteProperties ( )
inlineinherited

Delete all branch properties.

Definition at line 189 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

Referenced by bpp::PhyloBranch::~PhyloBranch().

◆ deleteProperty()

void bpp::PhyloBranch::deleteProperty ( const std::string &  name)
inlineinherited

◆ getBootstrapValue()

double bpp::PhyloBranch::getBootstrapValue ( ) const
inlineinherited

◆ getLength()

double bpp::PhyloBranch::getLength ( ) const
inlineinherited

What is the branch length?

Returns
a double representing the branch length, 0 if length is not defined.

Definition at line 101 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_, and bpp::PhyloBranch::length_.

Referenced by bpp::PhyloBranchParam::PhyloBranchParam().

◆ getNumberOfSites()

size_t bpp::PhyloBranchReward::getNumberOfSites ( ) const
inline

Gets the number of sites.

Definition at line 103 of file PhyloBranchReward.h.

References rewards_.

Referenced by getSiteReward(), and setSiteReward().

◆ getProperty() [1/2]

Clonable* bpp::PhyloBranch::getProperty ( const std::string &  name)
inlineinherited

◆ getProperty() [2/2]

const Clonable* bpp::PhyloBranch::getProperty ( const std::string &  name) const
inlineinherited

◆ getPropertyNames()

std::vector<std::string> bpp::PhyloBranch::getPropertyNames ( ) const
inlineinherited

Definition at line 200 of file PhyloBranch.h.

References bpp::MapTools::getKeys(), and bpp::PhyloBranch::properties_.

◆ getRewards() [1/2]

Vdouble& bpp::PhyloBranchReward::getRewards ( )
inline

Definition at line 151 of file PhyloBranchReward.h.

References rewards_.

◆ getRewards() [2/2]

const Vdouble& bpp::PhyloBranchReward::getRewards ( ) const
inline

return rewards

Definition at line 146 of file PhyloBranchReward.h.

References rewards_.

◆ getSiteReward()

double bpp::PhyloBranchReward::getSiteReward ( size_t  site) const
inline

Definition at line 109 of file PhyloBranchReward.h.

References getNumberOfSites(), and rewards_.

◆ hasBootstrapValue()

bool bpp::PhyloBranch::hasBootstrapValue ( ) const
inlineinherited

Definition at line 202 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

Referenced by bpp::PhyloBranch::getBootstrapValue().

◆ hasLength()

bool bpp::PhyloBranch::hasLength ( ) const
inlineinherited

Has the length been set?

Returns
true if a length has been defined

Definition at line 81 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_.

Referenced by bpp::PhyloBranchParam::PhyloBranchParam().

◆ hasProperty()

bool bpp::PhyloBranch::hasProperty ( const std::string &  name) const
inlineinherited

◆ operator()() [1/2]

double& bpp::PhyloBranchReward::operator() ( size_t  site)
inline

Definition at line 137 of file PhyloBranchReward.h.

References rewards_.

◆ operator()() [2/2]

double bpp::PhyloBranchReward::operator() ( size_t  site) const
inline

Gets the rewards at a given site on a given type.

Without check

Definition at line 132 of file PhyloBranchReward.h.

References rewards_.

◆ operator=()

PhyloBranchReward& bpp::PhyloBranchReward::operator= ( const PhyloBranchReward branch)
inline

Assignation operator.

Parameters
branchthe branch to copy.
Returns
A reference toward this branch.

Definition at line 76 of file PhyloBranchReward.h.

References bpp::PhyloBranch::operator=(), and rewards_.

◆ removeProperties()

void bpp::PhyloBranch::removeProperties ( )
inlineinherited

Remove all branch properties.

Attached objects will not be deleted.

Definition at line 181 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

◆ removeProperty()

Clonable* bpp::PhyloBranch::removeProperty ( const std::string &  name)
inlineinherited

◆ setLength()

void bpp::PhyloBranch::setLength ( double  newLength)
inlineinherited

Define a new branch length

Parameters
newLengtha double repserenting the new length of the branch

Definition at line 114 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_, and bpp::PhyloBranch::length_.

◆ setNumberOfSites()

void bpp::PhyloBranchReward::setNumberOfSites ( size_t  nbSites)
inline

Sets a number of sites.

Definition at line 95 of file PhyloBranchReward.h.

References rewards_.

◆ setProperty()

void bpp::PhyloBranch::setProperty ( const std::string &  name,
const Clonable property 
)
inlineinherited

Set/add a branch property.

If no property with the same name is found, the new property will be added to the list. Conversely, the property will be deleted and replaced by the new one. If you want to keep a copy of the old property, consider using the removeProperty function before.

Parameters
nameThe name of the property to set.
propertyThe property object (will be cloned).

Definition at line 130 of file PhyloBranch.h.

References bpp::PhyloBranch::hasProperty(), and bpp::PhyloBranch::properties_.

◆ setSiteReward()

void bpp::PhyloBranchReward::setSiteReward ( size_t  site,
double  rew 
)
inline

Definition at line 116 of file PhyloBranchReward.h.

References getNumberOfSites(), and rewards_.

Member Data Documentation

◆ isLengthDefined_

bool bpp::PhyloBranch::isLengthDefined_
protectedinherited

◆ length_

double bpp::PhyloBranch::length_
protectedinherited

◆ properties_

◆ rewards_

Vdouble bpp::PhyloBranchReward::rewards_
protected

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