bpp-phyl  2.3.0
bpp::Node Class Reference

The phylogenetic node class. More...

#include <Bpp/Phyl/Node.h>

+ Inheritance diagram for bpp::Node:
+ Collaboration diagram for bpp::Node:

Public Member Functions

 Node ()
 Build a new void Node object. More...
 
 Node (int id)
 Build a new Node with specified id. More...
 
 Node (const std::string &name)
 Build a new Node with specified name. More...
 
 Node (int id, const std::string &name)
 Build a new Node with specified id and name. More...
 
 Node (const Node &node)
 Copy constructor. More...
 
Nodeoperator= (const Node &node)
 Assignation operator. More...
 
Nodeclone () const
 
virtual ~Node ()
 
std::vector< const Node * > getNeighbors () const
 
std::vector< Node * > getNeighbors ()
 
virtual size_t degree () const
 
virtual bool operator== (const Node &node) const
 
virtual bool isLeaf () 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 throw (NodePException)
 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 const NodegetFather () const
 Get the father of this node is there is one. More...
 
virtual NodegetFather ()
 Get the father of this node is there is one. More...
 
virtual int getFatherId () const
 
virtual void setFather (Node *node) throw (NullPointerException)
 Set the father node of this node. More...
 
virtual NoderemoveFather ()
 Remove the father 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 const NodegetSon (size_t pos) const throw (IndexOutOfBoundsException)
 
virtual NodegetSon (size_t pos) throw (IndexOutOfBoundsException)
 
virtual void addSon (size_t pos, Node *node) throw (NullPointerException, NodePException)
 
virtual void addSon (Node *node) throw (NullPointerException, NodePException)
 
virtual void setSon (size_t pos, Node *node) throw (IndexOutOfBoundsException, NullPointerException, NodePException)
 
virtual NoderemoveSon (size_t pos) throw (IndexOutOfBoundsException)
 
virtual void removeSon (Node *node) throw (NodeNotFoundException, NullPointerException)
 
virtual void removeSons ()
 
virtual void swap (size_t branch1, size_t branch2) throw (IndexOutOfBoundsException)
 
virtual size_t getSonPosition (const Node *son) const throw (NodeNotFoundException, NullPointerException)
 
Operators:
  • a positive value send the corresponding son;
  • a negative value send the father.
Nodeoperator[] (int i)
 
const Nodeoperator[] (int i) 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) throw (PropertyNotFoundException)
 
virtual const ClonablegetNodeProperty (const std::string &name) const throw (PropertyNotFoundException)
 
virtual ClonableremoveNodeProperty (const std::string &name) throw (PropertyNotFoundException)
 
virtual void deleteNodeProperty (const std::string &name) throw (PropertyNotFoundException)
 
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) throw (PropertyNotFoundException)
 
virtual const ClonablegetBranchProperty (const std::string &name) const throw (PropertyNotFoundException)
 
virtual ClonableremoveBranchProperty (const std::string &name) throw (PropertyNotFoundException)
 
virtual void deleteBranchProperty (const std::string &name) throw (PropertyNotFoundException)
 
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 throw (PropertyNotFoundException)
 

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_
 

Detailed Description

The phylogenetic node class.

This class is for use with the TreeTemplate class, an implementation of the Tree interface. TreeTemplates are made made of nodes, instances of this class. Since trees are oriented (rooted), each node has one father node and possibly many son nodes. Leaves are nodes without descendant and root is defined has the without father. Inner nodes will generally contain two descendants (the tree is then called bifurcating), but mutlifurcating trees are also allowed with this kind of description. In the rooted case, each inner node also defines a subtree. This allows to work recursively on trees, which is very convenient in most cases.

This class is made the more general as possible, while keeping it very simple. It contains:

  • An identity tag, to identity it in the tree;
  • A name, necessary for leaf nodes, optionnal else;
  • A pointer toward the father node;
  • A std::vector of pointer toward son nodes;
  • The distance from the father node:
  • A property map, that may contain any information to link to each node, e.g. bootstrap value or GC content.

