.
3 BfsIterator4<![CDATA[<]]>typename Graph, typename OutEdgeIt,
4 typename ReachedMap<![CDATA[>]]>
8 The 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.
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.
14 Ez itt az uj bekezdese a leirasnak, mert elofordulhat, hogy tobb
15 bekezdesre erdemes tagolni az iromanyt.
20 Gyakran hasznos egy peldan bemutatni a mukodest. A kovetkezo egy
21 egyszeru kis szemleltetes arra, hogy ezt milyen konnyen es gyorsan
27 bool operator()(const char* s1, const char* s2) const
29 return strcmp(s1, s2) == 0;
33 void lookup(const map_type& Map, const char* str)
40 Vigyázat, a programlisting mód parsolt, és minden <![CDATA[<]]>-t értelmez!
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);
56 Defined in bfs_iterator.hh.
57 Ez a definition szekcio arra van, hogy beleirjuk, hogy milyen fajlban
58 van definialva az aktualis osztaly.
59 Ez <xref linkend="tutorial"/> egy link a tutorialra.
62 <etik:template_params>
67 <etik:templ_description>
68 Graph is a graph type which have to satisfy some concept requirements defined at a later date.
69 </etik:templ_description>
70 <etik:templ_requirement>
72 Legyen implementalva neki az osszehasonlito operator.
73 </etik:templ_requirement>
77 </etik:template_param>
82 <etik:templ_description>
83 OutEdgeIt is an edge iterator type.
84 The bfs iterator iterates on the edges.
85 Az Af template parameter is egy olyan vacak, ami a generikussaghoz kell.
86 </etik:templ_description>
87 <etik:templ_requirement>
88 Af szarmazzon az elemi osztalyokbol.
89 </etik:templ_requirement>
93 </etik:template_param>
98 <etik:templ_description>
99 ReachedMap is a map type which stores a bool for each node, and will ne used to maintain the set of reached nodes.
100 Az Af template parameter is egy olyan vacak, ami a generikussaghoz kell.
101 </etik:templ_description>
102 <etik:templ_requirement>
103 Readable and Writable nodemap.
104 Af szarmazzon az elemi osztalyokbol.
105 </etik:templ_requirement>
108 </etik:templ_default>
109 </etik:template_param>
110 </etik:template_params>
117 BfsIterator4(const Graph& _G, ReachedMap& _reached)
123 Creates a bfs iterator with empty queue. The reached nodes will be stores in
124 the map for that _reached refers. Initially, _reached have to be an everywhere
125 false map. Other cases also can be specified, but due to the difficulty, I have no stomach to deal with it.
126 </etik:m_description>
132 BfsIterator4(const Graph& _G)
138 The same as above, but an own map is constructed to store the reached nodes (and is destroyed at the and).
139 </etik:m_description>
145 void pushAndSetReached(NodeIt s)
151 Inserts s in the bfs queue and marks it reached.
152 </etik:m_description>
158 BfsIterator4<![CDATA[<]]>Graph, OutEdgeIt, ReachedMap<![CDATA[>]]>& operator++()
164 Executes one step on the bfs iterator.
165 </etik:m_description>
171 bool finished() const
177 Returns true if and only if the iteration is finished.
178 </etik:m_description>
184 operator OutEdgeIt () const
190 This conversion operator returns the actual value of the bfs iterator.
191 </etik:m_description>
197 bool isBNodeNewlyReached() const
203 Precondition: OutEdgeIt() returns a valid iterator.
204 Returns true if and only if bNode of OutEdgeIt() is reached at the last
206 </etik:m_description>
212 bool isANodeExamined() const
218 Returns true if and only if the actual node bacomes examined.
219 </etik:m_description>
231 Returns the actual node.
232 </etik:m_description>
244 Precondition: OutEdgeIt() returns a valid iterator.
245 Returns bNode of the actual edge..
246 </etik:m_description>
252 const ReachedMap& getReachedMap() const
258 Const reference to the reached map.
259 </etik:m_description>
265 const std::queue<![CDATA[<]]>NodeIt<![CDATA[>]]>& getBfsQueue() const
271 Const reference to the bfs queue.
272 </etik:m_description>
285 <!-- Keep this comment at the end of the file
290 sgml-namecase-general:nil
291 sgml-general-insert-case:lower
292 sgml-minimize-attributes:nil
293 sgml-always-quote-attributes:t
296 sgml-parent-document:("graph-classes.xml" "sect1" "etik:class")
297 sgml-exposed-tags:nil
298 sgml-local-catalogs:nil
299 sgml-local-ecat-files:nil