bpp-phyl3  3.0.0
bpp::PhyloBranch Class Reference

#include <Bpp/Phyl/Tree/PhyloBranch.h>

+ Inheritance diagram for bpp::PhyloBranch:
+ Collaboration diagram for bpp::PhyloBranch:

Public Member Functions

 PhyloBranch ()
 Constructors. More...
 
 PhyloBranch (double length)
 
 PhyloBranch (const PhyloBranchParam &branch)
 
 PhyloBranch (const PhyloBranch &branch)
 Copy constructor. More...
 
PhyloBranchoperator= (const PhyloBranch &branch)
 Assignation operator. More...
 
PhyloBranchclone () const
 
virtual ~PhyloBranch ()
 destructor. In Graph, nothing is changed. More...
 
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

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

Detailed Description

Definition at line 20 of file PhyloBranch.h.

Constructor & Destructor Documentation

◆ PhyloBranch() [1/4]

bpp::PhyloBranch::PhyloBranch ( )
inline

Constructors.

Warning
phyloTree_ does not know the edge exists.

Definition at line 35 of file PhyloBranch.h.

Referenced by clone().

◆ PhyloBranch() [2/4]

bpp::PhyloBranch::PhyloBranch ( double  length)
inline

Definition at line 42 of file PhyloBranch.h.

◆ PhyloBranch() [3/4]

PhyloBranch::PhyloBranch ( const PhyloBranchParam branch)

Definition at line 25 of file PhyloBranch.cpp.

◆ PhyloBranch() [4/4]

PhyloBranch::PhyloBranch ( const PhyloBranch branch)

Copy constructor.

Parameters
branchThe branch to copy.

Copy constructor:

Definition at line 13 of file PhyloBranch.cpp.

References properties_.

◆ ~PhyloBranch()

virtual bpp::PhyloBranch::~PhyloBranch ( )
inlinevirtual

destructor. In Graph, nothing is changed.

Definition at line 72 of file PhyloBranch.h.

References deleteProperties().

Member Function Documentation

◆ clone()

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

Definition at line 66 of file PhyloBranch.h.

References PhyloBranch().

◆ deleteLength()

void bpp::PhyloBranch::deleteLength ( )
inline

Delete length.

Definition at line 90 of file PhyloBranch.h.

References isLengthDefined_.

◆ deleteProperties()

void bpp::PhyloBranch::deleteProperties ( )
inline

Delete all branch properties.

Definition at line 189 of file PhyloBranch.h.

References properties_.

Referenced by ~PhyloBranch().

◆ deleteProperty()

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

Definition at line 165 of file PhyloBranch.h.

References hasProperty(), and properties_.

◆ getBootstrapValue()

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

Definition at line 207 of file PhyloBranch.h.

References hasBootstrapValue(), and properties_.

◆ getLength()

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

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 isLengthDefined_, and length_.

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

◆ getProperty() [1/2]

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

Definition at line 137 of file PhyloBranch.h.

References hasProperty(), and properties_.

◆ getProperty() [2/2]

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

Definition at line 145 of file PhyloBranch.h.

References hasProperty(), and properties_.

◆ getPropertyNames()

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

Definition at line 200 of file PhyloBranch.h.

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

◆ hasBootstrapValue()

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

Definition at line 202 of file PhyloBranch.h.

References properties_.

Referenced by getBootstrapValue().

◆ hasLength()

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

Has the length been set?

Returns
true if a length has been defined

Definition at line 81 of file PhyloBranch.h.

References isLengthDefined_.

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

◆ hasProperty()

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

Definition at line 198 of file PhyloBranch.h.

References properties_.

Referenced by deleteProperty(), getProperty(), removeProperty(), and setProperty().

◆ operator=()

PhyloBranch & PhyloBranch::operator= ( const PhyloBranch branch)

Assignation operator.

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

Assignation operator:

Definition at line 34 of file PhyloBranch.cpp.

References isLengthDefined_, length_, and properties_.

Referenced by bpp::PhyloBranchMapping::operator=(), and bpp::PhyloBranchReward::operator=().

◆ removeProperties()

void bpp::PhyloBranch::removeProperties ( )
inline

Remove all branch properties.

Attached objects will not be deleted.

Definition at line 181 of file PhyloBranch.h.

References properties_.

◆ removeProperty()

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

Definition at line 153 of file PhyloBranch.h.

References hasProperty(), and properties_.

◆ setLength()

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

Define a new branch length

Parameters
newLengtha double repserenting the new length of the branch

Definition at line 114 of file PhyloBranch.h.

References isLengthDefined_, and length_.

◆ setProperty()

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

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 hasProperty(), and properties_.

Member Data Documentation

◆ isLengthDefined_

bool bpp::PhyloBranch::isLengthDefined_
protected

Definition at line 23 of file PhyloBranch.h.

Referenced by deleteLength(), getLength(), hasLength(), operator=(), and setLength().

◆ length_

double bpp::PhyloBranch::length_
protected

Definition at line 24 of file PhyloBranch.h.

Referenced by getLength(), operator=(), and setLength().

◆ properties_

std::map<std::string, Clonable*> bpp::PhyloBranch::properties_
mutableprotected

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