bpp-phyl  2.4.0
bpp::NodeTemplate< NodeInfos > Class Template Reference

The NodeTemplate class. More...

#include <Bpp/Phyl/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...
 
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
 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 73 of file NodeTemplate.h.

Constructor & Destructor Documentation

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

Build a new void NodeTemplate object.

Definition at line 87 of file NodeTemplate.h.

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

Build a new NodeTemplate with specified id.

Definition at line 92 of file NodeTemplate.h.

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

Build a new NodeTemplate with specified name.

Definition at line 97 of file NodeTemplate.h.

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 102 of file NodeTemplate.h.

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

Copy constructor.

Parameters
nodeThe node to copy.

Definition at line 110 of file NodeTemplate.h.

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

Copy constructor.

Parameters
nodeThe node to copy.

Definition at line 117 of file NodeTemplate.h.

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

Definition at line 137 of file NodeTemplate.h.

Member Function Documentation

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

Definition at line 419 of file Node.h.

References bpp::Node::father_.

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

Definition at line 134 of file NodeTemplate.h.

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

Delete all branch properties.

Definition at line 669 of file Node.h.

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

Definition at line 645 of file Node.h.

References bpp::Node::hasBranchProperty().

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

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

Delete the distance to the father node.

Definition at line 309 of file Node.h.

References bpp::Node::distanceToFather_.

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

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

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

Definition at line 256 of file Node.h.

References bpp::Node::name_.

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

Delete all node properties.

Definition at line 579 of file Node.h.

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

Definition at line 555 of file Node.h.

References bpp::Node::hasNodeProperty().

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

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

Definition at line 625 of file Node.h.

References bpp::Node::hasBranchProperty().

virtual std::vector<std::string> bpp::Node::getBranchPropertyNames ( ) const
inlinevirtualinherited
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 283 of file Node.h.

References bpp::Node::distanceToFather_, and bpp::Node::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::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::RewardMappingTools::writeToStream(), and bpp::SubstitutionMappingTools::writeToStream().

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 141 of file NodeTemplate.h.

References bpp::Node::father_.

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

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 143 of file NodeTemplate.h.

References bpp::Node::father_.

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

Definition at line 348 of file Node.h.

References bpp::Node::getId().

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

Get the node's id.

Returns
The identity tag of this node.

Definition at line 203 of file Node.h.

References bpp::Node::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(), bpp::Node::getFatherId(), bpp::TreeTemplateTools::getInnerNodesId(), bpp::TreeTemplateTools::getLeavesId(), bpp::AbstractTreeDrawing::getNodeAt(), bpp::AbstractTreeDrawing::getNodePosition(), bpp::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodesId(), bpp::DRNonHomogeneousTreeLikelihood::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::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::DRTreeParsimonyData::reInit(), bpp::DRASDRTreeLikelihoodData::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::DRTreeParsimonyScore::testNNI(), bpp::NNIHomogeneousTreeLikelihood::testNNI(), bpp::RewardMappingTools::writeToStream(), and bpp::SubstitutionMappingTools::writeToStream().

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

Definition at line 184 of file NodeTemplate.h.

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

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

Definition at line 151 of file NodeTemplate.h.

References bpp::Node::getNeighbors().

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

Definition at line 160 of file NodeTemplate.h.

References bpp::Node::getNeighbors().

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

Definition at line 535 of file Node.h.

References bpp::Node::hasNodeProperty().

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

Definition at line 590 of file Node.h.

References bpp::MapTools::getKeys().

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

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

Definition at line 388 of file Node.h.

