bpp-phyl3  3.0.0
bpp::NodeTemplate< NodeInfos > Class Template Reference

The NodeTemplate class. More...

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

+ Inheritance diagram for bpp::NodeTemplate< NodeInfos >:
+ Collaboration diagram for bpp::NodeTemplate< NodeInfos >:

Public Member Functions

 NodeTemplate ()
 Build a new void NodeTemplate object. More...
 
 NodeTemplate (int id)
 Build a new NodeTemplate with specified id. More...
 
 NodeTemplate (const std::string &name)
 Build a new NodeTemplate with specified name. More...
 
 NodeTemplate (int id, const std::string &name)
 Build a new NodeTemplate with specified id and name. More...
 
virtual ~NodeTemplate ()
 
const NodeTemplate< NodeInfos > * getFather () const
 Get the father of this node is there is one. More...
 
NodeTemplate< NodeInfos > * getFather ()
 Get the father of this node is there is one. More...
 
NodeTemplate< NodeInfos > * removeFather ()
 Remove the father of this node. More...
 
const NodeTemplate< NodeInfos > * getSon (size_t i) const
 
NodeTemplate< NodeInfos > * getSon (size_t i)
 
std::vector< const NodeTemplate< NodeInfos > * > getNeighbors () const
 
std::vector< NodeTemplate< NodeInfos > * > getNeighbors ()
 
NodeTemplate< NodeInfos > * operator[] (int i)
 
const NodeTemplate< NodeInfos > * operator[] (int i) const
 
virtual const NodeInfos & getInfos () const
 
virtual NodeInfos & getInfos ()
 
virtual void setInfos (const NodeInfos &infos)
 Set the information to be associated to this node. More...
 
void addSubTree (const PhyloTree &tree, std::shared_ptr< PhyloNode > phyloNode)
 
virtual size_t degree () const
 
virtual bool operator== (const Node &node) const
 
virtual bool isLeaf () const
 
virtual bool hasNoSon () const
 
Identity
virtual int getId () const
 Get the node's id. More...
 
virtual void setId (int id)
 Set this node's id. More...
 
virtual std::vector< int > getSonsId () const
 
Name:
virtual std::string getName () const
 Get the name associated to this node, if there is one, otherwise throw a NodeException. More...
 
virtual void setName (const std::string &name)
 Give a name or update the name associated to the node. More...
 
virtual void deleteName ()
 Delete the name associated to this node (do nothing if there is no name). More...
 
virtual bool hasName () const
 Tell is this node has a name. More...
 
Distances:
virtual double getDistanceToFather () const
 Get the distance to the father node is there is one, otherwise throw a NodeException. More...
 
virtual void setDistanceToFather (double distance)
 Set or update the distance toward the father node. More...
 
virtual void deleteDistanceToFather ()
 Delete the distance to the father node. More...
 
virtual bool hasDistanceToFather () const
 Tell is this node has a distance to the father. More...
 
Father:
virtual int getFatherId () const
 
virtual void setFather (Node *node)
 Set the father node of this node. More...
 
virtual bool hasFather () const
 Tell if this node has a father node. More...
 
Sons:
virtual size_t getNumberOfSons () const
 
virtual std::vector< Node * > & getSons ()
 
virtual void addSon (size_t pos, Node *node)
 
virtual void addSon (Node *node)
 
virtual void setSon (size_t pos, Node *node)
 
virtual NoderemoveSon (size_t pos)
 
virtual void removeSon (Node *node)
 
virtual void removeSons ()
 
virtual void swap (size_t branch1, size_t branch2)
 
virtual size_t getSonPosition (const Node *son) const
 
Node properties:
virtual void setNodeProperty (const std::string &name, const Clonable &property)
 Set/add a node property. More...
 
virtual ClonablegetNodeProperty (const std::string &name)
 
virtual const ClonablegetNodeProperty (const std::string &name) const
 
virtual ClonableremoveNodeProperty (const std::string &name)
 
virtual void deleteNodeProperty (const std::string &name)
 
virtual void removeNodeProperties ()
 Remove all node properties. More...
 
virtual void deleteNodeProperties ()
 Delete all node properties. More...
 
