bpp-core3  3.0.0
bpp::TreeGraph Class Referenceabstract

#include <Bpp/Graph/TreeGraph.h>

+ Inheritance diagram for bpp::TreeGraph:
+ Collaboration diagram for bpp::TreeGraph:

Public Types

typedef unsigned int NodeId
 
typedef unsigned int EdgeId
 

Public Member Functions

virtual bool isValid () const =0
 
virtual Graph::NodeId getFatherOfNode (Graph::NodeId nodeid) const =0
 
virtual Graph::EdgeId getEdgeToFather (Graph::NodeId node) const =0
 
virtual bool hasFather (Graph::NodeId node) const =0
 
virtual bool isLeaf (Graph::NodeId node) const =0
 
virtual std::vector< Graph::NodeIdgetLeavesUnderNode (Graph::NodeId node) const =0
 
virtual std::vector< Graph::NodeIdgetSons (Graph::NodeId node) const =0
 
virtual std::vector< Graph::EdgeIdgetBranches (Graph::NodeId node) const =0
 
virtual std::unique_ptr< Graph::NodeIteratorsonsIterator (Graph::NodeId node)=0
 
virtual std::unique_ptr< Graph::NodeIteratorsonsIterator (Graph::NodeId node) const =0
 
virtual std::unique_ptr< Graph::EdgeIteratorbranchesIterator (Graph::NodeId node)=0
 
virtual std::unique_ptr< Graph::EdgeIteratorbranchesIterator (Graph::NodeId node) const =0
 
virtual size_t getNumberOfSons (Graph::NodeId node) const =0
 Get the number of sons node. More...
 
virtual void setFather (Graph::NodeId node, Graph::NodeId fatherNode)=0
 
virtual void setFather (Graph::NodeId node, Graph::NodeId fatherNode, Graph::EdgeId edgeId)=0
 
virtual void addSon (Graph::NodeId node, Graph::NodeId sonNode)=0
 
virtual void addSon (Graph::NodeId node, Graph::NodeId sonNode, Graph::EdgeId edgeId)=0
 
std::vector< Graph::NodeIdremoveSons (Graph::NodeId node)
 
virtual void removeSon (Graph::NodeId node, Graph::NodeId son)=0
 
virtual void rootAt (Graph::NodeId newRoot)=0
 
virtual void unRoot (bool joinRootSons)=0
 
virtual void setOutGroup (Graph::NodeId newOutGroup)=0
 
virtual std::vector< Graph::NodeIdgetSubtreeNodes (Graph::NodeId localRoot) const =0
 
virtual std::vector< Graph::EdgeIdgetSubtreeEdges (Graph::NodeId localRoot) const =0
 
virtual std::vector< Graph::NodeIdgetNodePathBetweenTwoNodes (Graph::NodeId nodeA, Graph::NodeId nodeB, bool includeAncestor=true) const =0
 
virtual std::vector< Graph::EdgeIdgetEdgePathBetweenTwoNodes (Graph::NodeId nodeA, Graph::NodeId nodeB) const =0
 
virtual Graph::NodeId MRCA (const std::vector< Graph::NodeId > &nodes) const =0
 
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< NodeIteratorallNodesIterator ()=0
 
virtual std::unique_ptr< NodeIteratorallNodesIterator () const =0
 
virtual std::unique_ptr< NodeIteratoroutgoingNeighborNodesIterator (NodeId node)=0
 
