a00080.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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: embedding.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>embedding.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">// embedding.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: embedding.h,v 1.20 2003/06/11 11:28:21 raitner Exp $</span>
  33. <a name="l00007"></a>00007
  34. <a name="l00008"></a>00008 <span class="preprocessor">#ifndef __EMBEDDING__H</span>
  35. <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define __EMBEDDING__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/graph.h&gt;</span>
  39. <a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/st_number.h&gt;</span>
  40. <a name="l00014"></a>00014 <span class="preprocessor">#include &lt;GTL/symlist.h&gt;</span>
  41. <a name="l00015"></a>00015
  42. <a name="l00016"></a>00016 __GTL_BEGIN_NAMESPACE
  43. <a name="l00017"></a>00017
  44. <a name="l00028"></a><a class="code" href="a00022.html">00028</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>
  45. <a name="l00029"></a>00029 {
  46. <a name="l00030"></a>00030 <span class="keyword">public</span>:
  47. <a name="l00034"></a>00034 <span class="keyword">typedef</span> <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;edge&gt;</a> <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>;
  48. <a name="l00035"></a>00035
  49. <a name="l00039"></a>00039 <span class="keyword">typedef</span> <a class="code" href="a00027.html" title="List which can be reversed in .">symlist&lt;edge&gt;::iterator</a> iterator;
  50. <a name="l00040"></a>00040 <span class="keyword">private</span>:
  51. <a name="l00047"></a>00047 <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>() : G(0)
  52. <a name="l00048"></a>00048 {
  53. <a name="l00049"></a>00049 }
  54. <a name="l00050"></a>00050 <span class="keyword">public</span>:
  55. <a name="l00057"></a>00057 <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>(<span class="keyword">const</span> <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; em);
  56. <a name="l00058"></a>00058
  57. <a name="l00063"></a><a class="code" href="a00022.html#e5605eb5f21346f3f8194dd2db9de117">00063</a> <span class="keyword">virtual</span> ~<a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>()
  58. <a name="l00064"></a>00064 {
  59. <a name="l00065"></a>00065 }
  60. <a name="l00066"></a>00066
  61. <a name="l00076"></a>00076 <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp; em);
  62. <a name="l00077"></a>00077 <span class="keyword">private</span>:
  63. <a name="l00084"></a>00084 <span class="keywordtype">void</span> init(<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
  64. <a name="l00085"></a>00085
  65. <a name="l00092"></a>00092 <span class="keywordtype">void</span> turn(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
  66. <a name="l00093"></a>00093
  67. <a name="l00103"></a>00103 iterator push_back(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  68. <a name="l00104"></a>00104
  69. <a name="l00114"></a>00114 iterator push_front(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  70. <a name="l00115"></a>00115
  71. <a name="l00122"></a>00122 <span class="keywordtype">void</span> insert_selfloop (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  72. <a name="l00123"></a>00123
  73. <a name="l00133"></a>00133 iterator&amp; pos (<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>);
  74. <a name="l00134"></a>00134 <span class="keyword">public</span>:
  75. <a name="l00143"></a><a class="code" href="a00022.html#151a1e7cf6cfbbd0a09c467ec8bc61d1">00143</a> <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>&amp; adjacency(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
  76. <a name="l00144"></a>00144 {
  77. <a name="l00145"></a>00145 <span class="keywordflow">return</span> adj[n];
  78. <a name="l00146"></a>00146 }
  79. <a name="l00147"></a>00147
  80. <a name="l00156"></a><a class="code" href="a00022.html#cff04f2f8fdd718697ac4c92bab4aea0">00156</a> <span class="keyword">const</span> <a class="code" href="a00027.html" title="List which can be reversed in .">adj_list</a>&amp; adjacency(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)<span class="keyword"> const</span>
  81. <a name="l00157"></a>00157 <span class="keyword"> </span>{
  82. <a name="l00158"></a>00158 <span class="keywordflow">return</span> adj[n];
  83. <a name="l00159"></a>00159 }
  84. <a name="l00160"></a>00160
  85. <a name="l00169"></a><a class="code" href="a00022.html#c0b41dd43adb80ed898b597e791230d8">00169</a> iterator adj_edges_begin(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
  86. <a name="l00170"></a>00170 {
  87. <a name="l00171"></a>00171 <span class="keywordflow">return</span> adj[n].begin();
  88. <a name="l00172"></a>00172 }
  89. <a name="l00173"></a>00173
  90. <a name="l00182"></a><a class="code" href="a00022.html#1345ee93995019d81cc78fb2806acc88">00182</a> iterator adj_edges_end(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n)
  91. <a name="l00183"></a>00183 {
  92. <a name="l00184"></a>00184 <span class="keywordflow">return</span> adj[n].end();
  93. <a name="l00185"></a>00185 }
  94. <a name="l00186"></a>00186
  95. <a name="l00197"></a>00197 <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> cyclic_next(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  96. <a name="l00198"></a>00198
  97. <a name="l00209"></a>00209 <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> cyclic_prev(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
  98. <a name="l00210"></a>00210
  99. <a name="l00211"></a>00211
  100. <a name="l00220"></a>00220 <span class="keywordtype">void</span> write_st(ostream&amp; os, <a class="code" href="a00026.html" title="ST-number algorithm.">st_number</a>&amp; st);
  101. <a name="l00221"></a>00221
  102. <a name="l00229"></a><a class="code" href="a00022.html#b04859be18352bc53a120b0676a499ba">00229</a> list&lt;edge&gt;&amp; selfloops()
  103. <a name="l00230"></a>00230 {
  104. <a name="l00231"></a>00231 <span class="keywordflow">return</span> <span class="keyword">self</span>;
  105. <a name="l00232"></a>00232 }
  106. <a name="l00233"></a>00233
  107. <a name="l00241"></a><a class="code" href="a00022.html#5bda41957054aed983245e28044f7eac">00241</a> <span class="keyword">const</span> list&lt;edge&gt;&amp; selfloops()<span class="keyword"> const</span>
  108. <a name="l00242"></a>00242 <span class="keyword"> </span>{
  109. <a name="l00243"></a>00243 <span class="keywordflow">return</span> <span class="keyword">self</span>;
  110. <a name="l00244"></a>00244 }
  111. <a name="l00245"></a>00245
  112. <a name="l00256"></a><a class="code" href="a00022.html#fb50ef8f3b5b2c6690b9d364db21f36f">00256</a> list&lt;edge&gt;&amp; multiple_edges()
  113. <a name="l00257"></a>00257 {
  114. <a name="l00258"></a>00258 <span class="keywordflow">return</span> multi;
  115. <a name="l00259"></a>00259 }
  116. <a name="l00260"></a>00260
  117. <a name="l00271"></a><a class="code" href="a00022.html#47dedbda766cf0769f98e6ae63ef3152">00271</a> <span class="keyword">const</span> list&lt;edge&gt;&amp; multiple_edges()<span class="keyword"> const</span>
  118. <a name="l00272"></a>00272 <span class="keyword"> </span>{
  119. <a name="l00273"></a>00273 <span class="keywordflow">return</span> multi;
  120. <a name="l00274"></a>00274 }
  121. <a name="l00275"></a>00275
  122. <a name="l00286"></a>00286 <span class="keywordtype">bool</span> check();
  123. <a name="l00287"></a>00287
  124. <a name="l00291"></a>00291 <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>;
  125. <a name="l00292"></a>00292
  126. <a name="l00296"></a>00296 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00024.html" title="PQ-Trees.">pq_tree</a>;
  127. <a name="l00297"></a>00297
  128. <a name="l00301"></a>00301 GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt; (ostream&amp;, <a class="code" href="a00022.html" title="Ordered adjacency lists as a result of planarity testing.">planar_embedding</a>&amp;);
  129. <a name="l00302"></a>00302 <span class="keyword">private</span>:
  130. <a name="l00307"></a>00307 <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>* G;
  131. <a name="l00308"></a>00308
  132. <a name="l00313"></a>00313 <a class="code" href="a00021.html" title="A specialized map with nodes as keys.">node_map&lt;adj_list&gt;</a> adj;
  133. <a name="l00314"></a>00314
  134. <a name="l00319"></a>00319 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;adj_list::iterator&gt;</a> s_pos;
  135. <a name="l00320"></a>00320
  136. <a name="l00325"></a>00325 <a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;adj_list::iterator&gt;</a> t_pos;
  137. <a name="l00326"></a>00326
  138. <a name="l00331"></a>00331 list&lt;edge&gt; <span class="keyword">self</span>;
  139. <a name="l00332"></a>00332
  140. <a name="l00337"></a>00337 list&lt;edge&gt; multi;
  141. <a name="l00338"></a>00338 };
  142. <a name="l00339"></a>00339
  143. <a name="l00340"></a>00340
  144. <a name="l00341"></a>00341 <span class="comment">// class face</span>
  145. <a name="l00342"></a>00342 <span class="comment">// { </span>
  146. <a name="l00343"></a>00343 <span class="comment">// public:</span>
  147. <a name="l00344"></a>00344 <span class="comment">// face (planar_embedding&amp; em, node n, edge e) : embed (em),</span>
  148. <a name="l00345"></a>00345 <span class="comment">// start (n), first (e) { }</span>
  149. <a name="l00346"></a>00346 <span class="comment">// virtual ~face () { }</span>
  150. <a name="l00347"></a>00347
  151. <a name="l00348"></a>00348 <span class="comment">// private: </span>
  152. <a name="l00349"></a>00349 <span class="comment">// planar_embedding&amp; embed;</span>
  153. <a name="l00350"></a>00350 <span class="comment">// node start;</span>
  154. <a name="l00351"></a>00351 <span class="comment">// edge first;</span>
  155. <a name="l00352"></a>00352
  156. <a name="l00353"></a>00353 <span class="comment">// friend class planar_embedding;</span>
  157. <a name="l00354"></a>00354 <span class="comment">// };</span>
  158. <a name="l00355"></a>00355
  159. <a name="l00356"></a>00356 <span class="comment">// struct _face_iterator</span>
  160. <a name="l00357"></a>00357 <span class="comment">// {</span>
  161. <a name="l00358"></a>00358
  162. <a name="l00359"></a>00359
  163. <a name="l00360"></a>00360 <span class="comment">// face&amp; _face;</span>
  164. <a name="l00361"></a>00361 <span class="comment">// };</span>
  165. <a name="l00362"></a>00362
  166. <a name="l00363"></a>00363 __GTL_END_NAMESPACE
  167. <a name="l00364"></a>00364
  168. <a name="l00365"></a>00365 <span class="preprocessor">#endif</span>
  169. <a name="l00366"></a>00366 <span class="preprocessor"></span>
  170. <a name="l00367"></a>00367 <span class="comment">//--------------------------------------------------------------------------</span>
  171. <a name="l00368"></a>00368 <span class="comment">// end of file</span>
  172. <a name="l00369"></a>00369 <span class="comment">//--------------------------------------------------------------------------</span>
  173. </pre></div> <p class="links">
  174. <a href="http://www.uni-passau.de/">University of Passau</a>
  175. &nbsp;-&nbsp;
  176. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  177. &nbsp;-&nbsp;
  178. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  179. Computer Science</a>
  180. </p>
  181. <div class="copyright">
  182. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  183. </div>
  184. </body>
  185. </html>