COIN-OR::LEMON - Graph Library

source: lemon-0.x/doc-docbook/src/xml/search_iterator.xml @ 239:3f76d1aa9d37

Last change on this file since 239:3f76d1aa9d37 was 154:eb8dcb4ab78d, checked in by marci, 21 years ago

* empty log message *

File size: 6.9 KB
RevLine 
[151]1<etik:class>
2 <etik:name>
[154]3  BfsIterator4<![CDATA[<]]>typename Graph, typename OutEdgeIt,
4            typename ReachedMap<![CDATA[>]]>
[151]5 </etik:name>
6
7 <etik:description>
[154]8The class IteratorBfs4 <![CDATA[<]]>typename Graph, typename OutEdgeIt,
9            typename ReachedMap<![CDATA[>]]> implements an edge iterator which iterates on the edges of a directed or undirected graph in a breadth first search order. As a bare iterator, it stores the actual edge, the bfs queue and the map of reached nodes. The usual interpretation of bfs consists of computing auxiliary quantities i.e. distance from root or tree of edges on which the reachable nodes were reached. This iterator approach entrusts such functionalities to the user, they have to be implemented out of the class.
[151]10 Ez itt egy tobbsoros, tobb reszes leiras arrol, hogy altalanossagban
11 mire is jo ez az osztaly.  Ez itt egy tobbsoros, tobb reszes leiras
12 arrol, hogy altalanossagban mire is jo ez az osztaly.
13<para>
14 Ez itt az uj bekezdese a leirasnak, mert elofordulhat, hogy tobb
15 bekezdesre erdemes tagolni az iromanyt.
16</para>
17 </etik:description>
18
19 <etik:example>
20  Gyakran hasznos egy peldan bemutatni a mukodest. A kovetkezo egy
21  egyszeru kis szemleltetes arra, hogy ezt milyen konnyen es gyorsan
22  lehet hasznalni:
23<programlisting>
24
25struct eqstr
26{
27  bool operator()(const char* s1, const char* s2) const
28  {
29    return strcmp(s1, s2) == 0;
30  }
31};
32
33void lookup(const map_type& Map, const char* str)
34{
35
36}
37
38</programlisting>
39
40Vigyázat, a programlisting mód parsolt, és minden <![CDATA[<]]>-t értelmez!
41
42<etik:code>
[153]43<![CDATA[
[151]44  int _i=1;
45  int _ii=1;
46  ListGraph::EdgeMap<int> my_edge_property(G);
47  for(EachEdgeIt i=G.first<EachEdgeIt>(); i.valid(); ++i) {
48    my_edge_property.set(i, _i);
49    _i*=_ii; ++_ii;
50  }
[153]51]]>
[151]52</etik:code>
53</etik:example>
54
55 <etik:definition>
[154]56Defined in bfs_iterator.hh.
[151]57Ez a definition szekcio arra van, hogy beleirjuk, hogy milyen fajlban
58van definialva az aktualis osztaly.
59Ez <xref linkend="tutorial"/> egy link a tutorialra.
60 </etik:definition>
61
62<etik:template_params>
63<etik:template_param>
64<etik:templ_name>
[154]65Graph
[151]66</etik:templ_name>
67<etik:templ_description>
[154]68Graph is a graph type which have to satisfy some concept requirements defined at a later date.
[151]69</etik:templ_description>
70<etik:templ_requirement>
[154]71Mittomen
[151]72Legyen implementalva neki az osszehasonlito operator.
73</etik:templ_requirement>
74<etik:templ_default>
75Az nincs
76</etik:templ_default>
77</etik:template_param>
78<etik:template_param>
79<etik:templ_name>
[154]80OutEdgeIt
[151]81</etik:templ_name>
82<etik:templ_description>
[154]83OutEdgeIt is an edge iterator type.
84The bfs iterator iterates on the edges.
[151]85Az Af template parameter is egy olyan vacak, ami a generikussaghoz kell.
86</etik:templ_description>
87<etik:templ_requirement>
88Af szarmazzon az elemi osztalyokbol.
89</etik:templ_requirement>
90<etik:templ_default>
910
92</etik:templ_default>
93</etik:template_param>
[154]94<etik:template_param>
95<etik:templ_name>
96ReachedMap
97</etik:templ_name>
98<etik:templ_description>
99ReachedMap is a map type which stores a bool for each node, and will ne used to maintain the set of reached nodes.
100Az Af template parameter is egy olyan vacak, ami a generikussaghoz kell.
101</etik:templ_description>
102<etik:templ_requirement>
103Readable and Writable nodemap.
104Af szarmazzon az elemi osztalyokbol.
105</etik:templ_requirement>
106<etik:templ_default>
1070
108</etik:templ_default>
109</etik:template_param>
[151]110</etik:template_params>
111
112
113<etik:members>
[154]114
[151]115<etik:member>
116<etik:m_name>
[154]117BfsIterator4(const Graph& _G, ReachedMap& _reached)
118</etik:m_name>
119<etik:m_where_def>
120
121</etik:m_where_def>
122<etik:m_description>
123Creates a bfs iterator with empty queue. The reached nodes will be stores in
124the map for that _reached refers. Initially, _reached have to be an everywhere
125false map. Other cases also can be specified, but due to the difficulty, I have no stomach to deal with it.
126</etik:m_description>
127
128</etik:member>
129
130<etik:member>
131<etik:m_name>
132BfsIterator4(const Graph& _G)
133</etik:m_name>
134<etik:m_where_def>
135-
136</etik:m_where_def>
137<etik:m_description>
138The same as above, but an own map is constructed to store the reached nodes (and is destroyed at the and).
139</etik:m_description>
140
141</etik:member>
142
143<etik:member>
144<etik:m_name>
145void pushAndSetReached(NodeIt s)
146</etik:m_name>
147<etik:m_where_def>
148
149</etik:m_where_def>
150<etik:m_description>
151Inserts s in the bfs queue and marks it reached.
152</etik:m_description>
153
154</etik:member>
155
156<etik:member>
157<etik:m_name>
158BfsIterator4<![CDATA[<]]>Graph, OutEdgeIt, ReachedMap<![CDATA[>]]>& operator++()
[151]159</etik:m_name>
160<etik:m_where_def>
161container
162</etik:m_where_def>
163<etik:m_description>
[154]164Executes one step on the bfs iterator.
[151]165</etik:m_description>
166
167</etik:member>
[154]168
[151]169<etik:member>
170<etik:m_name>
[154]171bool finished() const
[151]172</etik:m_name>
173<etik:m_where_def>
[154]174container
[151]175</etik:m_where_def>
176<etik:m_description>
[154]177Returns true if and only if the iteration is finished.
[151]178</etik:m_description>
179
180</etik:member>
[154]181
182<etik:member>
183<etik:m_name>
184operator OutEdgeIt () const
185</etik:m_name>
186<etik:m_where_def>
187container
188</etik:m_where_def>
189<etik:m_description>
190This conversion operator returns the actual value of the bfs iterator.
191</etik:m_description>
192
193</etik:member>
194
195<etik:member>
196<etik:m_name>
197bool isBNodeNewlyReached() const
198</etik:m_name>
199<etik:m_where_def>
200container
201</etik:m_where_def>
202<etik:m_description>
203Precondition: OutEdgeIt() returns a valid iterator.
204Returns true if and only if bNode of OutEdgeIt() is reached at the last
205iteration step.
206</etik:m_description>
207
208</etik:member>
209
210<etik:member>
211<etik:m_name>
212bool isANodeExamined() const
213</etik:m_name>
214<etik:m_where_def>
215container
216</etik:m_where_def>
217<etik:m_description>
218Returns true if and only if the actual node bacomes examined.
219</etik:m_description>
220
221</etik:member>
222
223<etik:member>
224<etik:m_name>
225NodeIt aNode() const
226</etik:m_name>
227<etik:m_where_def>
228container
229</etik:m_where_def>
230<etik:m_description>
231Returns the actual node.
232</etik:m_description>
233
234</etik:member>
235
236<etik:member>
237<etik:m_name>
238NodeIt bNode() const
239</etik:m_name>
240<etik:m_where_def>
241container
242</etik:m_where_def>
243<etik:m_description>
244Precondition: OutEdgeIt() returns a valid iterator.
245Returns bNode of the actual edge..
246</etik:m_description>
247
248</etik:member>
249
250<etik:member>
251<etik:m_name>
252const ReachedMap& getReachedMap() const
253</etik:m_name>
254<etik:m_where_def>
255container
256</etik:m_where_def>
257<etik:m_description>
258Const reference to the reached map.
259</etik:m_description>
260
261</etik:member>
262
263<etik:member>
264<etik:m_name>
265const std::queue<![CDATA[<]]>NodeIt<![CDATA[>]]>& getBfsQueue() const
266</etik:m_name>
267<etik:m_where_def>
268container
269</etik:m_where_def>
270<etik:m_description>
271Const reference to the bfs queue.
272</etik:m_description>
273
274</etik:member>
275
276
[151]277</etik:members>
278
279
280
281
282</etik:class>
283
284
285<!-- Keep this comment at the end of the file
286Local variables:
287mode: xml
288sgml-omittag:nil
289sgml-shorttag:nil
290sgml-namecase-general:nil
291sgml-general-insert-case:lower
292sgml-minimize-attributes:nil
293sgml-always-quote-attributes:t
294sgml-indent-step:2
295sgml-indent-data:nil
296sgml-parent-document:("graph-classes.xml" "sect1" "etik:class")
297sgml-exposed-tags:nil
298sgml-local-catalogs:nil
299sgml-local-ecat-files:nil
300End:
301-->
Note: See TracBrowser for help on using the repository browser.