Methods are provided to help the building of trees from scratch. Trees are more easily built from root to leaves: The addSon(Node) method adds a node to the list of direct descendants of a given node. The son node will also have its father set to the current node. It is also possible to build a tree starting from the leaves using the setFather method. Changing the parent node will automatically append the current node to the son nodes of the new father.

See also
Tree, TreeTemplate

Definition at line 90 of file Node.h.

Constructor & Destructor Documentation

bpp::Node::Node ( )
inline

Build a new void Node object.

Definition at line 106 of file Node.h.

Referenced by clone(), and Node().

bpp::Node::Node ( int  id)
inline

Build a new Node with specified id.

Definition at line 119 of file Node.h.

bpp::Node::Node ( const std::string &  name)
inline

Build a new Node with specified name.

Definition at line 132 of file Node.h.

bpp::Node::Node ( int  id,
const std::string &  name 
)
inline

Build a new Node with specified id and name.

Definition at line 145 of file Node.h.

References Node(), and operator=().

Node::Node ( const Node node)

Copy constructor.

Warning
This constructor copies all fields, excepted father and son node pointers.
Parameters
nodeThe node to copy.

Copy constructor:

Definition at line 56 of file Node.cpp.

References branchProperties_, distanceToFather_, hasDistanceToFather(), hasName(), name_, and nodeProperties_.

virtual bpp::Node::~Node ( )
inlinevirtual

Definition at line 177 of file Node.h.

References distanceToFather_, and name_.

Member Function Documentation

virtual void bpp::Node::addSon ( Node node)
throw (NullPointerException,
NodePException
)
inlinevirtual

Definition at line 419 of file Node.h.

References father_.

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

Definition at line 174 of file Node.h.

References Node().

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

Delete all branch properties.

Definition at line 669 of file Node.h.

virtual void bpp::Node::deleteBranchProperty ( const std::string &  name)
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 645 of file Node.h.

References hasBranchProperty().

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

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

Delete the distance to the father node.

Definition at line 309 of file Node.h.

References distanceToFather_.

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

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

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

Definition at line 256 of file Node.h.

References name_.

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

Delete all node properties.

Definition at line 579 of file Node.h.

virtual void bpp::Node::deleteNodeProperty ( const std::string &  name)
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 555 of file Node.h.

References hasNodeProperty().

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

double Node::getBootstrapValue ( ) const
throw (PropertyNotFoundException
)
virtual

Definition at line 146 of file Node.cpp.

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

Referenced by getBranchPropertyNames().

virtual const Clonable* bpp::Node::getBranchProperty ( const std::string &  name) const
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 625 of file Node.h.

References hasBranchProperty().

virtual std::vector<std::string> bpp::Node::getBranchPropertyNames ( ) const
inlinevirtual
virtual double bpp::Node::getDistanceToFather ( ) const
inlinevirtual

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 283 of file Node.h.

References distanceToFather_, and hasDistanceToFather().