virtual bool hasNodeProperty (const std::string &name) const
 
virtual std::vector< std::string > getNodePropertyNames () const
 
Branch properties:
virtual void setBranchProperty (const std::string &name, const Clonable &property)
 Set/add a branch property. More...
 
virtual ClonablegetBranchProperty (const std::string &name)
 
virtual const ClonablegetBranchProperty (const std::string &name) const
 
virtual ClonableremoveBranchProperty (const std::string &name)
 
virtual void deleteBranchProperty (const std::string &name)
 
virtual void removeBranchProperties ()
 Remove all branch properties. More...
 
virtual void deleteBranchProperties ()
 Delete all branch properties. More...
 
virtual bool hasBranchProperty (const std::string &name) const
 
virtual std::vector< std::string > getBranchPropertyNames () const
 
virtual bool hasBootstrapValue () const
 
virtual double getBootstrapValue () const
 

Protected Member Functions

 NodeTemplate (const Node &node)
 Copy constructor. More...
 
 NodeTemplate (const NodeTemplate< NodeInfos > &node)
 Copy constructor. More...
 
NodeTemplate< NodeInfos > & operator= (const NodeTemplate< NodeInfos > &node)
 Assignation operator. More...
 
NodeTemplate< NodeInfos > * clone () const
 

Protected Attributes

int id_
 
std::string * name_
 
std::vector< Node * > sons_
 
Nodefather_
 
double * distanceToFather_
 
std::map< std::string, Clonable * > nodeProperties_
 
std::map< std::string, Clonable * > branchProperties_
 

Private Attributes

NodeInfos infos_
 

Friends

class TreeTemplateTools
 

Detailed Description

template<class NodeInfos>
class bpp::NodeTemplate< NodeInfos >

The NodeTemplate class.

This class inherits from the Node class. Its is a generic way to store any information to a node. A NodeTemplate only add the setInfos and getInfos methods, which set and retrieve a NodeInfo, whose type is given as a template of the class. This class is mainly for computation conveniency, one may define a NodeInfo class with several results attached. An example is provided in the PGMA class. Another way is to use a map<Node *, NodeInfos>, with the limitation of the map access. One may also wish to use the property system of the Node class, but properties are stored as in a map<string, Clonable *>, with the drawbacks of the slow map access and the systematic use of dynamic_cast<NodeInfo *> to convert from Clonable *.

This class redefines all constructors and access methods (get*) with return types as NodeTemplate and not Node (using covariant returns).

See also
Node, TreeTemplate

Definition at line 37 of file NodeTemplate.h.

Constructor & Destructor Documentation

