a00095.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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: pq_node.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>pq_node.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">// pq_node.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: pq_node.h,v 1.15 2003/04/03 11:48:26 raitner Exp $</span>
  33. <a name="l00007"></a>00007
  34. <a name="l00008"></a>00008 <span class="preprocessor">#ifndef PQ_NODE_H</span>
  35. <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define PQ_NODE_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/symlist.h&gt;</span>
  39. <a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/graph.h&gt;</span>
  40. <a name="l00014"></a>00014
  41. <a name="l00015"></a>00015 <span class="preprocessor">#include &lt;list&gt;</span>
  42. <a name="l00016"></a>00016 <span class="preprocessor">#include &lt;iostream&gt;</span>
  43. <a name="l00017"></a>00017
  44. <a name="l00018"></a>00018 __GTL_BEGIN_NAMESPACE
  45. <a name="l00019"></a>00019
  46. <a name="l00020"></a>00020 <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  47. <a name="l00021"></a>00021 <span class="keyword">class </span>p_node;
  48. <a name="l00022"></a>00022 <span class="keyword">class </span>q_node;
  49. <a name="l00023"></a>00023 <span class="keyword">class </span>pq_leaf;
  50. <a name="l00024"></a>00024 <span class="keyword">class </span>direction_indicator;
  51. <a name="l00025"></a>00025
  52. <a name="l00029"></a>00029 <span class="keyword">class </span>GTL_EXTERN pq_node
  53. <a name="l00030"></a>00030 {
  54. <a name="l00031"></a>00031 <span class="keyword">protected</span>:
  55. <a name="l00035"></a>00035 <span class="keyword">typedef</span> <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;pq_node*&gt;::iterator</a> iterator;
  56. <a name="l00036"></a>00036
  57. <a name="l00040"></a>00040 <span class="keyword">enum</span> PQ_KIND {P_NODE, Q_NODE, LEAF, DIR};
  58. <a name="l00041"></a>00041
  59. <a name="l00045"></a>00045 <span class="keyword">enum</span> PQ_MARK {UNMARKED, QUEUED, BLOCKED, UNBLOCKED};
  60. <a name="l00046"></a>00046
  61. <a name="l00050"></a>00050 pq_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n_, <span class="keywordtype">int</span> id_) : pert_children(0),
  62. <a name="l00051"></a>00051 pert_leaves(0),
  63. <a name="l00052"></a>00052 mark (UNMARKED),
  64. <a name="l00053"></a>00053 n (n_),
  65. <a name="l00054"></a>00054 id (id_)
  66. <a name="l00055"></a>00055 {
  67. <a name="l00056"></a>00056 }
  68. <a name="l00057"></a>00057
  69. <a name="l00061"></a>00061 <span class="keyword">virtual</span> ~pq_node ();
  70. <a name="l00062"></a>00062
  71. <a name="l00067"></a>00067 <span class="keyword">virtual</span> PQ_KIND kind() <span class="keyword">const</span> = 0;
  72. <a name="l00068"></a>00068
  73. <a name="l00073"></a>00073 <span class="keyword">virtual</span> <span class="keywordtype">void</span> partial(iterator)
  74. <a name="l00074"></a>00074 {
  75. <a name="l00075"></a>00075 }
  76. <a name="l00076"></a>00076
  77. <a name="l00081"></a>00081 <span class="keyword">virtual</span> <span class="keywordtype">void</span> full(iterator)
  78. <a name="l00082"></a>00082 {
  79. <a name="l00083"></a>00083 }
  80. <a name="l00084"></a>00084
  81. <a name="l00089"></a>00089 <span class="keyword">virtual</span> <span class="keywordtype">void</span> write(ostream&amp;, <span class="keywordtype">int</span>) = 0;
  82. <a name="l00090"></a>00090
  83. <a name="l00095"></a>00095 <span class="keyword">virtual</span> <span class="keywordtype">void</span> clear()
  84. <a name="l00096"></a>00096 {
  85. <a name="l00097"></a>00097 mark = UNMARKED;
  86. <a name="l00098"></a>00098 pert_leaves = 0;
  87. <a name="l00099"></a>00099 pert_children = 0;
  88. <a name="l00100"></a>00100 }
  89. <a name="l00101"></a>00101
  90. <a name="l00102"></a>00102 <span class="comment">// type-casts </span>
  91. <a name="l00103"></a>00103
  92. <a name="l00108"></a>00108 <span class="keyword">virtual</span> p_node* P() = 0;
  93. <a name="l00109"></a>00109
  94. <a name="l00114"></a>00114 <span class="keyword">virtual</span> q_node* Q() = 0;
  95. <a name="l00115"></a>00115
  96. <a name="l00120"></a>00120 <span class="keyword">virtual</span> direction_indicator* D() = 0;
  97. <a name="l00121"></a>00121
  98. <a name="l00126"></a>00126 <span class="keyword">virtual</span> pq_leaf* L() = 0;
  99. <a name="l00127"></a>00127
  100. <a name="l00128"></a>00128 <span class="comment">//</span>
  101. <a name="l00129"></a>00129 <span class="comment">// Data used in reductions</span>
  102. <a name="l00130"></a>00130 <span class="comment">//</span>
  103. <a name="l00131"></a>00131
  104. <a name="l00139"></a>00139 <span class="keywordtype">int</span> pert_children;
  105. <a name="l00140"></a>00140
  106. <a name="l00147"></a>00147 <span class="keywordtype">int</span> pert_leaves;
  107. <a name="l00148"></a>00148
  108. <a name="l00157"></a>00157 <span class="keywordtype">bool</span> is_endmost;
  109. <a name="l00158"></a>00158
  110. <a name="l00165"></a>00165 pq_node* father;
  111. <a name="l00166"></a>00166
  112. <a name="l00179"></a>00179 PQ_MARK mark;
  113. <a name="l00180"></a>00180
  114. <a name="l00185"></a>00185 <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;pq_node*&gt;</a> sons;
  115. <a name="l00186"></a>00186
  116. <a name="l00191"></a>00191 iterator pos;
  117. <a name="l00192"></a>00192
  118. <a name="l00201"></a>00201 list&lt;pq_node*&gt;::iterator lpos;
  119. <a name="l00202"></a>00202
  120. <a name="l00203"></a>00203 <span class="comment">//</span>
  121. <a name="l00204"></a>00204 <span class="comment">// Application specific data (should become template parameter)</span>
  122. <a name="l00205"></a>00205 <span class="comment">//</span>
  123. <a name="l00206"></a>00206
  124. <a name="l00211"></a>00211 <a class="code" href="a00020.html" title="A node in a graph.">node</a> n;
  125. <a name="l00212"></a>00212
  126. <a name="l00216"></a>00216 <span class="keywordtype">int</span> id;
  127. <a name="l00217"></a>00217
  128. <a name="l00221"></a>00221 <a class="code" href="a00020.html" title="A node in a graph.">node</a> up;
  129. <a name="l00222"></a>00222
  130. <a name="l00226"></a>00226 <span class="keywordtype">int</span> up_id;
  131. <a name="l00227"></a>00227
  132. <a name="l00228"></a>00228 <span class="comment">//</span>
  133. <a name="l00229"></a>00229 <span class="comment">// Friends</span>
  134. <a name="l00230"></a>00230 <span class="comment">//</span>
  135. <a name="l00231"></a>00231
  136. <a name="l00236"></a>00236 <span class="keyword">friend</span> <span class="keyword">class </span>q_node;
  137. <a name="l00237"></a>00237
  138. <a name="l00242"></a>00242 <span class="keyword">friend</span> <span class="keyword">class </span>p_node;
  139. <a name="l00243"></a>00243
  140. <a name="l00248"></a>00248 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  141. <a name="l00249"></a>00249
  142. <a name="l00254"></a>00254 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
  143. <a name="l00255"></a>00255
  144. <a name="l00260"></a>00260 GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt;(ostream&amp;, <span class="keyword">const</span> <a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>&amp;);
  145. <a name="l00261"></a>00261 };
  146. <a name="l00262"></a>00262
  147. <a name="l00263"></a>00263
  148. <a name="l00267"></a>00267 <span class="keyword">class </span>GTL_EXTERN p_node : <span class="keyword">public</span> pq_node
  149. <a name="l00268"></a>00268 {
  150. <a name="l00269"></a>00269 <span class="keyword">private</span>:
  151. <a name="l00273"></a>00273 p_node(<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <span class="keywordtype">int</span>);
  152. <a name="l00274"></a>00274
  153. <a name="l00278"></a>00278 p_node(<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <span class="keywordtype">int</span>, <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;pq_node*&gt;</a>&amp;);
  154. <a name="l00279"></a>00279
  155. <a name="l00280"></a>00280 <span class="comment">//</span>
  156. <a name="l00281"></a>00281 <span class="comment">// pq_node interface</span>
  157. <a name="l00282"></a>00282 <span class="comment">// </span>
  158. <a name="l00283"></a>00283
  159. <a name="l00287"></a>00287 <span class="keywordtype">void</span> partial(iterator);
  160. <a name="l00288"></a>00288
  161. <a name="l00292"></a>00292 <span class="keywordtype">void</span> full(iterator);
  162. <a name="l00293"></a>00293
  163. <a name="l00298"></a>00298 PQ_KIND kind ()<span class="keyword"> const </span>
  164. <a name="l00299"></a>00299 <span class="keyword"> </span>{
  165. <a name="l00300"></a>00300 <span class="keywordflow">return</span> P_NODE;
  166. <a name="l00301"></a>00301 }
  167. <a name="l00302"></a>00302
  168. <a name="l00307"></a>00307 <span class="keywordtype">void</span> write (ostream&amp;, <span class="keywordtype">int</span>);
  169. <a name="l00308"></a>00308
  170. <a name="l00312"></a>00312 <span class="keywordtype">void</span> clear ();
  171. <a name="l00313"></a>00313
  172. <a name="l00314"></a>00314 <span class="comment">// type-casts</span>
  173. <a name="l00315"></a>00315
  174. <a name="l00320"></a>00320 p_node* P()
  175. <a name="l00321"></a>00321 {
  176. <a name="l00322"></a>00322 <span class="keywordflow">return</span> <span class="keyword">this</span>;
  177. <a name="l00323"></a>00323 }
  178. <a name="l00324"></a>00324
  179. <a name="l00329"></a>00329 q_node* Q()
  180. <a name="l00330"></a>00330 {
  181. <a name="l00331"></a>00331 assert(<span class="keyword">false</span>);
  182. <a name="l00332"></a>00332 <span class="keywordflow">return</span> 0;
  183. <a name="l00333"></a>00333 }
  184. <a name="l00334"></a>00334
  185. <a name="l00339"></a>00339 direction_indicator* D()
  186. <a name="l00340"></a>00340 {
  187. <a name="l00341"></a>00341 assert(<span class="keyword">false</span>);
  188. <a name="l00342"></a>00342 <span class="keywordflow">return</span> 0;
  189. <a name="l00343"></a>00343 }
  190. <a name="l00344"></a>00344
  191. <a name="l00349"></a>00349 pq_leaf* L()
  192. <a name="l00350"></a>00350 {
  193. <a name="l00351"></a>00351 assert(<span class="keyword">false</span>);
  194. <a name="l00352"></a>00352 <span class="keywordflow">return</span> 0;
  195. <a name="l00353"></a>00353 }
  196. <a name="l00354"></a>00354
  197. <a name="l00355"></a>00355 <span class="comment">//</span>
  198. <a name="l00356"></a>00356 <span class="comment">// Additional</span>
  199. <a name="l00357"></a>00357 <span class="comment">//</span>
  200. <a name="l00358"></a>00358
  201. <a name="l00364"></a>00364 <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;pq_node*&gt;</a> full_sons;
  202. <a name="l00365"></a>00365
  203. <a name="l00371"></a>00371 <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;pq_node*&gt;</a> partial_sons;
  204. <a name="l00372"></a>00372
  205. <a name="l00377"></a>00377 <span class="keywordtype">int</span> child_count;
  206. <a name="l00378"></a>00378
  207. <a name="l00383"></a>00383 <span class="keywordtype">int</span> partial_count;
  208. <a name="l00384"></a>00384
  209. <a name="l00389"></a>00389 <span class="keywordtype">int</span> full_count;
  210. <a name="l00390"></a>00390
  211. <a name="l00391"></a>00391 <span class="comment">//</span>
  212. <a name="l00392"></a>00392 <span class="comment">// Friends </span>
  213. <a name="l00393"></a>00393 <span class="comment">//</span>
  214. <a name="l00394"></a>00394
  215. <a name="l00399"></a>00399 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
  216. <a name="l00400"></a>00400
  217. <a name="l00405"></a>00405 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  218. <a name="l00406"></a>00406
  219. <a name="l00411"></a>00411 GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt;(ostream&amp;, <span class="keyword">const</span> <a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>&amp;);
  220. <a name="l00412"></a>00412 };
  221. <a name="l00413"></a>00413
  222. <a name="l00414"></a>00414
  223. <a name="l00418"></a>00418 <span class="keyword">class </span>GTL_EXTERN q_node : <span class="keyword">public</span> pq_node
  224. <a name="l00419"></a>00419 {
  225. <a name="l00420"></a>00420 <span class="keyword">private</span>:
  226. <a name="l00424"></a>00424 q_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <span class="keywordtype">int</span>);
  227. <a name="l00425"></a>00425
  228. <a name="l00426"></a>00426 <span class="comment">//</span>
  229. <a name="l00427"></a>00427 <span class="comment">// pq_node interface</span>
  230. <a name="l00428"></a>00428 <span class="comment">// </span>
  231. <a name="l00429"></a>00429
  232. <a name="l00433"></a>00433 <span class="keywordtype">void</span> partial(iterator);
  233. <a name="l00434"></a>00434
  234. <a name="l00438"></a>00438 <span class="keywordtype">void</span> full(iterator);
  235. <a name="l00439"></a>00439
  236. <a name="l00444"></a>00444 PQ_KIND kind()<span class="keyword"> const</span>
  237. <a name="l00445"></a>00445 <span class="keyword"> </span>{
  238. <a name="l00446"></a>00446 <span class="keywordflow">return</span> Q_NODE;
  239. <a name="l00447"></a>00447 }
  240. <a name="l00448"></a>00448
  241. <a name="l00453"></a>00453 <span class="keywordtype">void</span> write(ostream&amp;, <span class="keywordtype">int</span>);
  242. <a name="l00454"></a>00454
  243. <a name="l00458"></a>00458 <span class="keywordtype">void</span> clear();
  244. <a name="l00459"></a>00459
  245. <a name="l00460"></a>00460 <span class="comment">// type-casts</span>
  246. <a name="l00461"></a>00461
  247. <a name="l00466"></a>00466 p_node* P()
  248. <a name="l00467"></a>00467 {
  249. <a name="l00468"></a>00468 assert (<span class="keyword">false</span>);
  250. <a name="l00469"></a>00469 <span class="keywordflow">return</span> 0;
  251. <a name="l00470"></a>00470 }
  252. <a name="l00471"></a>00471
  253. <a name="l00476"></a>00476 q_node* Q()
  254. <a name="l00477"></a>00477 {
  255. <a name="l00478"></a>00478 <span class="keywordflow">return</span> <span class="keyword">this</span>;
  256. <a name="l00479"></a>00479 }
  257. <a name="l00480"></a>00480
  258. <a name="l00485"></a>00485 direction_indicator* D()
  259. <a name="l00486"></a>00486 {
  260. <a name="l00487"></a>00487 assert (<span class="keyword">false</span>);
  261. <a name="l00488"></a>00488 <span class="keywordflow">return</span> 0;
  262. <a name="l00489"></a>00489 }
  263. <a name="l00490"></a>00490
  264. <a name="l00495"></a>00495 pq_leaf* L()
  265. <a name="l00496"></a>00496 {
  266. <a name="l00497"></a>00497 assert (<span class="keyword">false</span>);
  267. <a name="l00498"></a>00498 <span class="keywordflow">return</span> 0;
  268. <a name="l00499"></a>00499 }
  269. <a name="l00500"></a>00500
  270. <a name="l00501"></a>00501 <span class="comment">//</span>
  271. <a name="l00502"></a>00502 <span class="comment">// Additional</span>
  272. <a name="l00503"></a>00503 <span class="comment">//</span>
  273. <a name="l00504"></a>00504
  274. <a name="l00510"></a>00510 <span class="keywordtype">void</span> pertinent(iterator);
  275. <a name="l00511"></a>00511
  276. <a name="l00518"></a>00518 q_node* merge (iterator);
  277. <a name="l00519"></a>00519
  278. <a name="l00524"></a>00524 <span class="keywordtype">void</span> turn ();
  279. <a name="l00525"></a>00525
  280. <a name="l00531"></a>00531 iterator pert_begin;
  281. <a name="l00532"></a>00532
  282. <a name="l00537"></a>00537 iterator pert_end;
  283. <a name="l00538"></a>00538
  284. <a name="l00545"></a>00545 iterator partial_pos[3];
  285. <a name="l00546"></a>00546
  286. <a name="l00554"></a>00554 <span class="keywordtype">bool</span> pert_cons;
  287. <a name="l00555"></a>00555
  288. <a name="l00560"></a>00560 <span class="keywordtype">int</span> partial_count;
  289. <a name="l00561"></a>00561
  290. <a name="l00566"></a>00566 <span class="keywordtype">int</span> full_count;
  291. <a name="l00567"></a>00567
  292. <a name="l00568"></a>00568 <span class="comment">//</span>
  293. <a name="l00569"></a>00569 <span class="comment">// Friends </span>
  294. <a name="l00570"></a>00570 <span class="comment">//</span>
  295. <a name="l00571"></a>00571
  296. <a name="l00576"></a>00576 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
  297. <a name="l00577"></a>00577
  298. <a name="l00582"></a>00582 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  299. <a name="l00583"></a>00583 };
  300. <a name="l00584"></a>00584
  301. <a name="l00585"></a>00585
  302. <a name="l00589"></a>00589 <span class="keyword">class </span>GTL_EXTERN pq_leaf : <span class="keyword">public</span> pq_node
  303. <a name="l00590"></a>00590 {
  304. <a name="l00591"></a>00591 <span class="keyword">public</span>:
  305. <a name="l00595"></a>00595 pq_leaf (<span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>, <a class="code" href="a00020.html" title="A node in a graph.">node</a>);
  306. <a name="l00596"></a>00596 <span class="keyword">private</span>:
  307. <a name="l00601"></a>00601 PQ_KIND kind()<span class="keyword"> const</span>
  308. <a name="l00602"></a>00602 <span class="keyword"> </span>{
  309. <a name="l00603"></a>00603 <span class="keywordflow">return</span> LEAF;
  310. <a name="l00604"></a>00604 }
  311. <a name="l00605"></a>00605
  312. <a name="l00610"></a>00610 <span class="keywordtype">void</span> write (ostream&amp;, <span class="keywordtype">int</span>);
  313. <a name="l00611"></a>00611
  314. <a name="l00612"></a>00612 <span class="comment">// type-casts</span>
  315. <a name="l00613"></a>00613
  316. <a name="l00618"></a>00618 p_node* P()
  317. <a name="l00619"></a>00619 {
  318. <a name="l00620"></a>00620 assert(<span class="keyword">false</span>);
  319. <a name="l00621"></a>00621 <span class="keywordflow">return</span> 0;
  320. <a name="l00622"></a>00622 }
  321. <a name="l00623"></a>00623
  322. <a name="l00628"></a>00628 q_node* Q()
  323. <a name="l00629"></a>00629 {
  324. <a name="l00630"></a>00630 assert(<span class="keyword">false</span>);
  325. <a name="l00631"></a>00631 <span class="keywordflow">return</span> 0;
  326. <a name="l00632"></a>00632 }
  327. <a name="l00633"></a>00633
  328. <a name="l00638"></a>00638 direction_indicator* D()
  329. <a name="l00639"></a>00639 {
  330. <a name="l00640"></a>00640 assert(<span class="keyword">false</span>);
  331. <a name="l00641"></a>00641 <span class="keywordflow">return</span> 0;
  332. <a name="l00642"></a>00642 }
  333. <a name="l00643"></a>00643
  334. <a name="l00648"></a>00648 pq_leaf* L()
  335. <a name="l00649"></a>00649 {
  336. <a name="l00650"></a>00650 <span class="keywordflow">return</span> <span class="keyword">this</span>;
  337. <a name="l00651"></a>00651 }
  338. <a name="l00652"></a>00652
  339. <a name="l00653"></a>00653 <span class="comment">//</span>
  340. <a name="l00654"></a>00654 <span class="comment">// Additional</span>
  341. <a name="l00655"></a>00655 <span class="comment">//</span>
  342. <a name="l00656"></a>00656
  343. <a name="l00660"></a>00660 <span class="keywordtype">int</span> other_id;
  344. <a name="l00661"></a>00661
  345. <a name="l00665"></a>00665 <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e;
  346. <a name="l00666"></a>00666
  347. <a name="l00667"></a>00667 <span class="comment">//</span>
  348. <a name="l00668"></a>00668 <span class="comment">// Friends </span>
  349. <a name="l00669"></a>00669 <span class="comment">//</span>
  350. <a name="l00670"></a>00670
  351. <a name="l00675"></a>00675 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
  352. <a name="l00676"></a>00676
  353. <a name="l00681"></a>00681 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  354. <a name="l00682"></a>00682 };
  355. <a name="l00683"></a>00683
  356. <a name="l00684"></a>00684
  357. <a name="l00688"></a>00688 <span class="keyword">class </span>GTL_EXTERN direction_indicator : <span class="keyword">public</span> pq_node
  358. <a name="l00689"></a>00689 {
  359. <a name="l00690"></a>00690 <span class="keyword">private</span>:
  360. <a name="l00694"></a>00694 direction_indicator (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n_, <span class="keywordtype">int</span> id_) : pq_node (n_, id_) { };
  361. <a name="l00695"></a>00695
  362. <a name="l00696"></a>00696 <span class="comment">//</span>
  363. <a name="l00697"></a>00697 <span class="comment">// pq_node interface</span>
  364. <a name="l00698"></a>00698 <span class="comment">// </span>
  365. <a name="l00699"></a>00699
  366. <a name="l00704"></a>00704 PQ_KIND kind()<span class="keyword"> const</span>
  367. <a name="l00705"></a>00705 <span class="keyword"> </span>{
  368. <a name="l00706"></a>00706 <span class="keywordflow">return</span> DIR;
  369. <a name="l00707"></a>00707 }
  370. <a name="l00708"></a>00708
  371. <a name="l00713"></a>00713 <span class="keywordtype">void</span> write (ostream&amp; os, <span class="keywordtype">int</span>);
  372. <a name="l00714"></a>00714
  373. <a name="l00715"></a>00715 <span class="comment">// type-casts </span>
  374. <a name="l00716"></a>00716
  375. <a name="l00721"></a>00721 p_node* P()
  376. <a name="l00722"></a>00722 {
  377. <a name="l00723"></a>00723 assert(<span class="keyword">false</span>);
  378. <a name="l00724"></a>00724 <span class="keywordflow">return</span> 0;
  379. <a name="l00725"></a>00725 }
  380. <a name="l00726"></a>00726
  381. <a name="l00731"></a>00731 q_node* Q()
  382. <a name="l00732"></a>00732 {
  383. <a name="l00733"></a>00733 assert(<span class="keyword">false</span>);
  384. <a name="l00734"></a>00734 <span class="keywordflow">return</span> 0;
  385. <a name="l00735"></a>00735 }
  386. <a name="l00736"></a>00736
  387. <a name="l00741"></a>00741 direction_indicator* D()
  388. <a name="l00742"></a>00742 {
  389. <a name="l00743"></a>00743 <span class="keywordflow">return</span> <span class="keyword">this</span>;
  390. <a name="l00744"></a>00744 }
  391. <a name="l00745"></a>00745
  392. <a name="l00750"></a>00750 pq_leaf* L()
  393. <a name="l00751"></a>00751 {
  394. <a name="l00752"></a>00752 assert(<span class="keyword">false</span>);
  395. <a name="l00753"></a>00753 <span class="keywordflow">return</span> 0;
  396. <a name="l00754"></a>00754 }
  397. <a name="l00755"></a>00755
  398. <a name="l00756"></a>00756 <span class="comment">//</span>
  399. <a name="l00757"></a>00757 <span class="comment">// Additional</span>
  400. <a name="l00758"></a>00758 <span class="comment">//</span>
  401. <a name="l00759"></a>00759
  402. <a name="l00763"></a>00763 <span class="keywordtype">bool</span> direction;
  403. <a name="l00764"></a>00764
  404. <a name="l00765"></a>00765 <span class="comment">//</span>
  405. <a name="l00766"></a>00766 <span class="comment">// Friends </span>
  406. <a name="l00767"></a>00767 <span class="comment">//</span>
  407. <a name="l00768"></a>00768
  408. <a name="l00773"></a>00773 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00023.html" title="Tests if a graph can be drawn on a plane without any edge crossings.">planarity</a>;
  409. <a name="l00774"></a>00774
  410. <a name="l00779"></a>00779 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  411. <a name="l00780"></a>00780 };
  412. <a name="l00781"></a>00781
  413. <a name="l00782"></a>00782 __GTL_END_NAMESPACE
  414. <a name="l00783"></a>00783
  415. <a name="l00784"></a>00784 <span class="preprocessor">#endif</span>
  416. <a name="l00785"></a>00785 <span class="preprocessor"></span>
  417. <a name="l00786"></a>00786 <span class="comment">//--------------------------------------------------------------------------</span>
  418. <a name="l00787"></a>00787 <span class="comment">// end of file</span>
  419. <a name="l00788"></a>00788 <span class="comment">//--------------------------------------------------------------------------</span>
  420. </pre></div> <p class="links">
  421. <a href="http://www.uni-passau.de/">University of Passau</a>
  422. &nbsp;-&nbsp;
  423. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  424. &nbsp;-&nbsp;
  425. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  426. Computer Science</a>
  427. </p>
  428. <div class="copyright">
  429. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  430. </div>
  431. </body>
  432. </html>