bpp-core3
3.0.0
|
#include <Bpp/Graph/GlobalGraph.h>
Public Types | |
typedef Graph::NodeId | Node |
typedef Graph::EdgeId | Edge |
typedef std::map< Node, std::pair< std::map< Node, Edge >, std::map< Node, Edge > > > | nodeStructureType |
typedef std::map< Edge, std::pair< Node, Node > > | edgeStructureType |
typedef unsigned int | NodeId |
typedef unsigned int | EdgeId |
Public Member Functions | |
Observers Management | |
Managing communication with the observers: subscribe, unsubscribe. | |
void | registerObserver (GraphObserver *observer) |
void | unregisterObserver (GraphObserver *observer) |
Topological Properties | |
These methodes check some topological properties. | |
bool | isTree () const |
bool | isDA () const |
void | orientate () |
bool | isDirected () const |
bool | containsReciprocalRelations () const |
std::unique_ptr< EdgeIterator > | allEdgesIterator () |
std::unique_ptr< EdgeIterator > | allEdgesIterator () const |
std::unique_ptr< EdgeIterator > | outgoingEdgesIterator (NodeId node) |
std::unique_ptr< EdgeIterator > | outgoingEdgesIterator (NodeId node) const |
std::unique_ptr< EdgeIterator > | incomingEdgesIterator (NodeId node) |
std::unique_ptr< EdgeIterator > | incomingEdgesIterator (NodeId node) const |
std::vector< Graph::EdgeId > | getEdges (Graph::NodeId node) const |
std::vector< Graph::EdgeId > | getOutgoingEdges (Graph::NodeId node) const |
std::vector< Graph::EdgeId > | getIncomingEdges (Graph::NodeId node) const |
Graph::EdgeId | getEdge (Graph::NodeId nodeA, Graph::NodeId nodeB) const |
Graph::EdgeId | getAnyEdge (Graph::NodeId nodeA, Graph::NodeId nodeB) const |
std::vector< Graph::EdgeId > | getAllEdges () const |
Protected Member Functions | |
void | nodeMustExist_ (const Node &node, std::string name="") const |
void | edgeMustExist_ (const Edge &edge, std::string name="") const |
Private Member Functions | |
virtual void | topologyHasChanged_ () const |
void | notify_ () |
void | linkInNodeStructure_ (const Node &nodeA, const Node &nodeB, const Edge &edge) |
void | linkInEdgeStructure_ (const Node &nodeA, const Node &nodeB, const Edge &edge) |
Edge | unlinkInNodeStructure_ (const Node &nodeA, const Node &nodeB) |
void | unlinkInEdgeStructure_ (const Edge &edge) |
std::vector< Node > | getNeighbors_ (const Node &node, bool outgoing=true) const |
std::vector< Edge > | getEdges_ (const Node &node, bool outgoing=true) const |
void | isolate_ (Node &node) |
void | fillListOfLeaves_ (const Node &startingNode, std::vector< Node > &foundLeaves, const Node &originNode, unsigned int maxRecursions) const |
bool | nodesAreMetOnlyOnce_ (const Node &node, std::set< Node > &metNodes, const Node &originNode) const |
void | nodeToDot_ (const Node &node, std::ostream &out, std::set< std::pair< Node, Node >> &alreadyFigured) const |
Private Attributes | |
bool | directed_ |
std::set< GraphObserver * > | observers_ |
Node | highestNodeID_ |
Edge | highestEdgeID_ |
nodeStructureType | nodeStructure_ |
edgeStructureType | edgeStructure_ |
Node | root_ |
General Management | |
void | setRoot (Graph::NodeId newRoot) |
GlobalGraph (bool directed=false) | |
GlobalGraph (const GlobalGraph &gg) | |
GlobalGraph & | operator= (const GlobalGraph &gg) |
GlobalGraph * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
~GlobalGraph () | |
Graph::NodeId | getRoot () const |
void | makeDirected () |
void | makeUndirected () |
Relations management | |
Graph::EdgeId | link (Graph::NodeId nodeA, Graph::NodeId nodeB) |
void | link (Graph::NodeId nodeA, Graph::NodeId nodeB, GlobalGraph::Edge edgeID) |
void | switchNodes (Graph::NodeId nodeA, Graph::NodeId nodeB) |
std::vector< Graph::EdgeId > | unlink (Graph::NodeId nodeA, Graph::NodeId nodeB) |
Graph::NodeId | createNode () |
Graph::NodeId | createNodeFromNode (Graph::NodeId origin) |
Graph::NodeId | createNodeOnEdge (Graph::EdgeId edge) |
Graph::NodeId | createNodeFromEdge (Graph::NodeId origin) |
void | deleteNode (Graph::NodeId node) |
Updating the changes on the observers | |
template<class N , class E , class GraphImpl > | |
class | AssociationGraphImplObserver |
void | notifyDeletedEdges (const std::vector< Graph::EdgeId > &edgesToDelete) const |
void | notifyDeletedNodes (const std::vector< Graph::NodeId > &nodesToDelete) const |
void | outputToDot (std::ostream &out, const std::string &name) const |
Definition at line 18 of file GlobalGraph.h.
typedef Graph::EdgeId bpp::GlobalGraph::Edge |
Definition at line 24 of file GlobalGraph.h.
|
inherited |
typedef std::map<Edge, std::pair<Node, Node> > bpp::GlobalGraph::edgeStructureType |
The edge structure type directed example: N1–E1–>N2 is coded as E1 -> (N1,N2) undirected example: N1–E1–N2 is coded as E1 -> (N1,N2)
Definition at line 45 of file GlobalGraph.h.
typedef Graph::NodeId bpp::GlobalGraph::Node |
Definition at line 23 of file GlobalGraph.h.
|
inherited |
typedef std::map<Node, std::pair<std::map<Node, Edge>, std::map<Node, Edge> > > bpp::GlobalGraph::nodeStructureType |
The node structure type Node -> ("toNodes" [DestNode,Edge],"fromNodes" [DestNode,Edge]) directed example: (N1)-E1->(N2)-E2->(N3) is coded as N1 -> ((N2:E1),()) N2 -> ((N3:E3),(N1:E1)) N3 -> ((),(N2:E2)) undirected example: (N1)-E1-(N2)-E2->(N3) is coded as N1 -> ((N2:E1),(N2:E1)) N2 -> ((N1:E1, N3:E3),(N1:E1, N3:E3)) N3 -> ((N2:E2),(N2:E2))
Definition at line 38 of file GlobalGraph.h.
GlobalGraph::GlobalGraph | ( | bool | directed = false | ) |
Constructor
directed | true if the graph is directed. |
Definition at line 19 of file GlobalGraph.cpp.
Referenced by clone(), and topologyHasChanged_().
GlobalGraph::GlobalGraph | ( | const GlobalGraph & | gg | ) |
Definition at line 30 of file GlobalGraph.cpp.
|
inline |
Definition at line 222 of file GlobalGraph.h.
References createNode(), createNodeFromEdge(), createNodeFromNode(), createNodeOnEdge(), deleteNode(), getRoot(), link(), makeDirected(), makeUndirected(), registerObserver(), setRoot(), switchNodes(), unlink(), and unregisterObserver().
|
virtual |
Implements bpp::Graph.
Definition at line 859 of file GlobalGraph.cpp.
std::unique_ptr< Graph::EdgeIterator > GlobalGraph::allEdgesIterator | ( | ) | const |
Definition at line 874 of file GlobalGraph.cpp.
|
virtual |
|
virtual |
Implements bpp::Graph.
Definition at line 343 of file GlobalGraph.cpp.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 220 of file GlobalGraph.h.
References GlobalGraph().
|
virtual |
Does the graph contain reciprocal relations such as A->B and B->A?
Implements bpp::Graph.
Definition at line 841 of file GlobalGraph.cpp.
References directed_, and nodeStructure_.
Referenced by makeUndirected().
|
virtual |
Creates an orphaned node.
Implements bpp::Graph.
Definition at line 219 of file GlobalGraph.cpp.
References highestNodeID_, nodeStructure_, and topologyHasChanged_().
Referenced by createNodeFromNode(), createNodeOnEdge(), and ~GlobalGraph().
|
virtual |
Creates a node linked to new node, splitting an edge.
origin | existing edge. In a directed graph: origin -> newNode. |
Implements bpp::Graph.
Definition at line 256 of file GlobalGraph.cpp.
References createNodeFromNode(), createNodeOnEdge(), edgeMustExist_(), and topologyHasChanged_().
Referenced by ~GlobalGraph().
|
virtual |
Creates a node linked to an existing node.
origin | existing node. In a directed graph: origin -> newNode. |
Implements bpp::Graph.
Definition at line 228 of file GlobalGraph.cpp.
References createNode(), link(), and topologyHasChanged_().
Referenced by createNodeFromEdge(), and ~GlobalGraph().
|
virtual |
Creates new node on an existing Edge. A -> B will be A -> N -> B
edge | existing edge. |
Implements bpp::Graph.
Definition at line 236 of file GlobalGraph.cpp.
References createNode(), edgeMustExist_(), edgeStructure_, link(), topologyHasChanged_(), and unlink().
Referenced by createNodeFromEdge(), and ~GlobalGraph().
|
virtual |
Delete one node
node | node to be deleted |
Implements bpp::Graph.
Definition at line 465 of file GlobalGraph.cpp.
References isolate_(), nodeMustExist_(), nodeStructure_, topologyHasChanged_(), and bpp::TextTools::toString().
Referenced by isDA(), orientate(), and ~GlobalGraph().
|
protected |
Check that a edge exists. If not, throw an exception.
edge | edge that has to be checked |
name | common name to give to the user in case of failure (eg: "first node") |
Definition at line 60 of file GlobalGraph.cpp.
References edgeStructure_, and bpp::TextTools::toString().
Referenced by createNodeFromEdge(), createNodeOnEdge(), getNodes(), and topologyHasChanged_().
|
private |
Get leaves from a starting node, filling a vector (private version).
startingNode | root node |
foundLeaves | a vector containing all the found leaves |
originNode | the node where we come from, not to explore |
maxRecursions | maximum number of recursion steps |
Definition at line 567 of file GlobalGraph.cpp.
References getNeighbors().
Referenced by getLeavesFromNode(), and topologyHasChanged_().
|
virtual |
Get all edges of a graph.
Implements bpp::Graph.
Definition at line 495 of file GlobalGraph.cpp.
References edgeStructure_.
|
virtual |
Get all the inner nodes, ie, nodes with degree > 1.
Implements bpp::Graph.
Definition at line 555 of file GlobalGraph.cpp.
References getNumberOfOutgoingNeighbors(), and nodeStructure_.
|
virtual |
Get all leaves of a graph, ie, nodes with no son (or only one neighbor is not directet).
Implements bpp::Graph.
Definition at line 520 of file GlobalGraph.cpp.
References isLeaf(), and nodeStructure_.
|
virtual |
Get all the nodes.
Implements bpp::Graph.
Definition at line 544 of file GlobalGraph.cpp.
References nodeStructure_.
|
virtual |
Returns the Edge between two nodes, trying both directions
nodeA | any node implied in the relation |
nodeB | any other node implied in the relation |
Implements bpp::Graph.
Definition at line 506 of file GlobalGraph.cpp.
References getEdge().
|
virtual |
Get node located at the bottom of an edge
Implements bpp::Graph.
Definition at line 460 of file GlobalGraph.cpp.
References getNodes().
|
virtual |
Get the degree of a node (ie the number of neighbors) in the graph.
node | the node one wants to count its neighbors |
Implements bpp::Graph.
Definition at line 384 of file GlobalGraph.cpp.
References isDirected(), nodeStructure_, and bpp::TextTools::toString().
|
virtual |
Returns the Edge between two nodes
nodeA | if directed, origin node |
nodeB | if directed, destination node |
Implements bpp::Graph.
Definition at line 889 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by getAnyEdge().
|
virtual |
Get all the edges to/from a node in the graph.
node | the node one wants to get its edges |
Implements bpp::Graph.
Definition at line 900 of file GlobalGraph.cpp.
References getEdges_().
|
private |
Private version of getIncomingEdges or getOutgoingEdges. Common code of these function shared here.
node | node to in or outgoing edges |
outgoing | boolean: if true, outgoing; else incoming |
Definition at line 302 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by getEdges(), getIncomingEdges(), getOutgoingEdges(), and topologyHasChanged_().
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 323 of file GlobalGraph.cpp.
References getEdges_().
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 318 of file GlobalGraph.cpp.
References getNeighbors_().
Referenced by isolate_(), and orientate().
|
virtual |
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. |
Implements bpp::Graph.
Definition at line 584 of file GlobalGraph.cpp.
References fillListOfLeaves_().
|
virtual |
Get all the neighbors of a node in the graph.
node | the node one wants to get its neighbors |
Implements bpp::Graph.
Definition at line 437 of file GlobalGraph.cpp.
References getNeighbors_().
Referenced by fillListOfLeaves_().
|
private |
Private version of getIncomingNeighbors or getOutgoingNeighbors. Common code of these function shared here.
node | node to in or outgoing neighbors |
outgoing | boolean: if true, outgoing; else incoming |
Definition at line 287 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by getIncomingNeighbors(), getNeighbors(), getOutgoingNeighbors(), and topologyHasChanged_().
|
virtual |
Get nodes located at the extremities of an edge
Implements bpp::Graph.
Definition at line 448 of file GlobalGraph.cpp.
References edgeMustExist_(), and edgeStructure_.
Referenced by getBottom(), and getTop().
|
virtual |
Get the number of edges in the graph.
Implements bpp::Graph.
Definition at line 378 of file GlobalGraph.cpp.
References edgeStructure_.
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 429 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by orientate().
|
virtual |
Get the number of neighbors of a node in the graph.
node | the node one wants to count its neighbors |
Implements bpp::Graph.
Definition at line 409 of file GlobalGraph.cpp.
References isDirected(), and nodeStructure_.
Referenced by orientate().
|
virtual |
Get the number of nodes in the graph.
Implements bpp::Graph.
Definition at line 372 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by isDA(), and orientate().
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 421 of file GlobalGraph.cpp.
References nodeStructure_.
Referenced by getAllInnerNodes(), and isDA().
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 333 of file GlobalGraph.cpp.
References getEdges_().
|
virtual |
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 |
Implements bpp::Graph.
Definition at line 328 of file GlobalGraph.cpp.
References getNeighbors_().
Referenced by isolate_(), nodesAreMetOnlyOnce_(), and orientate().
|
virtual |
get the root node
Implements bpp::Graph.
Definition at line 768 of file GlobalGraph.cpp.
References root_.
Referenced by ~GlobalGraph().
|
virtual |
Implements bpp::Graph.
Definition at line 532 of file GlobalGraph.cpp.
References isLeaf(), and nodeStructure_.
|
virtual |
Get node located at the top of an edge
Implements bpp::Graph.
Definition at line 455 of file GlobalGraph.cpp.
References getNodes().
|
virtual |
Implements bpp::Graph.
Definition at line 869 of file GlobalGraph.cpp.
std::unique_ptr< Graph::EdgeIterator > GlobalGraph::incomingEdgesIterator | ( | Graph::NodeId | node | ) | const |
Definition at line 884 of file GlobalGraph.cpp.
|
virtual |
Implements bpp::Graph.
Definition at line 355 of file GlobalGraph.cpp.
std::unique_ptr< Graph::NodeIterator > GlobalGraph::incomingNeighborNodesIterator | ( | Graph::NodeId | node | ) | const |
Definition at line 366 of file GlobalGraph.cpp.
|
virtual |
Is the graph directed acyclic?
Implements bpp::Graph.
Definition at line 647 of file GlobalGraph.cpp.
References allNodesIterator(), deleteNode(), bpp::Graph::NodeIterator::end(), getNumberOfNodes(), getNumberOfOutgoingNeighbors(), bpp::Graph::NodeIterator::next(), and observers_.
|
virtual |
Is the graph directed?
Implements bpp::Graph.
Definition at line 773 of file GlobalGraph.cpp.
References directed_.
Referenced by getDegree(), getNumberOfNeighbors(), isLeaf(), and orientate().
|
virtual |
Says if a node is a leaf (ie has at most one neighbor).
Implements bpp::Graph.
Definition at line 394 of file GlobalGraph.cpp.
References isDirected(), nodeStructure_, and bpp::TextTools::toString().
Referenced by getAllLeaves(), and getSetOfAllLeaves().
|
private |
Separate a node from all its neighbors.
node | node to isolate |
Definition at line 480 of file GlobalGraph.cpp.
References getIncomingNeighbors(), getOutgoingNeighbors(), and unlink().
Referenced by deleteNode(), and topologyHasChanged_().
|
virtual |
Is the graph a tree?
Implements bpp::Graph.
Definition at line 611 of file GlobalGraph.cpp.
References nodesAreMetOnlyOnce_(), nodeStructure_, and root_.
|
protectedvirtual |
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) |
Implements bpp::Graph.
Definition at line 67 of file GlobalGraph.cpp.
References directed_, highestEdgeID_, linkInEdgeStructure_(), and linkInNodeStructure_().
Referenced by createNodeFromNode(), createNodeOnEdge(), and ~GlobalGraph().
|
protectedvirtual |
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 |
Implements bpp::Graph.
Definition at line 82 of file GlobalGraph.cpp.
References directed_, edgeStructure_, linkInEdgeStructure_(), linkInNodeStructure_(), and bpp::TextTools::toString().
|
private |
Creates a link between two existing nodes in the edge structure. If directed graph: nodeA -> nodeB. Mainly called by link().
nodeA | source node (or first node if undirected) |
nodeB | target node (or second node if undirected) |
edge | the ID of the relation |
Definition at line 176 of file GlobalGraph.cpp.
References edgeStructure_, and topologyHasChanged_().
Referenced by link(), and topologyHasChanged_().
|
private |
Creates a link between two existing nodes. If directed graph: nodeA -> nodeB. Private version of link, does not check for the reciprocity. Mainly called by link().
nodeA | source node |
nodeB | target node |
edge | the ID of the relation |
Definition at line 206 of file GlobalGraph.cpp.
References nodeStructure_, and topologyHasChanged_().
Referenced by link(), makeDirected(), makeUndirected(), and topologyHasChanged_().
|
virtual |
Make the graph directed
Please note that the resulting directions are totaly arbritrary. One might consider to use the makeLocalRoot method.
Implements bpp::Graph.
Definition at line 778 of file GlobalGraph.cpp.
References directed_, linkInNodeStructure_(), nodeStructure_, and topologyHasChanged_().
Referenced by orientate(), and ~GlobalGraph().
|
virtual |
Make the graph directed
Implements bpp::Graph.
Definition at line 810 of file GlobalGraph.cpp.
References containsReciprocalRelations(), directed_, linkInNodeStructure_(), nodeStructure_, and topologyHasChanged_().
Referenced by ~GlobalGraph().
|
protected |
Check that a node exists. If not, throw an exception.
node | node that has to be checked |
name | common name to give to the user in case of failure (eg: "first node") |
Definition at line 54 of file GlobalGraph.cpp.
References nodeStructure_, and bpp::TextTools::toString().
Referenced by deleteNode(), setRoot(), and topologyHasChanged_().
|
private |
Check that nodes are only met once to define if the graph is cyclic.
node | the node to explore |
metNodes | a set containing all the nodes we met |
originNode | the node where we come from, not to explore |
Definition at line 630 of file GlobalGraph.cpp.
References getOutgoingNeighbors().
Referenced by isTree(), and topologyHasChanged_().
|
private |
output a node to DOT format (recursive)
Definition at line 591 of file GlobalGraph.cpp.
References directed_, and nodeStructure_.
Referenced by outputToDot(), and topologyHasChanged_().
|
private |
Tell all the observers to get the last updates. Calls the method update of all the subscribers.
Referenced by topologyHasChanged_().
|
virtual |
Trigger E objects deleting on the observers
edgesToDelete | list of edges to delete |
Implements bpp::Graph.
Definition at line 924 of file GlobalGraph.cpp.
References observers_.
Referenced by unlink().
|
virtual |
Trigger N objects deleting on the observers
nodesToDelete | list of edges to delete |
Implements bpp::Graph.
Definition at line 932 of file GlobalGraph.cpp.
References observers_.
GlobalGraph & GlobalGraph::operator= | ( | const GlobalGraph & | gg | ) |
Definition at line 40 of file GlobalGraph.cpp.
References directed_, edgeStructure_, highestEdgeID_, highestNodeID_, nodeStructure_, observers_, and root_.
Referenced by topologyHasChanged_().
|
virtual |
Orientates the graph hanging from the root
Implements bpp::Graph.
Definition at line 687 of file GlobalGraph.cpp.
References deleteNode(), getIncomingNeighbors(), getNumberOfIncomingNeighbors(), getNumberOfNeighbors(), getNumberOfNodes(), getOutgoingNeighbors(), isDirected(), makeDirected(), observers_, root_, and switchNodes().
|
virtual |
Implements bpp::Graph.
Definition at line 864 of file GlobalGraph.cpp.
std::unique_ptr< Graph::EdgeIterator > GlobalGraph::outgoingEdgesIterator | ( | Graph::NodeId | node | ) | const |
Definition at line 879 of file GlobalGraph.cpp.
|
virtual |
Implements bpp::Graph.
Definition at line 349 of file GlobalGraph.cpp.
std::unique_ptr< Graph::NodeIterator > GlobalGraph::outgoingNeighborNodesIterator | ( | Graph::NodeId | node | ) | const |
Definition at line 360 of file GlobalGraph.cpp.
|
virtual |
Output the graph in DOT format
out | a ostream where the DOT format will be output |
name | a string naming the graph |
Implements bpp::Graph.
Definition at line 911 of file GlobalGraph.cpp.
References directed_, nodeStructure_, nodeToDot_(), and root_.
|
virtual |
Attach a new observer to this Graph. As a subscriber, the observer will be warned of all the changes.
Implements bpp::Graph.
Definition at line 271 of file GlobalGraph.cpp.
References observers_.
Referenced by ~GlobalGraph().
|
protectedvirtual |
set the root node to an existing node. Will not affect the topology.
newRoot | the new root |
Implements bpp::Graph.
Definition at line 762 of file GlobalGraph.cpp.
References nodeMustExist_(), and root_.
Referenced by ~GlobalGraph().
|
protected |
Switch the edge between two existing nodes.
nodeA | source node (or first node if undirected) |
nodeB | target node (or second node if undirected) |
Definition at line 113 of file GlobalGraph.cpp.
References edgeStructure_, nodeStructure_, topologyHasChanged_(), and bpp::TextTools::toString().
Referenced by orientate(), and ~GlobalGraph().
|
inlineprivatevirtual |
Some types of Graphs need to know if they have been modified But for a Graph, it does nothing.
Definition at line 89 of file GlobalGraph.h.
References edgeMustExist_(), fillListOfLeaves_(), getEdges_(), getNeighbors_(), GlobalGraph(), isolate_(), linkInEdgeStructure_(), linkInNodeStructure_(), nodeMustExist_(), nodesAreMetOnlyOnce_(), nodeToDot_(), notify_(), operator=(), unlinkInEdgeStructure_(), and unlinkInNodeStructure_().
Referenced by createNode(), createNodeFromEdge(), createNodeFromNode(), createNodeOnEdge(), deleteNode(), linkInEdgeStructure_(), linkInNodeStructure_(), makeDirected(), makeUndirected(), switchNodes(), unlinkInEdgeStructure_(), and unlinkInNodeStructure_().
|
protectedvirtual |
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) |
Implements bpp::Graph.
Definition at line 96 of file GlobalGraph.cpp.
References notifyDeletedEdges(), unlinkInEdgeStructure_(), and unlinkInNodeStructure_().
Referenced by createNodeOnEdge(), isolate_(), and ~GlobalGraph().
|
private |
Erase a link between two existing nodes in the Edge structure. Mainly called by unLink().
edge | the edge to unregister |
Definition at line 166 of file GlobalGraph.cpp.
References edgeStructure_, topologyHasChanged_(), and bpp::TextTools::toString().
Referenced by topologyHasChanged_(), and unlink().
Erase a link between two existing nodes. If directed graph: nodeA -> nodeB. Private version of unLink, does not check for the reciprocity. Mainly called by unLink().
nodeA | source node |
nodeB | target node |
Definition at line 183 of file GlobalGraph.cpp.
References nodeStructure_, topologyHasChanged_(), and bpp::TextTools::toString().
Referenced by topologyHasChanged_(), and unlink().
|
virtual |
Detach an observer from this Graph. The observer will not be warned of changes anymore.
Implements bpp::Graph.
Definition at line 278 of file GlobalGraph.cpp.
References observers_.
Referenced by ~GlobalGraph().
|
friend |
Definition at line 688 of file GlobalGraph.h.
|
friend |
Definition at line 378 of file GlobalGraph.h.
|
friend |
Definition at line 375 of file GlobalGraph.h.
|
private |
is the graph directed
Definition at line 51 of file GlobalGraph.h.
Referenced by containsReciprocalRelations(), isDirected(), link(), makeDirected(), makeUndirected(), nodeToDot_(), operator=(), and outputToDot().
|
private |
Edges and their relations in the forward direction.. see edgeStructureType documentation
Definition at line 78 of file GlobalGraph.h.
Referenced by createNodeOnEdge(), edgeMustExist_(), getAllEdges(), getNodes(), getNumberOfEdges(), link(), linkInEdgeStructure_(), operator=(), switchNodes(), and unlinkInEdgeStructure_().
|
private |
Highest used available ID for an Edge.
Definition at line 65 of file GlobalGraph.h.
Referenced by link(), and operator=().
|
private |
Highest used available ID for a Node.
Definition at line 61 of file GlobalGraph.h.
Referenced by createNode(), and operator=().
|
private |
Nodes and their relations. see nodeStructureType documentation
Definition at line 72 of file GlobalGraph.h.
Referenced by containsReciprocalRelations(), createNode(), deleteNode(), getAllInnerNodes(), getAllLeaves(), getAllNodes(), getDegree(), getEdge(), getEdges_(), getNeighbors_(), getNumberOfIncomingNeighbors(), getNumberOfNeighbors(), getNumberOfNodes(), getNumberOfOutgoingNeighbors(), getSetOfAllLeaves(), isLeaf(), isTree(), linkInNodeStructure_(), makeDirected(), makeUndirected(), nodeMustExist_(), nodeToDot_(), operator=(), outputToDot(), switchNodes(), and unlinkInNodeStructure_().
|
private |
List of all the subscribers.
Definition at line 56 of file GlobalGraph.h.
Referenced by isDA(), notifyDeletedEdges(), notifyDeletedNodes(), operator=(), orientate(), registerObserver(), and unregisterObserver().
|
private |
Usualy the first node of a graph. Used for algorithmic purposes.
Definition at line 83 of file GlobalGraph.h.
Referenced by getRoot(), isTree(), operator=(), orientate(), outputToDot(), and setRoot().