a00084.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  5. <title>GTL - Graph Template Library: graph.h Source File</title>
  6. <link href="doxygen.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body>
  9. <p class="links">
  10. <a href="../index.html">Home</a> |
  11. Documentation |
  12. <a href="../register.html">Download</a> |
  13. <a href="../platforms.html">Platforms</a> |
  14. <a href="../refer.html">Projects</a> |
  15. <a href="../lists.html">Mailing Lists</a> |
  16. <a href="../history.html">Version History</a>
  17. </p>
  18. <!-- Generated by Doxygen 1.5.3 -->
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  22. <li><a href="classes.html"><span>Classes</span></a></li>
  23. <li class="current"><a href="files.html"><span>Files</span></a></li>
  24. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  25. </ul>
  26. </div>
  27. <h1>graph.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
  28. <a name="l00002"></a>00002 <span class="comment">//</span>
  29. <a name="l00003"></a>00003 <span class="comment">// graph.h</span>
  30. <a name="l00004"></a>00004 <span class="comment">//</span>
  31. <a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
  32. <a name="l00006"></a>00006 <span class="comment">// $Id: graph.h,v 1.43 2002/11/06 08:49:35 raitner Exp $</span>
  33. <a name="l00007"></a>00007
  34. <a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_GRAPH_H</span>
  35. <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_GRAPH_H</span>
  36. <a name="l00010"></a>00010 <span class="preprocessor"></span>
  37. <a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
  38. <a name="l00012"></a>00012 <span class="preprocessor">#include &lt;GTL/node.h&gt;</span>
  39. <a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/edge.h&gt;</span>
  40. <a name="l00014"></a>00014 <span class="preprocessor">#include &lt;GTL/edge_map.h&gt;</span>
  41. <a name="l00015"></a>00015 <span class="preprocessor">#include &lt;GTL/node_map.h&gt;</span>
  42. <a name="l00016"></a>00016 <span class="preprocessor">#include &lt;GTL/gml_parser.h&gt;</span>
  43. <a name="l00017"></a>00017
  44. <a name="l00018"></a>00018 <span class="preprocessor">#include &lt;iostream&gt;</span>
  45. <a name="l00019"></a>00019 <span class="preprocessor">#include &lt;string&gt;</span>
  46. <a name="l00020"></a>00020
  47. <a name="l00021"></a>00021 __GTL_BEGIN_NAMESPACE
  48. <a name="l00022"></a>00022
  49. <a name="l00041"></a><a class="code" href="a00014.html">00041</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>
  50. <a name="l00042"></a>00042 {
  51. <a name="l00043"></a>00043 <span class="keyword">public</span>:
  52. <a name="l00044"></a>00044 <span class="comment">//================================================== Con-/Destructors</span>
  53. <a name="l00045"></a>00045
  54. <a name="l00049"></a>00049 <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>();
  55. <a name="l00050"></a>00050
  56. <a name="l00062"></a>00062 <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
  57. <a name="l00063"></a>00063
  58. <a name="l00073"></a>00073 <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> list&lt;node&gt;&amp; nodes);
  59. <a name="l00074"></a>00074
  60. <a name="l00085"></a>00085 <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G,
  61. <a name="l00086"></a>00086 list&lt;node&gt;::const_iterator it,
  62. <a name="l00087"></a>00087 list&lt;node&gt;::const_iterator end);
  63. <a name="l00088"></a>00088
  64. <a name="l00092"></a>00092 <span class="keyword">virtual</span> ~<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>();
  65. <a name="l00093"></a>00093
  66. <a name="l00094"></a>00094 <span class="comment">//================================================== Directed/Undirected</span>
  67. <a name="l00095"></a>00095
  68. <a name="l00099"></a>00099 <span class="keywordtype">void</span> make_directed();
  69. <a name="l00100"></a>00100
  70. <a name="l00104"></a>00104 <span class="keywordtype">void</span> make_undirected();
  71. <a name="l00105"></a>00105
  72. <a name="l00106"></a>00106 <span class="comment">//================================================== Tests / Information</span>
  73. <a name="l00107"></a>00107
  74. <a name="l00113"></a>00113 <span class="keywordtype">bool</span> is_directed() <span class="keyword">const</span>;
  75. <a name="l00114"></a>00114
  76. <a name="l00120"></a>00120 <span class="keywordtype">bool</span> is_undirected() <span class="keyword">const</span>;
  77. <a name="l00121"></a>00121
  78. <a name="l00133"></a>00133 <span class="keywordtype">bool</span> is_bidirected(<a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;edge&gt;</a>&amp; rev) <span class="keyword">const</span>;
  79. <a name="l00134"></a>00134
  80. <a name="l00142"></a>00142 <span class="keywordtype">bool</span> is_connected() <span class="keyword">const</span>;
  81. <a name="l00143"></a>00143
  82. <a name="l00150"></a>00150 <span class="keywordtype">bool</span> is_acyclic() <span class="keyword">const</span>;
  83. <a name="l00151"></a>00151
  84. <a name="l00157"></a>00157 <span class="keywordtype">int</span> number_of_nodes() <span class="keyword">const</span>;
  85. <a name="l00158"></a>00158
  86. <a name="l00164"></a>00164 <span class="keywordtype">int</span> number_of_edges() <span class="keyword">const</span>;
  87. <a name="l00165"></a>00165
  88. <a name="l00172"></a>00172 <a class="code" href="a00020.html" title="A node in a graph.">node</a> center() <span class="keyword">const</span>;
  89. <a name="l00173"></a>00173
  90. <a name="l00174"></a>00174 <span class="comment">//================================================== Creation</span>
  91. <a name="l00175"></a>00175
  92. <a name="l00181"></a>00181 <span class="keyword">virtual</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a> new_node();
  93. <a name="l00182"></a>00182
  94. <a name="l00194"></a>00194 <span class="keyword">virtual</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> new_edge(<a class="code" href="a00020.html" title="A node in a graph.">node</a> s, <a class="code" href="a00020.html" title="A node in a graph.">node</a> t);
  95. <a name="l00195"></a>00195
  96. <a name="l00199"></a>00199 <span class="keyword">virtual</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> new_edge(<span class="keyword">const</span> list&lt;node&gt; &amp;sources, <span class="keyword">const</span> list&lt;node&gt; &amp;targets);
  97. <a name="l00200"></a>00200
  98. <a name="l00201"></a>00201 <span class="comment">//================================================== Deletion</span>
  99. <a name="l00202"></a>00202
  100. <a name="l00213"></a>00213 <span class="keywordtype">void</span> del_node(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
  101. <a name="l00214"></a>00214
  102. <a name="l00219"></a>00219 <span class="keywordtype">void</span> del_all_nodes();
  103. <a name="l00220"></a>00220
  104. <a name="l00230"></a>00230 <span class="keywordtype">void</span> del_edge(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  105. <a name="l00231"></a>00231
  106. <a name="l00236"></a>00236 <span class="keywordtype">void</span> del_all_edges();
  107. <a name="l00237"></a>00237
  108. <a name="l00241"></a>00241 <span class="keywordtype">void</span> clear();
  109. <a name="l00242"></a>00242
  110. <a name="l00243"></a>00243 <span class="comment">//================================================== Iterators</span>
  111. <a name="l00244"></a>00244
  112. <a name="l00248"></a>00248 <span class="keyword">typedef</span> list&lt;node&gt;::const_iterator node_iterator;
  113. <a name="l00252"></a>00252 <span class="keyword">typedef</span> list&lt;edge&gt;::const_iterator edge_iterator;
  114. <a name="l00253"></a>00253
  115. <a name="l00259"></a>00259 node_iterator nodes_begin() <span class="keyword">const</span>;
  116. <a name="l00260"></a>00260
  117. <a name="l00266"></a>00266 node_iterator nodes_end() <span class="keyword">const</span>;
  118. <a name="l00267"></a>00267
  119. <a name="l00273"></a>00273 edge_iterator edges_begin() <span class="keyword">const</span>;
  120. <a name="l00274"></a>00274
  121. <a name="l00280"></a>00280 edge_iterator edges_end() <span class="keyword">const</span>;
  122. <a name="l00281"></a>00281
  123. <a name="l00282"></a>00282 <span class="comment">//================================================== get nodes/edges</span>
  124. <a name="l00283"></a>00283
  125. <a name="l00288"></a>00288 list&lt;node&gt; all_nodes() <span class="keyword">const</span>;
  126. <a name="l00289"></a>00289
  127. <a name="l00294"></a>00294 list&lt;edge&gt; all_edges() <span class="keyword">const</span>;
  128. <a name="l00295"></a>00295
  129. <a name="l00299"></a>00299 <a class="code" href="a00020.html" title="A node in a graph.">node</a> choose_node () <span class="keyword">const</span>;
  130. <a name="l00300"></a>00300
  131. <a name="l00301"></a>00301 <span class="comment">//================================================== Hide / Restore</span>
  132. <a name="l00302"></a>00302
  133. <a name="l00311"></a>00311 <span class="keywordtype">void</span> hide_edge (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  134. <a name="l00312"></a>00312
  135. <a name="l00321"></a>00321 <span class="keywordtype">void</span> restore_edge (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  136. <a name="l00322"></a>00322
  137. <a name="l00334"></a>00334 list&lt;edge&gt; hide_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
  138. <a name="l00335"></a>00335
  139. <a name="l00346"></a>00346 <span class="keywordtype">void</span> restore_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
  140. <a name="l00347"></a>00347
  141. <a name="l00359"></a>00359 <span class="keywordtype">void</span> induced_subgraph (list&lt;node&gt;&amp; subgraph_nodes);
  142. <a name="l00360"></a>00360
  143. <a name="l00371"></a>00371 <span class="keywordtype">void</span> restore_graph ();
  144. <a name="l00372"></a>00372
  145. <a name="l00373"></a>00373 <span class="comment">//================================================== Others</span>
  146. <a name="l00374"></a>00374
  147. <a name="l00380"></a>00380 list&lt;edge&gt; insert_reverse_edges();
  148. <a name="l00381"></a>00381
  149. <a name="l00382"></a>00382 <span class="comment">//================================================== I/O</span>
  150. <a name="l00383"></a>00383
  151. <a name="l00400"></a><a class="code" href="a00014.html#93a350b8ce63ef0b0545722ba519fd3d">00400</a> <a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> load (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; filename, <span class="keywordtype">bool</span> preserve_ids = <span class="keyword">false</span>)
  152. <a name="l00401"></a>00401 { <span class="keywordflow">return</span> load (filename.c_str(), preserve_ids); }
  153. <a name="l00402"></a>00402
  154. <a name="l00403"></a>00403
  155. <a name="l00420"></a>00420 <a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> load (<span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <span class="keywordtype">bool</span> preserve_ids = <span class="keyword">false</span>);
  156. <a name="l00421"></a>00421
  157. <a name="l00430"></a>00430 <span class="keywordtype">int</span> save (<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) <span class="keyword">const</span>;
  158. <a name="l00431"></a>00431
  159. <a name="l00438"></a>00438 <span class="keywordtype">void</span> save (ostream* file = &amp;cout) <span class="keyword">const</span>;
  160. <a name="l00439"></a>00439
  161. <a name="l00440"></a>00440 <span class="comment">//================================================== Node handlers</span>
  162. <a name="l00441"></a>00441
  163. <a name="l00448"></a><a class="code" href="a00014.html#fb7606eaa8d673b6599af24437c0546c">00448</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_new_node_handler() {}
  164. <a name="l00449"></a>00449
  165. <a name="l00457"></a><a class="code" href="a00014.html#63b7354fbe3614748cc27340e99ff919">00457</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_new_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  166. <a name="l00458"></a>00458
  167. <a name="l00466"></a><a class="code" href="a00014.html#06f8fe6d5ee6bef9066f78a0b95c083a">00466</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_del_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  168. <a name="l00467"></a>00467
  169. <a name="l00474"></a><a class="code" href="a00014.html#4e08a559e3f1007a1a16a53c9a15cb0f">00474</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_del_node_handler() {}
  170. <a name="l00475"></a>00475
  171. <a name="l00483"></a><a class="code" href="a00014.html#96e6fadc8e77bde74448d4ba4b873628">00483</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_hide_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  172. <a name="l00484"></a>00484
  173. <a name="l00492"></a><a class="code" href="a00014.html#89cd4d0acb9a82a85ba7845a92a68044">00492</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_hide_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  174. <a name="l00493"></a>00493
  175. <a name="l00501"></a><a class="code" href="a00014.html#7da481e2f363380343a68d52acc8473b">00501</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_restore_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  176. <a name="l00502"></a>00502
  177. <a name="l00510"></a><a class="code" href="a00014.html#d0fd5fc9618111890b596601b6273713">00510</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_restore_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
  178. <a name="l00511"></a>00511
  179. <a name="l00512"></a>00512 <span class="comment">//================================================== Edge handlers</span>
  180. <a name="l00513"></a>00513
  181. <a name="l00522"></a><a class="code" href="a00014.html#e57c6789ea5945e32fca200163e44d8b">00522</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_new_edge_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> s, <a class="code" href="a00020.html" title="A node in a graph.">node</a> t) {}
  182. <a name="l00523"></a>00523
  183. <a name="l00531"></a><a class="code" href="a00014.html#88f098d412bcbacba975e70be8d1a892">00531</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_new_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  184. <a name="l00532"></a>00532
  185. <a name="l00540"></a><a class="code" href="a00014.html#413590984a00770927ba619c409a7b57">00540</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_del_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  186. <a name="l00541"></a>00541
  187. <a name="l00550"></a><a class="code" href="a00014.html#b9ac8bcc7288986de69cd467beb33600">00550</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_del_edge_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <a class="code" href="a00020.html" title="A node in a graph.">node</a>) {}
  188. <a name="l00551"></a>00551
  189. <a name="l00559"></a><a class="code" href="a00014.html#d755188a78a38f733cf362d4e8dd47f8">00559</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_hide_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  190. <a name="l00560"></a>00560
  191. <a name="l00568"></a><a class="code" href="a00014.html#7554deb5a22be446b2b423f2ce481c64">00568</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_hide_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  192. <a name="l00569"></a>00569
  193. <a name="l00577"></a><a class="code" href="a00014.html#4c3634093c7d8877b6c229bcbfa4702b">00577</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_restore_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  194. <a name="l00578"></a>00578
  195. <a name="l00586"></a><a class="code" href="a00014.html#8c0f68bcd054fc2736716996bbf56472">00586</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_restore_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
  196. <a name="l00587"></a>00587
  197. <a name="l00588"></a>00588 <span class="comment">//================================================== Global handlers</span>
  198. <a name="l00589"></a>00589
  199. <a name="l00600"></a><a class="code" href="a00014.html#16ccad78837d16be59854549cd2d847a">00600</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_clear_handler() {}
  200. <a name="l00601"></a>00601
  201. <a name="l00612"></a><a class="code" href="a00014.html#870633528590b7925cd27776bdd2bbd2">00612</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_clear_handler() {}
  202. <a name="l00613"></a>00613
  203. <a name="l00621"></a><a class="code" href="a00014.html#505198f412b1e426e9d09b62ea9811e8">00621</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_make_directed_handler() {}
  204. <a name="l00622"></a>00622
  205. <a name="l00630"></a><a class="code" href="a00014.html#43dc35def3d8125eb8f3841d55e0b1c8">00630</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_make_directed_handler() {}
  206. <a name="l00631"></a>00631
  207. <a name="l00639"></a><a class="code" href="a00014.html#8964107991e6f411ba8992f6b1deda21">00639</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_make_undirected_handler() {}
  208. <a name="l00640"></a>00640
  209. <a name="l00648"></a><a class="code" href="a00014.html#3d2bc348d12931aff1d2e97a6b4285c3">00648</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_make_undirected_handler() {}
  210. <a name="l00649"></a>00649
  211. <a name="l00650"></a>00650
  212. <a name="l00651"></a>00651 <span class="comment">//================================================== I/O - Handler </span>
  213. <a name="l00652"></a>00652
  214. <a name="l00661"></a><a class="code" href="a00014.html#81300befaa8bc1525793f4849f1473a5">00661</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_graph_save_handler (ostream* os)<span class="keyword"> const </span>{ };
  215. <a name="l00662"></a>00662
  216. <a name="l00672"></a><a class="code" href="a00014.html#daf1ba615a8647485b89e94cdb6ae209">00672</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_graph_info_handler (ostream*)<span class="keyword"> const </span>{ };
  217. <a name="l00673"></a>00673
  218. <a name="l00683"></a><a class="code" href="a00014.html#9ff703e09f902bf431664587057081ca">00683</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_node_info_handler (ostream*, <a class="code" href="a00020.html" title="A node in a graph.">node</a>)<span class="keyword"> const </span>{ };
  219. <a name="l00684"></a>00684
  220. <a name="l00694"></a><a class="code" href="a00014.html#9623957f45c2bc7c6042fd22c8a86241">00694</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_edge_info_handler (ostream*, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>)<span class="keyword"> const </span>{ };
  221. <a name="l00695"></a>00695
  222. <a name="l00704"></a><a class="code" href="a00014.html#adf85f37373798a6c53be7c0a5e98025">00704</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> after_graph_save_handler (ostream* )<span class="keyword"> const </span>{ };
  223. <a name="l00705"></a>00705
  224. <a name="l00715"></a>00715 <span class="keyword">virtual</span> <span class="keywordtype">void</span> top_level_key_handler (GML_pair* list);
  225. <a name="l00716"></a>00716
  226. <a name="l00727"></a>00727 <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_node_info_handler (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, GML_pair* list );
  227. <a name="l00728"></a>00728
  228. <a name="l00739"></a>00739 <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_edge_info_handler (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e, GML_pair* list);
  229. <a name="l00740"></a>00740
  230. <a name="l00749"></a>00749 <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_graph_info_handler (GML_pair* list);
  231. <a name="l00750"></a>00750
  232. <a name="l00751"></a>00751 <span class="keyword">private</span>:
  233. <a name="l00752"></a>00752
  234. <a name="l00753"></a>00753 <span class="comment">//================================================== Flags</span>
  235. <a name="l00754"></a>00754
  236. <a name="l00755"></a>00755 <span class="keyword">mutable</span> <span class="keywordtype">bool</span> directed;
  237. <a name="l00756"></a>00756
  238. <a name="l00757"></a>00757 <span class="comment">//================================================== Visible Nodes/Edges</span>
  239. <a name="l00758"></a>00758
  240. <a name="l00759"></a>00759 list&lt;node&gt; nodes;
  241. <a name="l00760"></a>00760 list&lt;edge&gt; edges;
  242. <a name="l00761"></a>00761 <span class="keywordtype">int</span> nodes_count, edges_count;
  243. <a name="l00762"></a>00762
  244. <a name="l00763"></a>00763 <span class="comment">//================================================== Hidden Nodes/Edges</span>
  245. <a name="l00764"></a>00764
  246. <a name="l00765"></a>00765 list&lt;node&gt; hidden_nodes;
  247. <a name="l00766"></a>00766 list&lt;edge&gt; hidden_edges;
  248. <a name="l00767"></a>00767 <span class="keywordtype">int</span> hidden_nodes_count, hidden_edges_count;
  249. <a name="l00768"></a>00768
  250. <a name="l00769"></a>00769 <span class="comment">//================================================== Node/edge numbering</span>
  251. <a name="l00770"></a>00770
  252. <a name="l00771"></a>00771 <span class="keywordtype">int</span> new_node_id();
  253. <a name="l00772"></a>00772 <span class="keywordtype">int</span> new_edge_id();
  254. <a name="l00773"></a>00773
  255. <a name="l00774"></a>00774 <span class="comment">//================================================== Copy </span>
  256. <a name="l00775"></a>00775
  257. <a name="l00776"></a>00776 <span class="keywordtype">void</span> copy (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G,
  258. <a name="l00777"></a>00777 list&lt;node&gt;::const_iterator it,
  259. <a name="l00778"></a>00778 list&lt;node&gt;::const_iterator end);
  260. <a name="l00779"></a>00779
  261. <a name="l00780"></a>00780 <span class="keyword">public</span>: <span class="comment">// needs to be public, because template friends are not possible</span>
  262. <a name="l00784"></a>00784 <span class="comment"></span> <span class="keywordtype">int</span> number_of_ids(<a class="code" href="a00020.html" title="A node in a graph.">node</a>) <span class="keyword">const</span>;
  263. <a name="l00785"></a>00785
  264. <a name="l00789"></a>00789 <span class="keywordtype">int</span> number_of_ids(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a>) <span class="keyword">const</span>;
  265. <a name="l00790"></a>00790
  266. <a name="l00791"></a>00791 <span class="keyword">private</span>:
  267. <a name="l00792"></a>00792 list&lt;int&gt; free_node_ids;
  268. <a name="l00793"></a>00793 list&lt;int&gt; free_edge_ids;
  269. <a name="l00794"></a>00794 <span class="keywordtype">int</span> free_node_ids_count, free_edge_ids_count;
  270. <a name="l00795"></a>00795
  271. <a name="l00796"></a>00796 <span class="comment">//================================================== utilities</span>
  272. <a name="l00797"></a>00797
  273. <a name="l00798"></a>00798 <span class="keywordtype">void</span> del_list(list&lt;node&gt; &amp;);
  274. <a name="l00799"></a>00799 <span class="keywordtype">void</span> del_list(list&lt;edge&gt; &amp;);
  275. <a name="l00800"></a>00800
  276. <a name="l00801"></a>00801 GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt; (ostream&amp; os, <span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
  277. <a name="l00802"></a>00802 };
  278. <a name="l00803"></a>00803
  279. <a name="l00804"></a>00804 __GTL_END_NAMESPACE
  280. <a name="l00805"></a>00805
  281. <a name="l00806"></a>00806 <span class="comment">//--------------------------------------------------------------------------</span>
  282. <a name="l00807"></a>00807 <span class="comment">// Iteration</span>
  283. <a name="l00808"></a>00808 <span class="comment">//--------------------------------------------------------------------------</span>
  284. <a name="l00809"></a>00809
  285. <a name="l00810"></a>00810 <span class="preprocessor">#define forall_nodes(v,g) GTL_FORALL(v,g,graph::node_iterator,nodes_)</span>
  286. <a name="l00811"></a>00811 <span class="preprocessor"></span><span class="preprocessor">#define forall_edges(v,g) GTL_FORALL(v,g,graph::edge_iterator,edges_)</span>
  287. <a name="l00812"></a>00812 <span class="preprocessor"></span>
  288. <a name="l00813"></a>00813 <span class="preprocessor">#endif // GTL_GRAPH_H</span>
  289. <a name="l00814"></a>00814 <span class="preprocessor"></span>
  290. <a name="l00815"></a>00815 <span class="comment">//--------------------------------------------------------------------------</span>
  291. <a name="l00816"></a>00816 <span class="comment">// end of file</span>
  292. <a name="l00817"></a>00817 <span class="comment">//--------------------------------------------------------------------------</span>
  293. </pre></div> <p class="links">
  294. <a href="http://www.uni-passau.de/">University of Passau</a>
  295. &nbsp;-&nbsp;
  296. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  297. &nbsp;-&nbsp;
  298. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  299. Computer Science</a>
  300. </p>
  301. <div class="copyright">
  302. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  303. </div>
  304. </body>
  305. </html>