Referenced by bpp::BipartitionList::buildBitBipartitions(), bpp::Nhx::changeNamesToTags(), bpp::Nhx::changeTagsToNames(), bpp::TreeTemplateTools::cloneSubtree(), bpp::RHomogeneousClockTreeLikelihood::computeBranchLengthsFromHeights(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::computeBranchLengthsFromHeights_(), 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::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RHomogeneousTreeLikelihood::computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::RHomogeneousTreeLikelihood::computeTreeDLikelihood(), bpp::Node::degree(), bpp::TreeTemplateTools::deleteBranchLengths(), bpp::NonHomogeneousSequenceSimulator::dEvolve(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::NonHomogeneousSequenceSimulator::evolveInternal(), bpp::TreeTemplateTools::getBranchesId(), 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::TreeTemplateTools::getNodeProperties(), bpp::TreeTemplateTools::getNodePropertyNames(), bpp::TreeTemplateTools::getNodesId(), bpp::TreeTemplateTools::getNumberOfLeaves(), bpp::TreeTemplateTools::getNumberOfNodes(), bpp::DRNonHomogeneousTreeLikelihood::getSecondOrderDerivative(), bpp::TreeTemplateTools::getSubtreeMoments_(), bpp::TreeTemplateTools::getTotalLength(), 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::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::PhylogramPlot::recursivePlot_(), bpp::CladogramPlot::recursivePlot_(), bpp::DRTreeParsimonyData::reInit(), bpp::DRASDRTreeLikelihoodData::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().

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

Reimplemented from bpp::Node.

Definition at line 149 of file NodeTemplate.h.

References bpp::Node::sons_.

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

Definition at line 212 of file Node.h.

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

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(), bpp::Node::degree(), bpp::NonHomogeneousSequenceSimulator::dEvolveInternal(), bpp::DRHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::displayLikelihood(), bpp::DRTreeParsimonyScore::doNNI(), bpp::NNIHomogeneousTreeLikelihood::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::DRTreeParsimonyData::reInit(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::DRHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::DRNonHomogeneousTreeLikelihood::resetLikelihoodArrays(), bpp::TreeTemplateTools::scaleTree(), bpp::DRTreeParsimonyScore::testNNI(), and bpp::NNIHomogeneousTreeLikelihood::testNNI().

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

Definition at line 692 of file Node.h.

References bpp::Node::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::DRTreeParsimonyData::init(), bpp::DRASRTreeLikelihoodData::initLikelihoods(), bpp::DRASDRTreeLikelihoodData::initLikelihoods(), bpp::DRASRTreeLikelihoodData::initLikelihoodsWithPatterns(), bpp::Nhx::nodeToParenthesis(), bpp::TreeTemplateTools::nodeToParenthesis(), bpp::TreeTemplateTools::orderTree_(), bpp::TreeTemplateTools::processDistsInSubtree_(), bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates(), bpp::PhylogramPlot::recursivePlot_(), bpp::CladogramPlot::recursivePlot_(), bpp::DRTreeParsimonyData::reInit(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::TreeTemplateTools::searchLeaf(), bpp::Nhx::treeToParenthesis(), and bpp::TreeTemplateTools::treeToParenthesis().

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 127 of file NodeTemplate.h.

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

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

Definition at line 688 of file Node.h.

References bpp::Node::id_.

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

Definition at line 169 of file NodeTemplate.h.

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

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

Definition at line 171 of file NodeTemplate.h.

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

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

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)
inlinevirtualinherited

Definition at line 633 of file Node.h.

References bpp::Node::hasBranchProperty().

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

Remove the father of this node.

Reimplemented from bpp::Node.

Definition at line 145 of file NodeTemplate.h.

References bpp::Node::father_.

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

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)
inlinevirtualinherited

Definition at line 543 of file Node.h.

References bpp::Node::hasNodeProperty().

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

Definition at line 454 of file Node.h.

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

virtual void bpp::Node::removeSons ( )
inlinevirtualinherited
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 610 of file Node.h.

References bpp::Node::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)
inlinevirtualinherited
virtual void bpp::Node::setFather ( Node node)
inlinevirtualinherited

Set the father node of this node.

Parameters
nodeThe father node.

Definition at line 355 of file Node.h.

References bpp::Node::sons_.

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

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().

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 191 of file NodeTemplate.h.

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

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

References bpp::Node::name_.

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

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

References bpp::Node::hasNodeProperty().

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

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

Definition at line 430 of file Node.h.

References bpp::Node::father_.

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

Friends And Related Function Documentation

template<class NodeInfos>
friend class TreeTemplateTools
friend

Definition at line 76 of file NodeTemplate.h.

Member Data Documentation

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

Definition at line 100 of file Node.h.

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

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

Definition at line 94 of file Node.h.

Referenced by bpp::Node::getId(), bpp::Node::operator=(), and bpp::Node::operator==().

template<class NodeInfos>
NodeInfos bpp::NodeTemplate< NodeInfos >::infos_
private
std::string* bpp::Node::name_
protectedinherited
std::map<std::string, Clonable*> bpp::Node::nodeProperties_
mutableprotectedinherited

Definition at line 99 of file Node.h.

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


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