◆ NodeTemplate() [1/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( )
inline

Build a new void NodeTemplate object.

Definition at line 49 of file NodeTemplate.h.

◆ NodeTemplate() [2/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( int  id)
inline

Build a new NodeTemplate with specified id.

Definition at line 54 of file NodeTemplate.h.

◆ NodeTemplate() [3/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( const std::string &  name)
inline

Build a new NodeTemplate with specified name.

Definition at line 59 of file NodeTemplate.h.

◆ NodeTemplate() [4/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( int  id,
const std::string &  name 
)
inline

Build a new NodeTemplate with specified id and name.

Definition at line 64 of file NodeTemplate.h.

◆ NodeTemplate() [5/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( const Node node)
inlineprotected

Copy constructor.

Parameters
nodeThe node to copy.

Definition at line 72 of file NodeTemplate.h.

◆ NodeTemplate() [6/6]

template<class NodeInfos >
bpp::NodeTemplate< NodeInfos >::NodeTemplate ( const NodeTemplate< NodeInfos > &  node)
inlineprotected

Copy constructor.

Parameters
nodeThe node to copy.

Definition at line 79 of file NodeTemplate.h.

◆ ~NodeTemplate()

template<class NodeInfos >
virtual bpp::NodeTemplate< NodeInfos >::~NodeTemplate ( )
inlinevirtual

Definition at line 99 of file NodeTemplate.h.

Member Function Documentation

◆ addSon() [1/2]

virtual void bpp::Node::addSon ( Node node)
inlinevirtualinherited

Definition at line 386 of file Node.h.

References bpp::Node::father_, and bpp::Node::sons_.

◆ addSon() [2/2]

◆ addSubTree()

◆ clone()

template<class NodeInfos >
NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::clone ( ) const
inlineprotected

Definition at line 96 of file NodeTemplate.h.

◆ degree()

◆ deleteBranchProperties()

virtual void bpp::Node::deleteBranchProperties ( )
inlinevirtualinherited

Delete all branch properties.

Definition at line 644 of file Node.h.

References bpp::Node::branchProperties_.

◆ deleteBranchProperty()

virtual void bpp::Node::deleteBranchProperty ( const std::string &  name)
inlinevirtualinherited

◆ deleteDistanceToFather()

virtual void bpp::Node::deleteDistanceToFather ( )
inlinevirtualinherited

Delete the distance to the father node.

Definition at line 276 of file Node.h.

References bpp::Node::distanceToFather_.

Referenced by bpp::TreeTemplateTools::deleteBranchLengths().

◆ deleteName()

virtual void bpp::Node::deleteName ( )
inlinevirtualinherited

Delete the name associated to this node (do nothing if there is no name).

Definition at line 223 of file Node.h.

References bpp::Node::name_.

◆ deleteNodeProperties()

virtual void bpp::Node::deleteNodeProperties ( )
inlinevirtualinherited

Delete all node properties.

Definition at line 554 of file Node.h.

References bpp::Node::nodeProperties_.

◆ deleteNodeProperty()

virtual void bpp::Node::deleteNodeProperty ( const std::string &  name)
inlinevirtualinherited

◆ getBootstrapValue()

double Node::getBootstrapValue ( ) const
virtualinherited

◆ getBranchProperty() [1/2]

◆ getBranchProperty() [2/2]

virtual const Clonable* bpp::Node::getBranchProperty ( const std::string &  name) const
inlinevirtualinherited

Definition at line 600 of file Node.h.

References bpp::Node::branchProperties_, and bpp::Node::hasBranchProperty().

◆ getBranchPropertyNames()

virtual std::vector<std::string> bpp::Node::getBranchPropertyNames ( ) const
inlinevirtualinherited

◆ getDistanceToFather()

virtual double bpp::Node::getDistanceToFather ( ) const
inlinevirtualinherited

Get the distance to the father node is there is one, otherwise throw a NodeException.

Returns
The distance to the father node.

Definition at line 250 of file Node.h.

References bpp::Node::distanceToFather_, and bpp::Node::hasDistanceToFather().

Referenced by bpp::PhyloTree::addSubTree(), bpp::BranchLengthsTreeDrawingListener::afterDrawBranch(), bpp::PhyloStatistics::computeForSubtree_(), bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::AbstractNonHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::TreeTemplateTools::dropSubtree(), bpp::NonHomogeneousSequenceSimulator::evolve(), bpp::PhylogramDrawBranchEvent::getBranchCursor(), bpp::TreeTemplateTools::getBranchLengths(), bpp::TreeTemplateTools::getHeight(), bpp::TreeTemplateTools::getHeights(), bpp::HierarchicalClustering::getParentNode(), bpp::PGMA::getParentNode(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::getTotalLength(), bpp::NonHomogeneousSequenceSimulator::init(), bpp::TreeTemplateTools::midRoot(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::PhylogramPlot::recursivePlot_(), bpp::TreeTemplateTools::scaleTree(), bpp::Nhx::treeToParenthesis(), bpp::TreeTemplateTools::treeToParenthesis(), bpp::TreeTemplateTools::unresolveUncertainNodes(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().

◆ getFather() [1/2]

template<class NodeInfos >
NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::getFather ( )
inlinevirtual

Get the father of this node is there is one.

Returns
A pointer toward the father node, 0 if there is not.

Reimplemented from bpp::Node.

Definition at line 104 of file NodeTemplate.h.

References bpp::Node::father_.

◆ getFather() [2/2]

template<class NodeInfos >
const NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::getFather ( ) const
inlinevirtual

Get the father of this node is there is one.

Returns
A pointer toward the father node, 0 if there is not.

Reimplemented from bpp::Node.

Definition at line 102 of file NodeTemplate.h.

References bpp::Node::father_.

Referenced by bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::AbstractTreeDrawing::drawAtBranch(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), and bpp::NonHomogeneousSequenceSimulator::multipleEvolveInternal().

◆ getFatherId()

virtual int bpp::Node::getFatherId ( ) const
inlinevirtualinherited

Definition at line 315 of file Node.h.

References bpp::Node::father_, and bpp::Node::getId().

◆ getId()

virtual int bpp::Node::getId ( ) const
inlinevirtualinherited

Get the node's id.

Returns
The identity tag of this node.

Definition at line 170 of file Node.h.

References bpp::Node::id_.

Referenced by bpp::AbstractNonHomogeneousTreeLikelihood::AbstractNonHomogeneousTreeLikelihood(), bpp::PhyloTree::addSubTree(), bpp::BipartitionList::buildBitBipartitions(), bpp::PhyloTreeTools::buildFromTreeTemplate(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresForNode(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPostorderForNode(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::DRTreeParsimonyScore::computeScoresPreorderForNode(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::RHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::AbstractNonHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::RHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::RHomogeneousTreeLikelihood::displayLikelihood(), bpp::RNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::NNIHomogeneousTreeLikelihood::doNNI(), bpp::InOrderTreeIterator::doStep(), bpp::TreeTemplateTools::getAncestorsId(), bpp::TreeTemplateTools::getBranchProperties(), bpp::Node::getFatherId(), bpp::DRHomogeneousMixedTreeLikelihood::getFirstOrderDerivative(), bpp::DRNonHomogeneousTreeLikelihood::getFirstOrderDerivative(), bpp::DRHomogeneousTreeLikelihood::getFirstOrderDerivative(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::PostOrderTreeIterator::getLeftMostPredecessor(), bpp::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodesId(), bpp::DRHomogeneousMixedTreeLikelihood::getSecondOrderDerivative(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::DRHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::Node::getSonPosition(), bpp::TreeTemplateTools::incrementAllIds(), bpp::NonHomogeneousSequenceSimulator::init(), bpp::DRTreeParsimonyData::init_(), bpp::AbstractNonHomogeneousTreeLikelihood::init_(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::DRASRTreeLikelihoodData::initLikelihoodsWithPatterns(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::AbstractNonHomogeneousTreeLikelihood::operator=(), bpp::Nhx::propertiesToParenthesis(), bpp::LegacyMarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::DRTreeParsimonyData::reInit_(), bpp::Node::removeSon(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::NNITopologySearch::searchBetter(), bpp::NNITopologySearch::searchFast(), bpp::TreeTemplateTools::searchFirstNodeWithId(), bpp::TreeTemplateTools::searchLeaf(), bpp::NNITopologySearch::searchPhyML(), bpp::AbstractHomogeneousTreeLikelihood::setModel(), bpp::AbstractNonHomogeneousTreeLikelihood::setSubstitutionModelSet(), bpp::NNIHomogeneousTreeLikelihood::testNNI(), bpp::DRTreeParsimonyScore::testNNI(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().

◆ getInfos() [1/2]

template<class NodeInfos >
virtual NodeInfos& bpp::NodeTemplate< NodeInfos >::getInfos ( )
inlinevirtual
Returns
A reference toward the information object associated to this node.

Definition at line 149 of file NodeTemplate.h.

References bpp::NodeTemplate< NodeInfos >::infos_.

◆ getInfos() [2/2]

◆ getName()

◆ getNeighbors() [1/2]

template<class NodeInfos >
std::vector<NodeTemplate<NodeInfos>*> bpp::NodeTemplate< NodeInfos >::getNeighbors ( )
inline

Definition at line 123 of file NodeTemplate.h.

References bpp::Node::getNeighbors().

◆ getNeighbors() [2/2]

template<class NodeInfos >
std::vector<const NodeTemplate<NodeInfos>*> bpp::NodeTemplate< NodeInfos >::getNeighbors ( ) const
inline

Definition at line 112 of file NodeTemplate.h.

References bpp::Node::getNeighbors().

◆ getNodeProperty() [1/2]

◆ getNodeProperty() [2/2]

virtual const Clonable* bpp::Node::getNodeProperty ( const std::string &  name) const
inlinevirtualinherited

Definition at line 510 of file Node.h.

References bpp::Node::hasNodeProperty(), and bpp::Node::nodeProperties_.

◆ getNodePropertyNames()

virtual std::vector<std::string> bpp::Node::getNodePropertyNames ( ) const
inlinevirtualinherited

◆ getNumberOfSons()

virtual size_t bpp::Node::getNumberOfSons ( ) const
inlinevirtualinherited

Definition at line 355 of file Node.h.

References bpp::Node::sons_.

Referenced by bpp::PhyloTree::addSubTree(), bpp::BipartitionList::buildBitBipartitions(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), bpp::TreeTemplateTools::cloneSubtree(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::PhyloStatistics::computeForSubtree_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::RHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::RHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::Node::degree(), bpp::TreeTemplateTools::deleteBranchLengths(), bpp::TreeTemplateTools::deleteBranchProperties(), bpp::TreeTemplateTools::deleteNodeProperties(), bpp::NonHomogeneousSequenceSimulator::dEvolve(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::InOrderTreeIterator::doStep(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), bpp::TreeTemplateTools::getBranchLengths(), bpp::TreeTemplateTools::getBranchProperties(), bpp::TreeTemplateTools::getBranchPropertyNames(), bpp::TreeTemplateTools::getDepth(), bpp::TreeTemplateTools::getDepths(), bpp::TreeTemplateTools::getHeight(), bpp::TreeTemplateTools::getHeights(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::TreeTemplateTools::getLeavesNames(), bpp::PostOrderTreeIterator::getLeftMostPredecessor(), bpp::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodePropertyNames(), bpp::TreeTemplateTools::getNodesId(), bpp::TreeTemplateTools::getNumberOfBranches(), bpp::TreeTemplateTools::getNumberOfLeaves(), bpp::TreeTemplateTools::getNumberOfNodes(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::getTotalLength(), bpp::Node::hasNoSon(), bpp::TreeTemplateTools::haveSameOrderedTopology(), bpp::TreeTemplateTools::incrementAllIds(), bpp::DRTreeParsimonyData::init_(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::DRASRTreeLikelihoodData::initLikelihoodsWithPatterns(), bpp::TreeTemplateTools::isMultifurcating(), bpp::NonHomogeneousSequenceSimulator::multipleEvolve(), bpp::NonHomogeneousSequenceSimulator::multipleEvolveInternal(), bpp::PostOrderTreeIterator::next(), bpp::PreOrderTreeIterator::next(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::LegacyMarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::CladogramPlot::recursivePlot_(), bpp::PhylogramPlot::recursivePlot_(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::DRTreeParsimonyData::reInit_(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::TreeTemplateTools::scaleTree(), bpp::TreeTemplateTools::searchFirstNodeWithId(), bpp::TreeTemplateTools::searchLeaf(), bpp::TreeTemplateTools::setBranchLengths(), bpp::TreeTemplateTools::setVoidBranchLengths(), bpp::NonHomogeneousSequenceSimulator::simulateSite(), bpp::Nhx::treeToParenthesis(), bpp::TreeTemplateTools::treeToParenthesis(), and bpp::TreeTemplateTools::unresolveUncertainNodes().

◆ getSon() [1/2]

template<class NodeInfos >
NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::getSon ( size_t  i)
inlinevirtual

Reimplemented from bpp::Node.

Definition at line 110 of file NodeTemplate.h.

References bpp::Node::sons_.

◆ getSon() [2/2]

◆ getSonPosition()

◆ getSons()

virtual std::vector<Node*>& bpp::Node::getSons ( )
inlinevirtualinherited

◆ getSonsId()

virtual std::vector<int> bpp::Node::getSonsId ( ) const
inlinevirtualinherited

Definition at line 179 of file Node.h.

References bpp::Node::sons_.

◆ hasBootstrapValue()

bool Node::hasBootstrapValue ( ) const
virtualinherited

Definition at line 163 of file Node.cpp.

References bpp::TreeTools::BOOTSTRAP, and bpp::Node::hasBranchProperty().

◆ hasBranchProperty()

◆ hasDistanceToFather()

◆ hasFather()

virtual bool bpp::Node::hasFather ( ) const
inlinevirtualinherited

Tell if this node has a father node.

Definition at line 346 of file Node.h.

References bpp::Node::father_.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::Node::degree(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::NNIHomogeneousTreeLikelihood::doNNI(), bpp::DRTreeParsimonyScore::doNNI(), bpp::AbstractTreeDrawing::drawAtBranch(), bpp::TreeTemplateTools::dropSubtree(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), bpp::TreeTemplateTools::getAncestorsId(), bpp::Node::getNeighbors(), bpp::TreeTemplateTools::getPathBetweenAnyTwoNodes(), bpp::DRTreeParsimonyData::init_(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::TreeTemplateTools::isRoot(), bpp::NonHomogeneousSequenceSimulator::multipleEvolveInternal(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::DRTreeParsimonyData::reInit_(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::TreeTemplateTools::scaleTree(), bpp::NNIHomogeneousTreeLikelihood::testNNI(), and bpp::DRTreeParsimonyScore::testNNI().

◆ hasName()

virtual bool bpp::Node::hasName ( ) const
inlinevirtualinherited

◆ hasNodeProperty()

◆ hasNoSon()

◆ isLeaf()

virtual bool bpp::Node::isLeaf ( ) const
inlinevirtualinherited

Definition at line 667 of file Node.h.

References bpp::Node::degree().

Referenced by bpp::LeafNamesTreeDrawingListener::afterDrawNode(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::PhyloStatistics::computeForSubtree_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::RHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::TreeTemplateTools::getNumberOfLeaves(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::DRTreeParsimonyData::init_(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::DRASRTreeLikelihoodData::initLikelihoodsWithPatterns(), bpp::LegacyMarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::CladogramPlot::recursivePlot_(), bpp::PhylogramPlot::recursivePlot_(), bpp::DRASDRTreeLikelihoodData::reInit(), and bpp::DRTreeParsimonyData::reInit_().

◆ operator=()

template<class NodeInfos >
NodeTemplate<NodeInfos>& bpp::NodeTemplate< NodeInfos >::operator= ( const NodeTemplate< NodeInfos > &  node)
inlineprotected

Assignation operator.

Parameters
nodethe node to copy.
Returns
A reference toward this node.

Definition at line 89 of file NodeTemplate.h.

References bpp::NodeTemplate< NodeInfos >::infos_, and bpp::Node::operator=().

◆ operator==()

virtual bool bpp::Node::operator== ( const Node node) const
inlinevirtualinherited

Definition at line 663 of file Node.h.

References bpp::Node::id_.

◆ operator[]() [1/2]

template<class NodeInfos >
NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::operator[] ( int  i)
inline

Definition at line 134 of file NodeTemplate.h.

References bpp::Node::father_, and bpp::Node::sons_.

◆ operator[]() [2/2]

template<class NodeInfos >
const NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::operator[] ( int  i) const
inline

Definition at line 136 of file NodeTemplate.h.

References bpp::Node::father_, and bpp::Node::sons_.

◆ removeBranchProperties()

virtual void bpp::Node::removeBranchProperties ( )
inlinevirtualinherited

Remove all branch properties.

Attached objects will not be deleted.

Definition at line 636 of file Node.h.

References bpp::Node::branchProperties_.

◆ removeBranchProperty()

virtual Clonable* bpp::Node::removeBranchProperty ( const std::string &  name)
inlinevirtualinherited

Definition at line 608 of file Node.h.

References bpp::Node::branchProperties_, and bpp::Node::hasBranchProperty().

◆ removeFather()

template<class NodeInfos >
NodeTemplate<NodeInfos>* bpp::NodeTemplate< NodeInfos >::removeFather ( )
inlinevirtual

Remove the father of this node.

Reimplemented from bpp::Node.

Definition at line 106 of file NodeTemplate.h.

References bpp::Node::father_.

◆ removeNodeProperties()

virtual void bpp::Node::removeNodeProperties ( )
inlinevirtualinherited

Remove all node properties.

Attached objects will not be deleted.

Definition at line 546 of file Node.h.

References bpp::Node::nodeProperties_.

◆ removeNodeProperty()

virtual Clonable* bpp::Node::removeNodeProperty ( const std::string &  name)
inlinevirtualinherited

Definition at line 518 of file Node.h.

References bpp::Node::hasNodeProperty(), and bpp::Node::nodeProperties_.

◆ removeSon() [1/2]

virtual void bpp::Node::removeSon ( Node node)
inlinevirtualinherited

Definition at line 421 of file Node.h.

References bpp::Node::getId(), bpp::Node::removeFather(), and bpp::Node::sons_.

◆ removeSon() [2/2]

◆ removeSons()

virtual void bpp::Node::removeSons ( )
inlinevirtualinherited

Definition at line 437 of file Node.h.

References bpp::Node::removeSon(), and bpp::Node::sons_.

◆ setBranchProperty()

virtual void bpp::Node::setBranchProperty ( const std::string &  name,
const Clonable property 
)
inlinevirtualinherited

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 removeBranchProperty function before.

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

Definition at line 585 of file Node.h.

References bpp::Node::branchProperties_, and bpp::Node::hasBranchProperty().

Referenced by bpp::Node::addSubTree(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplateTools::parenthesisToNode(), and bpp::Nhx::setNodeProperties().

◆ setDistanceToFather()

virtual void bpp::Node::setDistanceToFather ( double  distance)
inlinevirtualinherited

◆ setFather()

virtual void bpp::Node::setFather ( Node node)
inlinevirtualinherited

Set the father node of this node.

Parameters
nodeThe father node.

Definition at line 322 of file Node.h.

References bpp::Node::father_, and bpp::Node::sons_.

◆ setId()

virtual void bpp::Node::setId ( int  id)
inlinevirtualinherited

◆ setInfos()

template<class NodeInfos >
virtual void bpp::NodeTemplate< NodeInfos >::setInfos ( const NodeInfos &  infos)
inlinevirtual

Set the information to be associated to this node.

Parameters
infosAn information object.

Definition at line 156 of file NodeTemplate.h.

References bpp::NodeTemplate< NodeInfos >::infos_.

Referenced by bpp::HierarchicalClustering::getLeafNode(), and bpp::PGMA::getLeafNode().

◆ setName()

virtual void bpp::Node::setName ( const std::string &  name)
inlinevirtualinherited

Give a name or update the name associated to the node.

Parameters
nameThe name to give to the node.

Definition at line 214 of file Node.h.

References bpp::Node::name_.

Referenced by bpp::Node::addSubTree(), bpp::Nhx::parenthesisToNode(), and bpp::TreeTemplateTools::parenthesisToNode().

◆ setNodeProperty()

virtual void bpp::Node::setNodeProperty ( const std::string &  name,
const Clonable property 
)
inlinevirtualinherited

Set/add a node 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 removeNodeProperty function before.

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

Definition at line 495 of file Node.h.

References bpp::Node::hasNodeProperty(), and bpp::Node::nodeProperties_.

Referenced by bpp::Node::addSubTree(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), and bpp::Nhx::setNodeProperties().

◆ setSon()

virtual void bpp::Node::setSon ( size_t  pos,
Node node 
)
inlinevirtualinherited

Definition at line 397 of file Node.h.

References bpp::Node::father_, and bpp::Node::sons_.

◆ swap()

void Node::swap ( size_t  branch1,
size_t  branch2 
)
virtualinherited

Friends And Related Function Documentation

◆ TreeTemplateTools

template<class NodeInfos >
friend class TreeTemplateTools
friend

Definition at line 40 of file NodeTemplate.h.

Member Data Documentation

◆ branchProperties_

◆ distanceToFather_

◆ father_

◆ id_

int bpp::Node::id_
protectedinherited

◆ infos_

template<class NodeInfos >
NodeInfos bpp::NodeTemplate< NodeInfos >::infos_
private

◆ name_

std::string* bpp::Node::name_
protectedinherited

◆ nodeProperties_

◆ sons_


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