bpp-core3
3.0.0
|
#include <Bpp/Graph/TreeGraphImpl.h>
Public Types | |
typedef unsigned int | NodeId |
typedef unsigned int | EdgeId |
Public Member Functions | |
TreeGraphImpl () | |
TreeGraphImpl (bool rooted=true) | |
bool | isValid () const |
bool | isRooted () const |
Graph::NodeId | getFatherOfNode (Graph::NodeId nodeid) const |
Graph::EdgeId | getEdgeToFather (Graph::NodeId node) const |
bool | hasFather (Graph::NodeId node) const |
bool | isLeaf (Graph::NodeId node) const |
std::vector< Graph::NodeId > | getLeavesUnderNode (Graph::NodeId node) const |
std::vector< Graph::NodeId > | getSons (Graph::NodeId node) const |
std::vector< Graph::EdgeId > | getBranches (Graph::NodeId node) const |
std::unique_ptr< Graph::NodeIterator > | sonsIterator (Graph::NodeId node) |
std::unique_ptr< Graph::NodeIterator > | sonsIterator (Graph::NodeId node) const |
std::unique_ptr< Graph::EdgeIterator > | branchesIterator (Graph::NodeId node) |
std::unique_ptr< Graph::EdgeIterator > | branchesIterator (Graph::NodeId node) const |
size_t | getNumberOfSons (Graph::NodeId node) const |
Get the number of sons node. More... | |
void | setFather (Graph::NodeId node, Graph::NodeId fatherNode) |
void | setFather (Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId) |
void | addSon (Graph::NodeId node, Graph::NodeId sonNode) |
void | addSon (Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId) |
std::vector< Graph::NodeId > | removeSons (Graph::NodeId node) |
void | removeSon (Graph::NodeId node, Graph::NodeId son) |
void | rootAt (Graph::NodeId newRoot) |
void | unRoot (bool joinRootSons) |
void | setOutGroup (Graph::NodeId newOutGroup) |
std::vector< Graph::NodeId > | getSubtreeNodes (Graph::NodeId localRoot) const |
std::vector< Graph::EdgeId > | getSubtreeEdges (Graph::NodeId localRoot) const |
std::vector< Graph::NodeId > | getNodePathBetweenTwoNodes (Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor=true) const |
std::vector< Graph::EdgeId > | getEdgePathBetweenTwoNodes (Graph::NodeId nodeA, Graph::NodeId nodeB) const |
Graph::NodeId | MRCA (const std::vector< Graph::NodeId > &nodes) const |
virtual NodeId | getRoot () const =0 |
virtual void | makeDirected ()=0 |
virtual void | makeUndirected ()=0 |
Observers Management | |
Managing communication with the observers: subscribe, unsubscribe. | |
virtual void | registerObserver (GraphObserver *observer)=0 |
virtual void | unregisterObserver (GraphObserver *observer)=0 |
Iterator interface on Nodes | |
virtual std::unique_ptr< NodeIterator > | allNodesIterator ()=0 |
virtual std::unique_ptr< NodeIterator > | allNodesIterator () const =0 |
virtual std::unique_ptr< NodeIterator > | outgoingNeighborNodesIterator (NodeId node)=0 |
virtual std::unique_ptr< NodeIterator > | incomingNeighborNodesIterator (NodeId node)=0 |
virtual size_t | getNumberOfNodes () const =0 |
virtual size_t | getNumberOfEdges () const =0 |
virtual size_t | getDegree (NodeId node) const =0 |
virtual size_t | getNumberOfNeighbors (NodeId node) const =0 |
virtual size_t | getNumberOfOutgoingNeighbors (NodeId node) const =0 |
virtual size_t | getNumberOfIncomingNeighbors (const NodeId node) const =0 |
virtual std::vector< NodeId > | getNeighbors (const NodeId node) const =0 |
virtual std::vector< NodeId > | getOutgoingNeighbors (const NodeId node) const =0 |
virtual std::vector< NodeId > | getIncomingNeighbors (NodeId node) const =0 |
virtual std::vector< NodeId > | getLeavesFromNode (NodeId node, unsigned int maxDepth) const =0 |
virtual std::vector< NodeId > | getAllLeaves () const =0 |
virtual std::set< NodeId > | getSetOfAllLeaves () const =0 |
virtual std::vector< NodeId > | getAllInnerNodes () const =0 |
virtual std::vector< NodeId > | getAllNodes () const =0 |
virtual std::pair< NodeId, NodeId > | getNodes (EdgeId edge) const =0 |
virtual NodeId | getTop (EdgeId edge) const =0 |
virtual NodeId | getBottom (EdgeId edge) const =0 |
virtual std::unique_ptr< EdgeIterator > | allEdgesIterator ()=0 |
virtual std::unique_ptr< EdgeIterator > | outgoingEdgesIterator (NodeId node)=0 |
virtual std::unique_ptr< EdgeIterator > | incomingEdgesIterator (NodeId node)=0 |
virtual std::vector< EdgeId > | getEdges (const NodeId node) const =0 |
virtual std::vector< EdgeId > | getOutgoingEdges (const NodeId node) const =0 |
virtual std::vector< EdgeId > | getIncomingEdges (NodeId node) const =0 |
virtual std::vector< EdgeId > | getAllEdges () const =0 |
virtual EdgeId | getEdge (NodeId nodeA, NodeId nodeB) const =0 |
virtual EdgeId | getAnyEdge (NodeId nodeA, NodeId nodeB) const =0 |
Topological Properties | |
These methodes check some topological properties. | |
virtual bool | isTree () const =0 |
virtual bool | isDA () const =0 |
virtual void | orientate ()=0 |
virtual bool | isDirected () const =0 |
virtual bool | containsReciprocalRelations () const =0 |
Protected Member Functions | |
virtual void | setRoot (NodeId newRoot)=0 |
Private Member Functions | |
void | topologyHasChanged_ () const |
void | mustBeValid_ () const |
void | mustBeRooted_ () const |
bool | validate_ () const |
void | propagateDirection_ (Graph::NodeId node) |
void | fillSubtreeMetNodes_ (std::vector< Graph::NodeId > &metNodes, Graph::NodeId localRoot) const |
void | fillSubtreeMetEdges_ (std::vector< Graph::EdgeId > &metEdges, Graph::NodeId localRoot) const |
void | fillListOfLeaves_ (Graph::NodeId startingNode, std::vector< Graph::NodeId > &foundLeaves) const |
Private Attributes | |
bool | isValid_ |
Relations management | |
virtual NodeId | createNode ()=0 |
virtual NodeId | createNodeFromNode (NodeId origin)=0 |
virtual NodeId | createNodeOnEdge (NodeId edge)=0 |
virtual NodeId | createNodeFromEdge (NodeId origin)=0 |
virtual void | deleteNode (NodeId node)=0 |
virtual EdgeId | link (NodeId nodeA, NodeId nodeB)=0 |
virtual void | link (Graph::NodeId nodeA, Graph::NodeId nodeB, Graph::EdgeId edgeID)=0 |
virtual std::vector< EdgeId > | unlink (NodeId nodeA, NodeId nodeB)=0 |
Updating the changes on the observers | |
virtual void | outputToDot (std::ostream &out, const std::string &name) const =0 |
virtual void | notifyDeletedEdges (const std::vector< EdgeId > &edgesToDelete) const =0 |
virtual void | notifyDeletedNodes (const std::vector< NodeId > &nodesToDelete) const =0 |
Definition at line 21 of file TreeGraphImpl.h.
|
inherited |
|
inherited |
bpp::TreeGraphImpl< GraphImpl >::TreeGraphImpl | ( | ) |
bpp::TreeGraphImpl< GraphImpl >::TreeGraphImpl | ( | bool | rooted = true | ) |
Definition at line 229 of file TreeGraphImpl.h.
|
virtual |
Add a son to a node in a rooted tree
Implements bpp::TreeGraph.
Definition at line 375 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_().
|
virtual |
Implements bpp::TreeGraph.
Definition at line 382 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
Referenced by bpp::DAGraphImpl< GraphImpl >::isRooted().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
|
virtual |
Get a iterator on the branches to sons of a node
Implements bpp::TreeGraph.
Definition at line 430 of file TreeGraphImpl.h.
|
virtual |
Implements bpp::TreeGraph.
Definition at line 436 of file TreeGraphImpl.h.
|
pure virtualinherited |
Does the graph contain reciprocal relations such as A->B and B->A?
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Creates an orphaned node.
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
Creates a node linked to new node.
origin | existing edge. In a directed graph: origin -> newNode. |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
Creates a node linked to an existing node.
origin | existing node. In a directed graph: origin -> newNode. |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
Creates new node on an existing Edge, splitting an edge0. A -> B will be A -> N -> B
edge | existing edge. |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
pure virtualinherited |
Delete one node
node | node to be deleted |
Implemented in bpp::GlobalGraph.
Referenced by bpp::TreeGraphImpl< GraphImpl >::setOutGroup(), and bpp::Graph::~Graph().
|
private |
Definition at line 273 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getSons().
Referenced by bpp::TreeGraphImpl< GraphImpl >::getLeavesUnderNode().
|
private |
Definition at line 568 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::getSubtreeEdges().
|
private |
Definition at line 557 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::getSubtreeNodes().
|
pure virtualinherited |
Get all edges of a graph.
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
Get all the inner nodes, ie, nodes with degree > 1.
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Get all leaves of a graph, ie, nodes with no son (or only one neighbor is not directet).
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Returns the Edge between two nodes, trying both directions
nodeA | any node implied in the relation |
nodeB | any other node implied in the relation |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
Get node located at the bottom of an edge
Implemented in bpp::GlobalGraph.
|
virtual |
Get the branches to the sons node of a node
Implements bpp::TreeGraph.
Definition at line 412 of file TreeGraphImpl.h.
|
pure virtualinherited |
Get the degree of a node (ie the number of neighbors) in the graph.
node | the node one wants to count its neighbors |
Implemented in bpp::GlobalGraph.
Returns the Edge between two nodes
nodeA | if directed, origin node |
nodeB | if directed, destination node |
Implemented in bpp::GlobalGraph.
Referenced by bpp::TreeGraphImpl< GraphImpl >::setOutGroup(), and bpp::Graph::EdgeIterator::~EdgeIterator().
|
virtual |
Implements bpp::TreeGraph.
Definition at line 526 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getNodePathBetweenTwoNodes().
Get all the edges to/from a node in the graph.
node | the node one wants to get its edges |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
virtual |
Get the branch leading to the father in a rooted tree
Implements bpp::TreeGraph.
Definition at line 253 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode().
|
virtual |
Get the father node of a node in a rooted tree
Implements bpp::TreeGraph.
Definition at line 242 of file TreeGraphImpl.h.
References bpp::Graph::getIncomingNeighbors(), bpp::VectorTools::paste(), and bpp::TextTools::toString().
Referenced by bpp::TreeGraphImpl< GraphImpl >::getEdgeToFather(), bpp::TreeGraphImpl< GraphImpl >::getNodePathBetweenTwoNodes(), bpp::TreeGraphImpl< GraphImpl >::MRCA(), bpp::TreeGraphImpl< GraphImpl >::propagateDirection_(), bpp::TreeGraphImpl< GraphImpl >::setFather(), and bpp::TreeGraphImpl< GraphImpl >::setOutGroup().
In an directed graph, get all the edges which are coming to a node in the graph.
node | the node one wants to get its edges |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
In an directed graph, get all the neighbors which are coming to a node in the graph.
node | the node one wants to get its neighbors |
Implemented in bpp::GlobalGraph.
Referenced by bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), and bpp::DAGraphImpl< GraphImpl >::getFathers().
|
pure virtualinherited |
Get the leaves of a graph, ie, nodes with only one neighbor, starting from a peculiar node.
node | the starting node |
maxDepth | the maximum number of allowed depth. |
Implemented in bpp::GlobalGraph.
|
virtual |
Get the leaves under a node
node | the starting node |
Implements bpp::TreeGraph.
Definition at line 290 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::fillListOfLeaves_().
|
pure virtualinherited |
Get all the neighbors of a node in the graph.
node | the node one wants to get its neighbors |
Implemented in bpp::GlobalGraph.
|
virtual |
Implements bpp::TreeGraph.
Definition at line 476 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), and bpp::TreeGraphImpl< GraphImpl >::hasFather().
Referenced by bpp::TreeGraphImpl< GraphImpl >::getEdgePathBetweenTwoNodes().
Get nodes located at the extremities of an edge
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Get the number of edges in the graph.
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Get the number of incoming neighbors of a node (ie the number of fathers) in the graph.
node | the node one wants to count its fathers |
Implemented in bpp::GlobalGraph.
Referenced by bpp::DAGraphImpl< GraphImpl >::removeFather().
|
pure virtualinherited |
Get the number of neighbors of a node in the graph.
node | the node one wants to count its sons |
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Get the number of nodes in the graph.
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Get the number of outgoing neighbors of a node (ie the number of sons) in the graph.
node | the node one wants to count its sons |
Implemented in bpp::GlobalGraph.
|
virtual |
Get the number of sons node.
Implements bpp::TreeGraph.
Definition at line 442 of file TreeGraphImpl.h.
|
pure virtualinherited |
In an directed graph, get all the edges which are leaving a node in the graph.
node | the node one wants to get its edges |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
In an directed graph, get all the neighbors which are leaving a node in the graph.
node | the node one wants to get its neighbors |
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
get the root node
Implemented in bpp::GlobalGraph.
Referenced by bpp::TreeGraphImpl< GraphImpl >::MRCA(), and bpp::Graph::~Graph().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
|
virtual |
Get the sons node of a node
Implements bpp::TreeGraph.
Definition at line 406 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::fillListOfLeaves_(), bpp::TreeGraphImpl< GraphImpl >::removeSons(), and bpp::TreeGraphImpl< GraphImpl >::unRoot().
|
virtual |
Get all the branches of a subtree
Implements bpp::TreeGraph.
Definition at line 547 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::fillSubtreeMetEdges_(), and bpp::TreeGraphImpl< GraphImpl >::mustBeValid_().
|
virtual |
Get all the nodes of a subtree
Implements bpp::TreeGraph.
Definition at line 538 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::fillSubtreeMetNodes_(), and bpp::TreeGraphImpl< GraphImpl >::mustBeValid_().
Get node located at the top of an edge
Implemented in bpp::GlobalGraph.
|
virtual |
Check if node has a father
Implements bpp::TreeGraph.
Definition at line 260 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::getNodePathBetweenTwoNodes(), bpp::TreeGraphImpl< GraphImpl >::MRCA(), bpp::TreeGraphImpl< GraphImpl >::propagateDirection_(), and bpp::TreeGraphImpl< GraphImpl >::setFather().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Is the graph directed acyclic?
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Is the graph directed?
Implemented in bpp::GlobalGraph.
|
virtual |
Says if a node is a leaf (ie has at most one neighbor).
Implements bpp::TreeGraph.
Definition at line 266 of file TreeGraphImpl.h.
bool bpp::TreeGraphImpl< GraphImpl >::isRooted | ( | ) | const |
Is the tree rooted?
Definition at line 313 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::mustBeRooted_().
|
pure virtualinherited |
Is the graph a tree?
Implemented in bpp::GlobalGraph.
|
virtual |
Is the graph a tree? A tree must be acyclic and with no isolated node.
Implements bpp::TreeGraph.
Definition at line 236 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isValid_, and bpp::TreeGraphImpl< GraphImpl >::validate_().
Referenced by bpp::TreeGraphImpl< GraphImpl >::mustBeValid_(), and bpp::TreeGraphImpl< GraphImpl >::rootAt().
Creates a link between two existing nodes. If directed graph: nodeA -> nodeB.
nodeA | source node (or first node if undirected) |
nodeB | target node (or second node if undirected) |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
protectedpure virtualinherited |
Sets a link between two existing nodes, using existing edge. If directed graph: nodeA -> nodeB.
nodeA | source node (or first node if undirected) |
nodeB | target node (or second node if undirected) |
edgeID | the used edge |
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Make the graph directed
Please note that the resulting directions are totaly arbritrary. One might consider to use the makeLocalRoot method.
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
pure virtualinherited |
Make the graph directed
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
virtual |
Implements bpp::TreeGraph.
Definition at line 579 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), bpp::Graph::getRoot(), bpp::TreeGraphImpl< GraphImpl >::hasFather(), and bpp::TreeGraphImpl< GraphImpl >::mustBeRooted_().
|
private |
Definition at line 299 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isRooted().
Referenced by bpp::TreeGraphImpl< GraphImpl >::MRCA(), and bpp::TreeGraphImpl< GraphImpl >::setOutGroup().
|
private |
Definition at line 306 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isValid().
Referenced by bpp::TreeGraphImpl< GraphImpl >::getSubtreeEdges(), and bpp::TreeGraphImpl< GraphImpl >::getSubtreeNodes().
|
protectedpure virtualinherited |
Trigger E objects deleting on the observers
edgesToDelete | list of edges to delete |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
protectedpure virtualinherited |
Trigger N objects deleting on the observers
nodesToDelete | list of edges to delete |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
Orientates the graph hanging from the root
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
pure virtualinherited |
Implemented in bpp::GlobalGraph.
|
pure virtualinherited |
Output the graph in DOT format
out | a ostream where the DOT format will be output |
name | a string naming the graph |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().
|
private |
Reorient all the edges starting from a node: the father node becomes a son, and so on.
Definition at line 345 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), and bpp::TreeGraphImpl< GraphImpl >::hasFather().
Referenced by bpp::TreeGraphImpl< GraphImpl >::rootAt().
|
pure virtualinherited |
Attach a new observer to this Graph. As a subscriber, the observer will be warned of all the changes.
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
virtual |
Remove one son
Implements bpp::TreeGraph.
Definition at line 459 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_().
Referenced by bpp::TreeGraphImpl< GraphImpl >::removeSons().
std::vector< Graph::NodeId > bpp::TreeGraphImpl< GraphImpl >::removeSons | ( | Graph::NodeId | node | ) |
Remove all the sons
Definition at line 448 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getSons(), and bpp::TreeGraphImpl< GraphImpl >::removeSon().
|
virtual |
Re-root the tree with the new root
Implements bpp::TreeGraph.
Definition at line 332 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isValid(), and bpp::TreeGraphImpl< GraphImpl >::propagateDirection_().
Referenced by bpp::TreeGraphImpl< GraphImpl >::setOutGroup().
|
virtual |
set the father node of a node in a rooted tree
Implements bpp::TreeGraph.
Definition at line 356 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), bpp::TreeGraphImpl< GraphImpl >::hasFather(), and bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_().
|
virtual |
Implements bpp::TreeGraph.
Definition at line 365 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), bpp::TreeGraphImpl< GraphImpl >::hasFather(), and bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_().
|
virtual |
Set a node as a new outgroup in a rooted tree, will make a root between the given node and its father.
Implements bpp::TreeGraph.
Definition at line 466 of file TreeGraphImpl.h.
References bpp::Graph::deleteNode(), bpp::Graph::getEdge(), bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), bpp::TreeGraphImpl< GraphImpl >::mustBeRooted_(), and bpp::TreeGraphImpl< GraphImpl >::rootAt().
|
protectedpure virtualinherited |
set the root node to an existing node. Will not affect the topology.
newRoot | the new root |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
virtual |
Get a iterator on the sons node of a node
Implements bpp::TreeGraph.
Definition at line 418 of file TreeGraphImpl.h.
|
virtual |
Implements bpp::TreeGraph.
Definition at line 424 of file TreeGraphImpl.h.
|
private |
Definition at line 326 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isValid_.
Referenced by bpp::TreeGraphImpl< GraphImpl >::addSon(), bpp::TreeGraphImpl< GraphImpl >::removeSon(), and bpp::TreeGraphImpl< GraphImpl >::setFather().
|
protectedpure virtualinherited |
Remove all links between two existing nodes. If directed graph: nodeA -> nodeB.
nodeA | source node (or first node if undirected) |
nodeB | target node (or second node if undirected) |
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
pure virtualinherited |
Detach an observer from this Graph. The observer will not be warned of changes anymore.
Implemented in bpp::GlobalGraph.
Referenced by bpp::Graph::~Graph().
|
virtual |
Set the tree to its flat unrooted version. As an algorithmical convenience, a root node is kept, but it has no logical significance.
Implements bpp::TreeGraph.
Definition at line 389 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::getSons().
|
private |
Definition at line 319 of file TreeGraphImpl.h.
References bpp::TreeGraphImpl< GraphImpl >::isValid_.
Referenced by bpp::TreeGraphImpl< GraphImpl >::isValid().
|
mutableprivate |
Is the graph a tree? Set to false when structure is modified, true after validation.
Definition at line 29 of file TreeGraphImpl.h.
Referenced by bpp::TreeGraphImpl< GraphImpl >::isValid(), bpp::TreeGraphImpl< GraphImpl >::topologyHasChanged_(), and bpp::TreeGraphImpl< GraphImpl >::validate_().