OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Graph.cpp
Go to the documentation of this file.
1 
22 #include "Graph.hpp"
23 
24 namespace OA {
25 
26 //--------------------------------------------------------------------
30 OA_ptr<BaseGraph::Node>
32 {/* AIS - commented out in order to get OA to compile
33  OA_ptr<NodesIterator> neigh =
34  (n.convert<Node>())->getNeighborNodesIterator();;
35  OA_ptr<BaseGraph::Node> last = n;
36  while (neigh->isValid()) {
37  if (neigh->current()->dfs_succ.ptrEqual(0)) {
38  OA_ptr<Node> n = neigh->current(); // Stupid Sun CC 5.4
39  // cast is needed to access protected member
40  (last.convert<Node>())->dfs_succ = n.convert<BaseGraph::Node>();
41  last = create_DFS_links(neigh->current());
42  }
43  ++(*neigh);
44  }
45  // cast is needed to access protected member
46  (last.convert<Node>())->dfs_succ = 0;
47  return last;*/
48 }
49 //--------------------------------------------------------------------
50 
51 
52 //--------------------------------------------------------------------
58 {
59  return n;
60 }
61 //--------------------------------------------------------------------
62 
63 
64 //--------------------------------------------------------------------
66 void
68 {
69  BaseGraph::addNode(n);
70 }
71 //--------------------------------------------------------------------
72 
73 
74 //--------------------------------------------------------------------
78 void
80 {
81  BaseGraph::addEdge(e);
82  e->node1()->incident_edges->push_back(e);
83  e->node2()->incident_edges->push_back(e);
84 }
85 //--------------------------------------------------------------------
86 
87 
88 //--------------------------------------------------------------------
92 void
94 {
95  BaseGraph::removeEdge(e);
96 
97  // remove this edge from the list of incident edges of the two nodes involved
98  e->node1()->incident_edges->remove(e);
99  e->node2()->incident_edges->remove(e);
100 }
101 //--------------------------------------------------------------------
102 
103 
104 //--------------------------------------------------------------------
106 void
108 {
109 /* AIS - temporarily commented out so I can get OA to compile.
110  BaseGraph::removeNode(n);
111 
112  // remove all the edges incident on this node
113  OA_ptr<EdgesIterator> incident = n->getIncidentEdgesIterator();
114  while (incident->isValid()) {
115  OA_ptr<Edge> e = incident->current();
116  // remove this edge from the neighboring node's list of incident edges
117  if (e->node1().ptrEqual(n)) {
118  e->node2()->incident_edges->remove(e);
119  } else {
120  e->node1()->incident_edges->remove(e);
121  }
122  // remove this edge
123  BaseGraph::removeEdge(e);
124  ++incident;
125  }*/
126 }
127 //--------------------------------------------------------------------
128 
129 } // end of OA namespace