Referenced by bpp::BranchLengthsTreeDrawingListener::afterDrawBranch(), bpp::PhyloStatistics::computeForSubtree_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::AbstractNonHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::NonHomogeneousSequenceSimulator::evolve(), bpp::PhylogramDrawBranchEvent::getBranchCursor(), bpp::TreeTemplateTools::getHeight(), bpp::TreeTemplateTools::getHeights(), bpp::HierarchicalClustering::getParentNode(), bpp::PGMA::getParentNode(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::NonHomogeneousSequenceSimulator::init(), bpp::TreeTemplateTools::midRoot(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::PhylogramPlot::recursivePlot_(), bpp::Nhx::treeToParenthesis(), bpp::TreeTemplateTools::treeToParenthesis(), and bpp::TreeTemplateTools::unresolveUncertainNodes().

virtual const Node* bpp::Node::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 in bpp::NodeTemplate< NodeInfos >.

Definition at line 339 of file Node.h.

References father_.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::DRTreeParsimonyScore::computeScoresPostorderForNode(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::RHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeD2Likelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::RHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRTreeParsimonyScore::doNNI(), bpp::NNIHomogeneousTreeLikelihood::doNNI(), bpp::TreeTemplateTools::getAncestorsId(), bpp::TreeTemplateTools::getPathBetweenAnyTwoNodes(), bpp::TreeTemplateTools::midRoot(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::NNITopologySearch::searchBetter(), bpp::NNITopologySearch::searchFast(), bpp::NNITopologySearch::searchPhyML(), bpp::DRTreeParsimonyScore::testNNI(), and bpp::NNIHomogeneousTreeLikelihood::testNNI().

virtual Node* bpp::Node::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 in bpp::NodeTemplate< NodeInfos >.

Definition at line 346 of file Node.h.

References father_.

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

Definition at line 348 of file Node.h.

References getId().

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

Get the node's id.

Returns
The identity tag of this node.

Definition at line 203 of file Node.h.

References id_.

Referenced by bpp::AbstractNonHomogeneousTreeLikelihood::AbstractNonHomogeneousTreeLikelihood(), bpp::BipartitionList::buildBitBipartitions(), bpp::RHomogeneousClockTreeLikelihood::computeBranchLengthsFromHeights(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresForNode(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPostorderForNode(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::DRTreeParsimonyScore::computeScoresPreorderForNode(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::RHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeSubtreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::AbstractNonHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::RHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeTreeD2Likelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::RHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::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::TreeTemplateTools::getAncestorsId(), bpp::TreeTemplateTools::getBranchProperties(), getFatherId(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::AbstractTreeDrawing::getNodeAt(), bpp::AbstractTreeDrawing::getNodePosition(), bpp::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodesId(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), 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::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::DRTreeParsimonyData::reInit(), bpp::DRASDRTreeLikelihoodData::reInit(), removeSon(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::NNITopologySearch::searchBetter(), bpp::NNITopologySearch::searchFast(), bpp::TreeTemplateTools::searchFirstNodeWithId(), bpp::NNITopologySearch::searchPhyML(), bpp::AbstractHomogeneousTreeLikelihood::setSubstitutionModel(), bpp::AbstractNonHomogeneousTreeLikelihood::setSubstitutionModelSet(), bpp::DRTreeParsimonyScore::testNNI(), and bpp::NNIHomogeneousTreeLikelihood::testNNI().

vector< Node * > Node::getNeighbors ( )

Definition at line 122 of file Node.cpp.

References father_, hasFather(), and sons_.

virtual Clonable* bpp::Node::getNodeProperty ( const std::string &  name)
throw (PropertyNotFoundException
)
inlinevirtual
virtual const Clonable* bpp::Node::getNodeProperty ( const std::string &  name) const
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 535 of file Node.h.

References hasNodeProperty().

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

Definition at line 590 of file Node.h.

References bpp::MapTools::getKeys().

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

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

Definition at line 388 of file Node.h.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), bpp::TreeTemplateTools::cloneSubtree(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::PhyloStatistics::computeForSubtree_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::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(), degree(), bpp::TreeTemplateTools::deleteBranchLengths(), bpp::NonHomogeneousSequenceSimulator::dEvolve(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), bpp::TreeTemplateTools::getBranchesId(), 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::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodePropertyNames(), bpp::TreeTemplateTools::getNodesId(), bpp::TreeTemplateTools::getNumberOfLeaves(), bpp::TreeTemplateTools::getNumberOfNodes(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::haveSameOrderedTopology(), bpp::TreeTemplateTools::incrementAllIds(), bpp::TreeTemplateTools::isMultifurcating(), bpp::NonHomogeneousSequenceSimulator::multipleEvolve(), bpp::NonHomogeneousSequenceSimulator::multipleEvolveInternal(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::PhylogramPlot::recursivePlot_(), bpp::CladogramPlot::recursivePlot_(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::TreeTemplateTools::searchFirstNodeWithId(), bpp::TreeTemplateTools::setBranchLengths(), bpp::TreeTemplateTools::setVoidBranchLengths(), bpp::NonHomogeneousSequenceSimulator::simulateSite(), bpp::Nhx::treeToParenthesis(), bpp::TreeTemplateTools::treeToParenthesis(), and bpp::TreeTemplateTools::unresolveUncertainNodes().

virtual const Node* bpp::Node::getSon ( size_t  pos) const
throw (IndexOutOfBoundsException
)
inlinevirtual

Reimplemented in bpp::NodeTemplate< NodeInfos >.

Definition at line 395 of file Node.h.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), bpp::RHomogeneousClockTreeLikelihood::computeBranchLengthsFromHeights(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeDownSubtreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RHomogeneousTreeLikelihood::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::TreeTemplateTools::deleteBranchLengths(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRTreeParsimonyScore::doNNI(), bpp::NNIHomogeneousTreeLikelihood::doNNI(), bpp::TreeTemplateTools::getBranchesId(), bpp::TreeTemplateTools::getBranchProperties(), bpp::TreeTemplateTools::getBranchPropertyNames(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::TreeTemplateTools::getLeavesNames(), bpp::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodePropertyNames(), bpp::TreeTemplateTools::getNodesId(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::haveSameOrderedTopology(), bpp::TreeTemplateTools::incrementAllIds(), bpp::TreeTemplateTools::isMultifurcating(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::TreeTemplateTools::searchFirstNodeWithId(), bpp::TreeTemplateTools::setBranchLengths(), bpp::TreeTemplateTools::setVoidBranchLengths(), swap(), bpp::DRTreeParsimonyScore::testNNI(), bpp::NNIHomogeneousTreeLikelihood::testNNI(), bpp::Nhx::treeToParenthesis(), bpp::TreeTemplateTools::treeToParenthesis(), and bpp::TreeTemplateTools::unresolveUncertainNodes().

virtual Node* bpp::Node::getSon ( size_t  pos)
throw (IndexOutOfBoundsException
)
inlinevirtual

Reimplemented in bpp::NodeTemplate< NodeInfos >.

Definition at line 401 of file Node.h.

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

Definition at line 390 of file Node.h.

References sons_.

Referenced by bpp::TreeTemplateTools::getBestRootInSubtree_(), and bpp::TreeTemplateTools::midRoot().

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

Definition at line 212 of file Node.h.

bool Node::hasBootstrapValue ( ) const
virtual

Definition at line 141 of file Node.cpp.

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

Referenced by getBranchPropertyNames().

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

Tell if this node has a father node.

Definition at line 379 of file Node.h.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::RewardMappingTools::computeRewardVectors(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::SubstitutionMappingTools::computeSubstitutionVectors(), bpp::SubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), degree(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRTreeParsimonyScore::doNNI(), bpp::NNIHomogeneousTreeLikelihood::doNNI(), bpp::AbstractTreeDrawing::drawAtBranch(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), bpp::TreeTemplateTools::getAncestorsId(), getNeighbors(), bpp::TreeTemplateTools::getPathBetweenAnyTwoNodes(), bpp::TreeTemplateTools::isRoot(), bpp::NonHomogeneousSequenceSimulator::multipleEvolveInternal(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRTreeParsimonyScore::testNNI(), and bpp::NNIHomogeneousTreeLikelihood::testNNI().

virtual bool bpp::Node::hasName ( ) const
inlinevirtual
virtual bool bpp::Node::hasNodeProperty ( const std::string &  name) const
inlinevirtual
virtual bool bpp::Node::isLeaf ( ) const
inlinevirtual

Definition at line 692 of file Node.h.

References degree().

Referenced by bpp::LeafNamesTreeDrawingListener::afterDrawNode(), bpp::RHomogeneousClockTreeLikelihood::computeBranchLengthsFromHeights(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), bpp::PhyloStatistics::computeForSubtree_(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode_(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRTreeParsimonyScore::computeScoresPostorder(), bpp::DRTreeParsimonyScore::computeScoresPreorder(), bpp::RHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeSubtreeLikelihood(), bpp::RNonHomogeneousMixedTreeLikelihood::computeSubtreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPostfix(), bpp::DRHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::DRNonHomogeneousTreeLikelihood::computeSubtreeLikelihoodPrefix(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::TreeTemplateTools::getLeavesNames(), bpp::TreeTemplateTools::getNumberOfLeaves(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::haveSameOrderedTopology(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::PhylogramPlot::recursivePlot_(), bpp::CladogramPlot::recursivePlot_(), bpp::Nhx::treeToParenthesis(), and bpp::TreeTemplateTools::treeToParenthesis().

Node & Node::operator= ( const Node node)

Assignation operator.

Warning
This operator copies all fields, excepted father and son node pointers.
Parameters
nodethe node to copy.
Returns
A reference toward this node.

Assignation operator:

Definition at line 72 of file Node.cpp.

References branchProperties_, distanceToFather_, hasDistanceToFather(), hasName(), id_, name_, and nodeProperties_.

Referenced by Node(), and bpp::NodeTemplate< NodeInfos >::operator=().

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

Definition at line 688 of file Node.h.

References id_.

Node* bpp::Node::operator[] ( int  i)
inline

Definition at line 498 of file Node.h.

const Node* bpp::Node::operator[] ( int  i) const
inline

Definition at line 500 of file Node.h.

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

Remove all branch properties.

Attached objects will not be deleted.

Definition at line 661 of file Node.h.

virtual Clonable* bpp::Node::removeBranchProperty ( const std::string &  name)
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 633 of file Node.h.

References hasBranchProperty().

virtual Node* bpp::Node::removeFather ( )
inlinevirtual

Remove the father of this node.

Reimplemented in bpp::NodeTemplate< NodeInfos >.

Definition at line 369 of file Node.h.

References father_.

Referenced by removeSon().

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

Remove all node properties.

Attached objects will not be deleted.

Definition at line 571 of file Node.h.

virtual Clonable* bpp::Node::removeNodeProperty ( const std::string &  name)
throw (PropertyNotFoundException
)
inlinevirtual

Definition at line 543 of file Node.h.

References hasNodeProperty().

virtual void bpp::Node::removeSon ( Node node)
throw (NodeNotFoundException,
NullPointerException
)
inlinevirtual

Definition at line 454 of file Node.h.

References getId(), and removeFather().

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

Definition at line 470 of file Node.h.

References getNeighbors(), getSonPosition(), removeSon(), and swap().

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

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 610 of file Node.h.

References hasBranchProperty().

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

virtual void bpp::Node::setDistanceToFather ( double  distance)
inlinevirtual
virtual void bpp::Node::setFather ( Node node)
throw (NullPointerException
)
inlinevirtual

Set the father node of this node.

Parameters
nodeThe father node.

Definition at line 355 of file Node.h.

References sons_.

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

Set this node's id.

Parameters
idThe new identity tag.

Definition at line 210 of file Node.h.

Referenced by bpp::TreeTemplateTools::incrementAllIds(), bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplateTools::parenthesisToNode(), and bpp::Nhx::setNodeProperties().

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

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

Parameters
nameThe name to give to the node.

Definition at line 247 of file Node.h.

References name_.

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

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

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 520 of file Node.h.

References hasNodeProperty().

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

virtual void bpp::Node::setSon ( size_t  pos,
Node node 
)
throw (IndexOutOfBoundsException,
NullPointerException,
NodePException
)
inlinevirtual

Definition at line 430 of file Node.h.

References father_.

void Node::swap ( size_t  branch1,
size_t  branch2 
)
throw (IndexOutOfBoundsException
)
virtual

Sons:

Definition at line 98 of file Node.cpp.

References addSon(), getSon(), and removeSon().

Referenced by bpp::TreeTemplateTools::orderTree_(), and removeSons().

Member Data Documentation

std::map<std::string, Clonable*> bpp::Node::branchProperties_
mutableprotected

Definition at line 100 of file Node.h.

Referenced by Node(), and operator=().

double* bpp::Node::distanceToFather_
protected
int bpp::Node::id_
protected

Definition at line 94 of file Node.h.

Referenced by getId(), operator=(), and operator==().

std::string* bpp::Node::name_
protected

Definition at line 95 of file Node.h.

Referenced by deleteName(), getName(), Node(), operator=(), setName(), and ~Node().

std::map<std::string, Clonable*> bpp::Node::nodeProperties_
mutableprotected

Definition at line 99 of file Node.h.

Referenced by Node(), and operator=().

std::vector<Node*> bpp::Node::sons_
protected

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