23 id_(node.id_), name_(0),
26 distanceToFather_(0), nodeProperties_(), branchProperties_()
78 auto vnames = phyloNode->getPropertyNames();
79 for (
const auto& name:vnames)
82 if (phyloNode->hasName())
86 vector<shared_ptr<PhyloNode>> sons = tree.
getSons(phyloNode);
87 for (
auto& son : sons)
94 if (phylobranch->hasLength())
97 auto vnames2 = phylobranch->getPropertyNames();
98 for (
const auto& name:vnames2)
113 if (branch1 > branch2)
115 size_t tmp = branch1;
129 vector<const Node*> neighbors;
132 for (
size_t i = 0; i <
sons_.size(); i++)
134 neighbors.push_back(
sons_[i]);
141 vector<Node*> neighbors;
144 for (
size_t i = 0; i <
sons_.size(); i++)
146 neighbors.push_back(
sons_[i]);
155 for (
size_t i = 0; i <
sons_.size(); i++)
virtual std::vector< std::shared_ptr< E > > getIncomingEdges(const std::shared_ptr< N > node) const=0
virtual NodeIndex getNodeIndex(const std::shared_ptr< N > nodeObject) const=0
std::vector< std::shared_ptr< N > > getSons(const std::shared_ptr< N > node) const
Exception thrown when something is wrong with a particular node.
The phylogenetic node class.
virtual void setDistanceToFather(double distance)
Set or update the distance toward the father node.
virtual Node * removeSon(size_t pos)
virtual int getId() const
Get the node's id.
virtual bool hasBranchProperty(const std::string &name) const
virtual void setId(int id)
Set this node's id.
std::map< std::string, Clonable * > branchProperties_
virtual void addSon(size_t pos, Node *node)
Node & operator=(const Node &node)
Assignation operator.
virtual bool hasBootstrapValue() const
virtual const Node * getSon(size_t pos) const
virtual void setBranchProperty(const std::string &name, const Clonable &property)
Set/add a branch property.
virtual bool hasDistanceToFather() const
Tell is this node has a distance to the father.
Node()
Build a new void Node object.
std::vector< Node * > sons_
virtual void setNodeProperty(const std::string &name, const Clonable &property)
Set/add a node property.
virtual size_t getSonPosition(const Node *son) const
void addSubTree(const PhyloTree &tree, std::shared_ptr< PhyloNode > phyloNode)
std::vector< const Node * > getNeighbors() const
virtual Clonable * getBranchProperty(const std::string &name)
virtual void swap(size_t branch1, size_t branch2)
virtual bool hasFather() const
Tell if this node has a father node.
virtual void setName(const std::string &name)
Give a name or update the name associated to the node.
double * distanceToFather_
virtual double getBootstrapValue() const
virtual bool hasName() const
Tell is this node has a name.
std::map< std::string, Clonable * > nodeProperties_
General exception thrown if a property could not be found.
std::string toString(T t)
Defines the basic types of data flow nodes.