virtual std::unique_ptr< NodeIteratorincomingNeighborNodesIterator (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< NodeIdgetNeighbors (const NodeId node) const =0
 
virtual std::vector< NodeIdgetOutgoingNeighbors (const NodeId node) const =0
 
virtual std::vector< NodeIdgetIncomingNeighbors (NodeId node) const =0
 
virtual std::vector< NodeIdgetLeavesFromNode (NodeId node, unsigned int maxDepth) const =0
 
virtual std::vector< NodeIdgetAllLeaves () const =0
 
virtual std::set< NodeIdgetSetOfAllLeaves () const =0
 
virtual std::vector< NodeIdgetAllInnerNodes () const =0
 
virtual std::vector< NodeIdgetAllNodes () const =0
 
virtual std::pair< NodeId, NodeIdgetNodes (EdgeId edge) const =0
 
virtual NodeId getTop (EdgeId edge) const =0
 
virtual NodeId getBottom (EdgeId edge) const =0
 
virtual std::unique_ptr< EdgeIteratorallEdgesIterator ()=0
 
virtual std::unique_ptr< EdgeIteratoroutgoingEdgesIterator (NodeId node)=0
 
virtual std::unique_ptr< EdgeIteratorincomingEdgesIterator (NodeId node)=0
 
virtual std::vector< EdgeIdgetEdges (const NodeId node) const =0
 
virtual std::vector< EdgeIdgetOutgoingEdges (const NodeId node) const =0
 
virtual std::vector< EdgeIdgetIncomingEdges (NodeId node) const =0
 
virtual std::vector< EdgeIdgetAllEdges () 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
 

Relations management

Modificating the structure of the graph.

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< EdgeIdunlink (NodeId nodeA, NodeId nodeB)=0
 

Updating the changes on the observers

These methodes aim to trigger some changes to 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
 

Detailed Description

Definition at line 19 of file TreeGraph.h.

Member Typedef Documentation

◆ EdgeId

typedef unsigned int bpp::Graph::EdgeId
inherited

Definition at line 31 of file Graph.h.

◆ NodeId

typedef unsigned int bpp::Graph::NodeId
inherited

Definition at line 30 of file Graph.h.

Member Function Documentation

◆ addSon() [1/2]

virtual void bpp::TreeGraph::addSon ( Graph::NodeId  node,
Graph::NodeId  sonNode 
)
pure virtual

Add a son to a node in a rooted tree

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ addSon() [2/2]

virtual void bpp::TreeGraph::addSon ( Graph::NodeId  node,
Graph::NodeId  sonNode,
Graph::EdgeId  edgeId 
)
pure virtual

◆ allEdgesIterator()

virtual std::unique_ptr<EdgeIterator> bpp::Graph::allEdgesIterator ( )
pure virtualinherited

◆ allNodesIterator() [1/2]

virtual std::unique_ptr<NodeIterator> bpp::Graph::allNodesIterator ( )
pure virtualinherited

◆ allNodesIterator() [2/2]

virtual std::unique_ptr<NodeIterator> bpp::Graph::allNodesIterator ( ) const
pure virtualinherited

Implemented in bpp::GlobalGraph.

◆ branchesIterator() [1/2]

virtual std::unique_ptr<Graph::EdgeIterator> bpp::TreeGraph::branchesIterator ( Graph::NodeId  node)
pure virtual

Get a iterator on the branches to sons of a node

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ branchesIterator() [2/2]

virtual std::unique_ptr<Graph::EdgeIterator> bpp::TreeGraph::branchesIterator ( Graph::NodeId  node) const
pure virtual

◆ containsReciprocalRelations()

virtual bool bpp::Graph::containsReciprocalRelations ( ) const
pure virtualinherited

Does the graph contain reciprocal relations such as A->B and B->A?

Returns
true if one of them is seen in the structure

Implemented in bpp::GlobalGraph.

◆ createNode()

virtual NodeId bpp::Graph::createNode ( )
pure virtualinherited

Creates an orphaned node.

Returns
the index of the new node

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ createNodeFromEdge()

virtual NodeId bpp::Graph::createNodeFromEdge ( NodeId  origin)
pure virtualinherited

Creates a node linked to new node.

Parameters
originexisting edge. In a directed graph: origin -> newNode.
Returns
the index of the new node

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ createNodeFromNode()

virtual NodeId bpp::Graph::createNodeFromNode ( NodeId  origin)
pure virtualinherited

Creates a node linked to an existing node.

Parameters
originexisting node. In a directed graph: origin -> newNode.
Returns
the index of the new node

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ createNodeOnEdge()

virtual NodeId bpp::Graph::createNodeOnEdge ( NodeId  edge)
pure virtualinherited

Creates new node on an existing Edge, splitting an edge0. A -> B will be A -> N -> B

Parameters
edgeexisting edge.
Returns
the index of the new node

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ deleteNode()

virtual void bpp::Graph::deleteNode ( NodeId  node)
pure virtualinherited

Delete one node

Parameters
nodenode to be deleted

Implemented in bpp::GlobalGraph.

Referenced by bpp::TreeGraphImpl< GraphImpl >::setOutGroup(), and bpp::Graph::~Graph().

◆ getAllEdges()

virtual std::vector<EdgeId> bpp::Graph::getAllEdges ( ) const
pure virtualinherited

Get all edges of a graph.

Returns
a vector containing the edges

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getAllInnerNodes()

virtual std::vector<NodeId> bpp::Graph::getAllInnerNodes ( ) const
pure virtualinherited

Get all the inner nodes, ie, nodes with degree > 1.

Returns
a vector containing the nodes

Implemented in bpp::GlobalGraph.

◆ getAllLeaves()

virtual std::vector<NodeId> bpp::Graph::getAllLeaves ( ) const
pure virtualinherited

Get all leaves of a graph, ie, nodes with no son (or only one neighbor is not directet).

Returns
a vector containing the leaves

Implemented in bpp::GlobalGraph.

◆ getAllNodes()

virtual std::vector<NodeId> bpp::Graph::getAllNodes ( ) const
pure virtualinherited

Get all the nodes.

Returns
a vector containing the nodes

Implemented in bpp::GlobalGraph.

◆ getAnyEdge()

virtual EdgeId bpp::Graph::getAnyEdge ( NodeId  nodeA,
NodeId  nodeB 
) const
pure virtualinherited

Returns the Edge between two nodes, trying both directions

Parameters
nodeAany node implied in the relation
nodeBany other node implied in the relation
Returns
the edge between these two nodes

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getBottom()

virtual NodeId bpp::Graph::getBottom ( EdgeId  edge) const
pure virtualinherited

Get node located at the bottom of an edge

Returns
the Node at the bottom the edge example : N1–E1–>N2; getBottom(E1) will return N2;

Implemented in bpp::GlobalGraph.

◆ getBranches()

virtual std::vector<Graph::EdgeId> bpp::TreeGraph::getBranches ( Graph::NodeId  node) const
pure virtual

Get the branches to the sons of a node

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getDegree()

virtual size_t bpp::Graph::getDegree ( NodeId  node) const
pure virtualinherited

Get the degree of a node (ie the number of neighbors) in the graph.

Parameters
nodethe node one wants to count its neighbors
Returns
the number of neighbors

Implemented in bpp::GlobalGraph.

◆ getEdge()

virtual EdgeId bpp::Graph::getEdge ( NodeId  nodeA,
NodeId  nodeB 
) const
pure virtualinherited

Returns the Edge between two nodes

Parameters
nodeAif directed, origin node
nodeBif directed, destination node
Returns
the edge between these two nodes

Implemented in bpp::GlobalGraph.

Referenced by bpp::TreeGraphImpl< GraphImpl >::setOutGroup(), and bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getEdgePathBetweenTwoNodes()

virtual std::vector<Graph::EdgeId> bpp::TreeGraph::getEdgePathBetweenTwoNodes ( Graph::NodeId  nodeA,
Graph::NodeId  nodeB 
) const
pure virtual

◆ getEdges()

virtual std::vector<EdgeId> bpp::Graph::getEdges ( const NodeId  node) const
pure virtualinherited

Get all the edges to/from a node in the graph.

Parameters
nodethe node one wants to get its edges
Returns
a vector containing the ID of the edges

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getEdgeToFather()

virtual Graph::EdgeId bpp::TreeGraph::getEdgeToFather ( Graph::NodeId  node) const
pure virtual

Get the branch leading to the father in a rooted tree

Returns
the branch between a node and its father

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getFatherOfNode()

virtual Graph::NodeId bpp::TreeGraph::getFatherOfNode ( Graph::NodeId  nodeid) const
pure virtual

Get the father node of a node in a rooted tree

Returns
the father node

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getIncomingEdges()

virtual std::vector<EdgeId> bpp::Graph::getIncomingEdges ( NodeId  node) const
pure virtualinherited

In an directed graph, get all the edges which are coming to a node in the graph.

Parameters
nodethe node one wants to get its edges
Returns
a vector containing the incoming edges

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getIncomingNeighbors()

virtual std::vector<NodeId> bpp::Graph::getIncomingNeighbors ( NodeId  node) const
pure virtualinherited

In an directed graph, get all the neighbors which are coming to a node in the graph.

Parameters
nodethe node one wants to get its neighbors
Returns
a vector containing the incoming neighbors

Implemented in bpp::GlobalGraph.

Referenced by bpp::TreeGraphImpl< GraphImpl >::getFatherOfNode(), and bpp::DAGraphImpl< GraphImpl >::getFathers().

◆ getLeavesFromNode()

virtual std::vector<NodeId> bpp::Graph::getLeavesFromNode ( NodeId  node,
unsigned int  maxDepth 
) const
pure virtualinherited

Get the leaves of a graph, ie, nodes with only one neighbor, starting from a peculiar node.

Parameters
nodethe starting node
maxDepththe maximum number of allowed depth.
Returns
a vector containing the leaves

Implemented in bpp::GlobalGraph.

◆ getLeavesUnderNode()

virtual std::vector<Graph::NodeId> bpp::TreeGraph::getLeavesUnderNode ( Graph::NodeId  node) const
pure virtual

Get the leaves under a node

Parameters
nodethe starting node
Returns
a vector containing the leaves

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getNeighbors()

virtual std::vector<NodeId> bpp::Graph::getNeighbors ( const NodeId  node) const
pure virtualinherited

Get all the neighbors of a node in the graph.

Parameters
nodethe node one wants to get its neighbors
Returns
a vector containing the ID of the neighbors

Implemented in bpp::GlobalGraph.

◆ getNodePathBetweenTwoNodes()

virtual std::vector<Graph::NodeId> bpp::TreeGraph::getNodePathBetweenTwoNodes ( Graph::NodeId  nodeA,
Graph::NodeId  nodeB,
bool  includeAncestor = true 
) const
pure virtual

◆ getNodes()

virtual std::pair<NodeId, NodeId> bpp::Graph::getNodes ( EdgeId  edge) const
pure virtualinherited

Get nodes located at the extremities of an edge

Returns
a pair of the Nodes at each extremity of the edge example : N1–E1–>N2; getNodes(E1) will return (N1,N2);

Implemented in bpp::GlobalGraph.

◆ getNumberOfEdges()

virtual size_t bpp::Graph::getNumberOfEdges ( ) const
pure virtualinherited

Get the number of edges in the graph.

Implemented in bpp::GlobalGraph.

◆ getNumberOfIncomingNeighbors()

virtual size_t bpp::Graph::getNumberOfIncomingNeighbors ( const NodeId  node) const
pure virtualinherited

Get the number of incoming neighbors of a node (ie the number of fathers) in the graph.

Parameters
nodethe node one wants to count its fathers
Returns
the number of incoming neighbors

Implemented in bpp::GlobalGraph.

Referenced by bpp::DAGraphImpl< GraphImpl >::removeFather().

◆ getNumberOfNeighbors()

virtual size_t bpp::Graph::getNumberOfNeighbors ( NodeId  node) const
pure virtualinherited

Get the number of neighbors of a node in the graph.

Parameters
nodethe node one wants to count its sons
Returns
the number of neighbors

Implemented in bpp::GlobalGraph.

◆ getNumberOfNodes()

virtual size_t bpp::Graph::getNumberOfNodes ( ) const
pure virtualinherited

Get the number of nodes in the graph.

Implemented in bpp::GlobalGraph.

◆ getNumberOfOutgoingNeighbors()

virtual size_t bpp::Graph::getNumberOfOutgoingNeighbors ( NodeId  node) const
pure virtualinherited

Get the number of outgoing neighbors of a node (ie the number of sons) in the graph.

Parameters
nodethe node one wants to count its sons
Returns
the number of outgoing neighbors

Implemented in bpp::GlobalGraph.

◆ getNumberOfSons()

virtual size_t bpp::TreeGraph::getNumberOfSons ( Graph::NodeId  node) const
pure virtual

Get the number of sons node.

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getOutgoingEdges()

virtual std::vector<EdgeId> bpp::Graph::getOutgoingEdges ( const NodeId  node) const
pure virtualinherited

In an directed graph, get all the edges which are leaving a node in the graph.

Parameters
nodethe node one wants to get its edges
Returns
a vector containing the ID of the outgoing edges

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ getOutgoingNeighbors()

virtual std::vector<NodeId> bpp::Graph::getOutgoingNeighbors ( const NodeId  node) const
pure virtualinherited

In an directed graph, get all the neighbors which are leaving a node in the graph.

Parameters
nodethe node one wants to get its neighbors
Returns
a vector containing the ID of the outgoing neighbors

Implemented in bpp::GlobalGraph.

◆ getRoot()

virtual NodeId bpp::Graph::getRoot ( ) const
pure virtualinherited

get the root node

Implemented in bpp::GlobalGraph.

Referenced by bpp::TreeGraphImpl< GraphImpl >::MRCA(), and bpp::Graph::~Graph().

◆ getSetOfAllLeaves()

virtual std::set<NodeId> bpp::Graph::getSetOfAllLeaves ( ) const
pure virtualinherited

Implemented in bpp::GlobalGraph.

◆ getSons()

virtual std::vector<Graph::NodeId> bpp::TreeGraph::getSons ( Graph::NodeId  node) const
pure virtual

Get the sons node of a node

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getSubtreeEdges()

virtual std::vector<Graph::EdgeId> bpp::TreeGraph::getSubtreeEdges ( Graph::NodeId  localRoot) const
pure virtual

Get all the branches of a subtree

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getSubtreeNodes()

virtual std::vector<Graph::NodeId> bpp::TreeGraph::getSubtreeNodes ( Graph::NodeId  localRoot) const
pure virtual

Get all the nodes of a subtree

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ getTop()

virtual NodeId bpp::Graph::getTop ( EdgeId  edge) const
pure virtualinherited

Get node located at the top of an edge

Returns
the Node at the top the edge example : N1–E1–>N2; getTop(E1) will return N1;

Implemented in bpp::GlobalGraph.

◆ hasFather()

virtual bool bpp::TreeGraph::hasFather ( Graph::NodeId  node) const
pure virtual

Check if node has a father

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ incomingEdgesIterator()

virtual std::unique_ptr<EdgeIterator> bpp::Graph::incomingEdgesIterator ( NodeId  node)
pure virtualinherited

◆ incomingNeighborNodesIterator()

virtual std::unique_ptr<NodeIterator> bpp::Graph::incomingNeighborNodesIterator ( NodeId  node)
pure virtualinherited

Implemented in bpp::GlobalGraph.

◆ isDA()

virtual bool bpp::Graph::isDA ( ) const
pure virtualinherited

Is the graph directed acyclic?

Returns
true if an edge is met more than one time browsing the graph

Implemented in bpp::GlobalGraph.

◆ isDirected()

virtual bool bpp::Graph::isDirected ( ) const
pure virtualinherited

Is the graph directed?

Returns
true the type of the graph is directed

Implemented in bpp::GlobalGraph.

◆ isLeaf()

virtual bool bpp::TreeGraph::isLeaf ( Graph::NodeId  node) const
pure virtual

Says if a node is a leaf (ie has at most one neighbor).

Implements bpp::Graph.

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ isTree()

virtual bool bpp::Graph::isTree ( ) const
pure virtualinherited

Is the graph a tree?

Returns
false if a node is met more than one time browsing the graph

Implemented in bpp::GlobalGraph.

◆ isValid()

virtual bool bpp::TreeGraph::isValid ( ) const
pure virtual

Is the graph a tree? A tree must be acyclic and with no isolated node.

Returns
true if valid tree

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ link() [1/2]

virtual EdgeId bpp::Graph::link ( NodeId  nodeA,
NodeId  nodeB 
)
protectedpure virtualinherited

Creates a link between two existing nodes. If directed graph: nodeA -> nodeB.

Parameters
nodeAsource node (or first node if undirected)
nodeBtarget node (or second node if undirected)
Returns
the index of the new edge

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ link() [2/2]

virtual void bpp::Graph::link ( Graph::NodeId  nodeA,
Graph::NodeId  nodeB,
Graph::EdgeId  edgeID 
)
protectedpure virtualinherited

Sets a link between two existing nodes, using existing edge. If directed graph: nodeA -> nodeB.

Parameters
nodeAsource node (or first node if undirected)
nodeBtarget node (or second node if undirected)
edgeIDthe used edge

Implemented in bpp::GlobalGraph.

◆ makeDirected()

virtual void bpp::Graph::makeDirected ( )
pure virtualinherited

Make the graph directed

  • changes the property
  • de-duplicate the relations: eg: A - B in undirected is represented as A->B and B->A in directed, becomes A->B only

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

◆ makeUndirected()

virtual void bpp::Graph::makeUndirected ( )
pure virtualinherited

Make the graph directed

  • changes the property
  • de-duplicate the relations: eg: A - B in directed is represented as A->B in undirected, becomes A->B and B->A If the directed graph already contains reciprocal relations, such as A->B and B->A, the method will throw an exception.

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ MRCA()

virtual Graph::NodeId bpp::TreeGraph::MRCA ( const std::vector< Graph::NodeId > &  nodes) const
pure virtual

◆ notifyDeletedEdges()

virtual void bpp::Graph::notifyDeletedEdges ( const std::vector< EdgeId > &  edgesToDelete) const
protectedpure virtualinherited

Trigger E objects deleting on the observers

Parameters
edgesToDeletelist of edges to delete

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ notifyDeletedNodes()

virtual void bpp::Graph::notifyDeletedNodes ( const std::vector< NodeId > &  nodesToDelete) const
protectedpure virtualinherited

Trigger N objects deleting on the observers

Parameters
nodesToDeletelist of edges to delete

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ orientate()

virtual void bpp::Graph::orientate ( )
pure virtualinherited

Orientates the graph hanging from the root

Implemented in bpp::GlobalGraph.

◆ outgoingEdgesIterator()

virtual std::unique_ptr<EdgeIterator> bpp::Graph::outgoingEdgesIterator ( NodeId  node)
pure virtualinherited

◆ outgoingNeighborNodesIterator()

virtual std::unique_ptr<NodeIterator> bpp::Graph::outgoingNeighborNodesIterator ( NodeId  node)
pure virtualinherited

Implemented in bpp::GlobalGraph.

◆ outputToDot()

virtual void bpp::Graph::outputToDot ( std::ostream &  out,
const std::string &  name 
) const
pure virtualinherited

Output the graph in DOT format

Parameters
outa ostream where the DOT format will be output
namea string naming the graph

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::EdgeIterator::~EdgeIterator().

◆ registerObserver()

virtual void bpp::Graph::registerObserver ( GraphObserver observer)
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().

◆ removeSon()

virtual void bpp::TreeGraph::removeSon ( Graph::NodeId  node,
Graph::NodeId  son 
)
pure virtual

Remove one son

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ removeSons()

std::vector<Graph::NodeId> bpp::TreeGraph::removeSons ( Graph::NodeId  node)

Remove all the sons

◆ rootAt()

virtual void bpp::TreeGraph::rootAt ( Graph::NodeId  newRoot)
pure virtual

Re-root the tree with the new root

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ setFather() [1/2]

virtual void bpp::TreeGraph::setFather ( Graph::NodeId  node,
Graph::NodeId  fatherNode 
)
pure virtual

set the father node of a node in a rooted tree

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ setFather() [2/2]

virtual void bpp::TreeGraph::setFather ( Graph::NodeId  node,
Graph::NodeId  fatherNode,
Graph::EdgeId  edgeId 
)
pure virtual

◆ setOutGroup()

virtual void bpp::TreeGraph::setOutGroup ( Graph::NodeId  newOutGroup)
pure virtual

Set a node as a new outgroup in a rooted tree, will make a root between the given node and its father.

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ setRoot()

virtual void bpp::Graph::setRoot ( NodeId  newRoot)
protectedpure virtualinherited

set the root node to an existing node. Will not affect the topology.

Parameters
newRootthe new root

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ sonsIterator() [1/2]

virtual std::unique_ptr<Graph::NodeIterator> bpp::TreeGraph::sonsIterator ( Graph::NodeId  node)
pure virtual

Get a iterator on the sons node of a node

Implemented in bpp::TreeGraphImpl< GraphImpl >.

◆ sonsIterator() [2/2]

virtual std::unique_ptr<Graph::NodeIterator> bpp::TreeGraph::sonsIterator ( Graph::NodeId  node) const
pure virtual

◆ unlink()

virtual std::vector<EdgeId> bpp::Graph::unlink ( NodeId  nodeA,
NodeId  nodeB 
)
protectedpure virtualinherited

Remove all links between two existing nodes. If directed graph: nodeA -> nodeB.

Parameters
nodeAsource node (or first node if undirected)
nodeBtarget node (or second node if undirected)
Returns
vector of IDs to de-assigned edges

Implemented in bpp::GlobalGraph.

Referenced by bpp::Graph::~Graph().

◆ unregisterObserver()

virtual void bpp::Graph::unregisterObserver ( GraphObserver observer)
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().

◆ unRoot()

virtual void bpp::TreeGraph::unRoot ( bool  joinRootSons)
pure virtual

Set the tree to its flat unrooted version. As an algorithmical convenience, a root node is kept, but it has no logical significance.

Implemented in bpp::TreeGraphImpl< GraphImpl >.


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