Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
TriStrip_graph_array.h
Go to the documentation of this file.
1 // graph_array.h: interface for the graph_array class.
2 //
4 //
5 // Copyright (C) 2002 Tanguy Fautré.
6 //
7 // This software is provided 'as-is', without any express or implied
8 // warranty. In no event will the authors be held liable for any damages
9 // arising from the use of this software.
10 //
11 // Permission is granted to anyone to use this software for any purpose,
12 // including commercial applications, and to alter it and redistribute it
13 // freely, subject to the following restrictions:
14 //
15 // 1. The origin of this software must not be misrepresented; you must not
16 // claim that you wrote the original software. If you use this software
17 // in a product, an acknowledgment in the product documentation would be
18 // appreciated but is not required.
19 // 2. Altered source versions must be plainly marked as such, and must not be
20 // misrepresented as being the original software.
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
23 // Tanguy Fautré// softdev@pandora.be // ////////////////////////////////////////////////////////////////////// // // Semi-dynamic directed graph // *************************** // // Current version: 3.00 BETA 3 (04/12/2002) // // Comment: graph_array is equivalent to an array of nodes linked by // arcs. // This means you can't change the size (the number of nodes) // of the graph once you created it (setsize() will delete // any previous nodes and arcs). // But you can add or remove arcs. // // History: - 3.00 BETA 3 (04/12/2002) - Added empty() // - Changed some parameters from copy to reference // - Fixed a bug with erase_arc // - Un-inlined external functions // - Added "insert_arc" which is equivalent to "insert" // - 3.00 BETA 2 (16/11/2002) - Improved portability // - 3.00 BETA 1 (27/08/2002) - First public release // ////////////////////////////////////////////////////////////////////// #ifndef TRISTRIP_GRAPH_ARRAY_H #define TRISTRIP_GRAPH_ARRAY_H // namespace common_structures namespace common_structures { // graph_array main class template <class nodetype, class arctype> class graph_array { public: class arc; class node; // New types typedef size_t nodeid; typedef typename std::vector<node>::iterator node_iterator; typedef typename std::vector<node>::const_iterator const_node_iterator; typedef typename std::vector<node>::reverse_iterator node_reverse_iterator; typedef typename std::vector<node>::const_reverse_iterator const_node_reverse_iterator; typedef graph_array<nodetype, arctype> _mytype; // graph_array::arc class class arc { public: arc & mark() { m_Marker = true; return (* this); } arc & unmark() { m_Marker = false; return (* this); } bool marked() const { return m_Marker; } node_iterator initial() const { return m_Initial; } node_iterator terminal() const { return m_Terminal; } arctype & operator * () { return m_Elem; } const arctype & operator * () const { return m_Elem; } protected: friend class graph_array<nodetype, arctype>; arc(const node_iterator & Initial, const node_iterator & Terminal) : m_Initial(Initial), m_Terminal(Terminal), m_Marker(false) { } arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem) : m_Initial(Initial), m_Terminal(Terminal), m_Elem(Elem), m_Marker(false) { } node_iterator m_Initial; node_iterator m_Terminal; arctype m_Elem; bool m_Marker; }; // New types typedef typename std::list<arc>::iterator out_arc_iterator; typedef typename std::list<arc>::const_iterator const_out_arc_iterator; // graph_array::node class class node { public: node & mark() { m_Marker = true; return (* this); } node & unmark() { m_Marker = false; return (* this); } bool marked() const { return m_Marker; } bool out_empty() const { return m_OutArcs.empty(); } size_t number_of_out_arcs() const { return m_OutArcs.size(); } out_arc_iterator out_begin() { return m_OutArcs.begin(); } out_arc_iterator out_end() { return m_OutArcs.end(); } const_out_arc_iterator out_begin() const { return m_OutArcs.begin(); } const_out_arc_iterator out_end() const { return m_OutArcs.end(); } nodetype & operator * () { return m_Elem; } nodetype * operator -> () { return &m_Elem; } const nodetype & operator * () const { return m_Elem; } const nodetype * operator -> () const { return &m_Elem; } nodetype & operator = (const nodetype & Elem) { return (m_Elem = Elem); } node() : m_Marker(false) { } protected: friend class graph_array<nodetype, arctype>; friend class std::vector<node>; std::list<arc> m_OutArcs; nodetype m_Elem; bool m_Marker; }; // Construction/Destruction graph_array(); explicit graph_array(const size_t NbNodes); // Node related member functions void clear(); bool empty() const; void setsize(const size_t NbNodes); size_t size() const; node & operator [] (const nodeid & i); const node & operator [] (const nodeid & i) const; node_iterator begin(); node_iterator end(); const_node_iterator begin() const; const_node_iterator end() const; node_reverse_iterator rbegin(); node_reverse_iterator rend(); const_node_reverse_iterator rbegin() const; const_node_reverse_iterator rend() const; // Arc related member functions size_t number_of_arcs() const; void erase_arcs(); void erase_arcs(const node_iterator & Initial); out_arc_iterator erase_arc(const out_arc_iterator & Pos); out_arc_iterator insert_arc(const nodeid & Initial, const nodeid & Terminal); out_arc_iterator insert_arc(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem); out_arc_iterator insert_arc(const node_iterator & Initial, const node_iterator & Terminal); out_arc_iterator insert_arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem); // Another interface for insert_arc out_arc_iterator insert(const nodeid & Initial, const nodeid & Terminal) { return insert_arc(Initial, Terminal); } out_arc_iterator insert(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem) { return insert_arc(Initial, Terminal, Elem); } out_arc_iterator insert(const node_iterator & Initial, const node_iterator & Terminal) { return insert_arc(Initial, Terminal); } out_arc_iterator insert(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem) { return insert_arc(Initial, Terminal, Elem); } // Optimized (overloaded) functions void swap(_mytype & Right); // removed since it was causing g++ 2.95.3 to produce many compile errors // presumably due to implicit import of the std::swap implementation. // Robert Osfield, Jan 2002. // friend void swap(_mytype & Left, _mytype & Right) { Left.swap(Right); } protected: size_t m_NbArcs; std::vector<node> m_Nodes; }; // Additional "low level", graph related, functions template <class nodetype, class arctype> void unmark_nodes(graph_array<nodetype, arctype> & G); template <class nodetype, class arctype> void unmark_arcs_from_node(typename graph_array<nodetype, arctype>::node & N); template <class nodetype, class arctype> void unmark_arcs(graph_array<nodetype, arctype> & G); ////////////////////////////////////////////////////////////////////////// // graph_array Inline functions ////////////////////////////////////////////////////////////////////////// template <class nodetype, class arctype> inline graph_array<nodetype, arctype>::graph_array() : m_NbArcs(0) { } template <class nodetype, class arctype> inline graph_array<nodetype, arctype>::graph_array(const size_t NbNodes) : m_NbArcs(0), m_Nodes(NbNodes) { } template <class nodetype, class arctype> inline void graph_array<nodetype, arctype>::clear() { m_NbArcs = 0; m_Nodes.clear(); } template <class nodetype, class arctype> inline bool graph_array<nodetype, arctype>::empty() const { return m_Nodes.empty(); } template <class nodetype, class arctype> inline size_t graph_array<nodetype, arctype>::size() const { return m_Nodes.size(); } template <class nodetype, class arctype> inline void graph_array<nodetype, arctype>::setsize(const size_t NbNodes) { clear(); m_Nodes.resize(NbNodes); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::node & graph_array<nodetype, arctype>::operator [] (const nodeid & i) { // Debug check // assert(i < size()); if (i >= size()) throw "graph_array<nodetype, arctype>::operator [] out of range"; return m_Nodes[i]; } template <class nodetype, class arctype> inline const typename graph_array<nodetype, arctype>::node & graph_array<nodetype, arctype>::operator [] (const nodeid & i) const { // Debug check // assert(i < size()); if (i >= size()) throw "graph_array<nodetype, arctype>::operator [] out of range"; return m_Nodes[i]; } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::node_iterator graph_array<nodetype, arctype>::begin() { return m_Nodes.begin(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::node_iterator graph_array<nodetype, arctype>::end() { return m_Nodes.end(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::const_node_iterator graph_array<nodetype, arctype>::begin() const { return m_Nodes.begin(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::const_node_iterator graph_array<nodetype, arctype>::end() const { return m_Nodes.end(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::node_reverse_iterator graph_array<nodetype, arctype>::rbegin() { return m_Nodes.rbegin(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::node_reverse_iterator graph_array<nodetype, arctype>::rend() { return m_Nodes.rend(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::const_node_reverse_iterator graph_array<nodetype, arctype>::rbegin() const { return m_Nodes.rbegin(); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::const_node_reverse_iterator graph_array<nodetype, arctype>::rend() const { return m_Nodes.rend(); } template <class nodetype, class arctype> inline size_t graph_array<nodetype, arctype>::number_of_arcs() const { return m_NbArcs; } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const nodeid & Initial, const nodeid & Terminal) { return (insert(begin() + Initial, begin() + Terminal)); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem) { return (insert(begin() + Initial, begin() + Terminal, Elem)); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const node_iterator & Initial, const node_iterator & Terminal) { ++m_NbArcs; Initial->m_OutArcs.push_back(arc(Initial, Terminal)); return (--(Initial->m_OutArcs.end())); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem) { ++m_NbArcs; Initial->m_OutArcs.push_back(arc(Initial, Terminal, Elem)); return (--(Initial->m_OutArcs.end())); } template <class nodetype, class arctype> inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::erase_arc(const out_arc_iterator & Pos) { --m_NbArcs; return (Pos->initial()->m_OutArcs.erase(Pos)); } template <class nodetype, class arctype> inline void graph_array<nodetype, arctype>::erase_arcs(const node_iterator & Initial) { m_NbArcs -= (Initial->m_OutArcs.size()); Initial->m_OutArcs.clear(); } template <class nodetype, class arctype> inline void graph_array<nodetype, arctype>::erase_arcs() { m_NbArcs = 0; for (nodeid i = 0; i < this->Size(); ++i) m_Nodes[i].m_OutArcs.clear(); } template <class nodetype, class arctype> inline void graph_array<nodetype, arctype>::swap(_mytype & Right) { std::swap(m_NbArcs, Right.m_NbArcs); std::swap(m_Nodes, Right.m_Nodes); } ////////////////////////////////////////////////////////////////////////// // additional functions ////////////////////////////////////////////////////////////////////////// template <class nodetype, class arctype> void unmark_nodes(graph_array<nodetype, arctype> & G) { typedef typename graph_array<nodetype, arctype>::node_iterator node_it; for (node_it NodeIt = G.begin(); NodeIt != G.end(); ++NodeIt) NodeIt->unmark(); } template <class nodetype, class arctype> void unmark_arcs_from_node(typename graph_array<nodetype, arctype>::node & N) { typedef typename graph_array<nodetype, arctype>::out_arc_iterator arc_it; for (arc_it ArcIt = N.out_begin(); ArcIt != N.out_end(); ++ArcIt) ArcIt->unmark(); } template <class nodetype, class arctype> void unmark_arcs(graph_array<nodetype, arctype> & G) { typedef typename graph_array<nodetype, arctype>::node_iterator node_it; for (node_it NodeIt = G.begin(); NodeIt != G.end(); ++NodeIt) unmark_arcs_from_node(* NodeIt); } } // namespace common_structures #endif
24 // softdev@pandora.be
25 //
27 //
28 // Semi-dynamic directed graph
29 // ***************************
30 //
31 // Current version: 3.00 BETA 3 (04/12/2002)
32 //
33 // Comment: graph_array is equivalent to an array of nodes linked by
34 // arcs.
35 // This means you can't change the size (the number of nodes)
36 // of the graph once you created it (setsize() will delete
37 // any previous nodes and arcs).
38 // But you can add or remove arcs.
39 //
40 // History: - 3.00 BETA 3 (04/12/2002) - Added empty()
41 // - Changed some parameters from copy to reference
42 // - Fixed a bug with erase_arc
43 // - Un-inlined external functions
44 // - Added "insert_arc" which is equivalent to "insert"
45 // - 3.00 BETA 2 (16/11/2002) - Improved portability
46 // - 3.00 BETA 1 (27/08/2002) - First public release
47 //
49 
50 #ifndef TRISTRIP_GRAPH_ARRAY_H
51 #define TRISTRIP_GRAPH_ARRAY_H
52 
53 // namespace common_structures
54 namespace common_structures {
55 
56 
57 
58 
59 // graph_array main class
60 template <class nodetype, class arctype>
62 {
63 public:
64 
65  class arc;
66  class node;
67 
68  // New types
69  typedef size_t nodeid;
70  typedef typename std::vector<node>::iterator node_iterator;
71  typedef typename std::vector<node>::const_iterator const_node_iterator;
72  typedef typename std::vector<node>::reverse_iterator node_reverse_iterator;
73  typedef typename std::vector<node>::const_reverse_iterator const_node_reverse_iterator;
74 
76 
77 
78  // graph_array::arc class
79  class arc
80  {
81  public:
82  arc & mark() { m_Marker = true; return (* this); }
83  arc & unmark() { m_Marker = false; return (* this); }
84  bool marked() const { return m_Marker; }
85 
86  node_iterator initial() const { return m_Initial; }
87  node_iterator terminal() const { return m_Terminal; }
88 
89  arctype & operator * () { return m_Elem; }
90  const arctype & operator * () const { return m_Elem; }
91 
92  protected:
93  friend class graph_array<nodetype, arctype>;
94 
95  arc(const node_iterator & Initial, const node_iterator & Terminal)
96  : m_Initial(Initial), m_Terminal(Terminal), m_Marker(false) { }
97 
98  arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem)
99  : m_Initial(Initial), m_Terminal(Terminal), m_Elem(Elem), m_Marker(false) { }
100 
101  node_iterator m_Initial;
102  node_iterator m_Terminal;
103  arctype m_Elem;
104  bool m_Marker;
105  };
106 
107 
108  // New types
109  typedef typename std::list<arc>::iterator out_arc_iterator;
110  typedef typename std::list<arc>::const_iterator const_out_arc_iterator;
111 
112 
113  // graph_array::node class
114  class node
115  {
116  public:
117  node & mark() { m_Marker = true; return (* this); }
118  node & unmark() { m_Marker = false; return (* this); }
119  bool marked() const { return m_Marker; }
120 
121  bool out_empty() const { return m_OutArcs.empty(); }
122  size_t number_of_out_arcs() const { return m_OutArcs.size(); }
123 
124  out_arc_iterator out_begin() { return m_OutArcs.begin(); }
125  out_arc_iterator out_end() { return m_OutArcs.end(); }
126  const_out_arc_iterator out_begin() const { return m_OutArcs.begin(); }
127  const_out_arc_iterator out_end() const { return m_OutArcs.end(); }
128 
129  nodetype & operator * () { return m_Elem; }
130  nodetype * operator -> () { return &m_Elem; }
131  const nodetype & operator * () const { return m_Elem; }
132  const nodetype * operator -> () const { return &m_Elem; }
133 
134  nodetype & operator = (const nodetype & Elem) { return (m_Elem = Elem); }
135 
136  node() : m_Marker(false) { }
137  protected:
138  friend class graph_array<nodetype, arctype>;
139  friend class std::vector<node>;
140 
141 
142  std::list<arc> m_OutArcs;
143  nodetype m_Elem;
144  bool m_Marker;
145  };
146 
147 
148  // Construction/Destruction
149  graph_array();
150  explicit graph_array(const size_t NbNodes);
151 
152  // Node related member functions
153  void clear();
154  bool empty() const;
155  void setsize(const size_t NbNodes);
156  size_t size() const;
157 
158  node & operator [] (const nodeid & i);
159  const node & operator [] (const nodeid & i) const;
160 
161  node_iterator begin();
162  node_iterator end();
163  const_node_iterator begin() const;
164  const_node_iterator end() const;
165 
166  node_reverse_iterator rbegin();
167  node_reverse_iterator rend();
168  const_node_reverse_iterator rbegin() const;
169  const_node_reverse_iterator rend() const;
170 
171  // Arc related member functions
172  size_t number_of_arcs() const;
173 
174  void erase_arcs();
175  void erase_arcs(const node_iterator & Initial);
176  out_arc_iterator erase_arc(const out_arc_iterator & Pos);
177 
178  out_arc_iterator insert_arc(const nodeid & Initial, const nodeid & Terminal);
179  out_arc_iterator insert_arc(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem);
180  out_arc_iterator insert_arc(const node_iterator & Initial, const node_iterator & Terminal);
181  out_arc_iterator insert_arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem);
182 
183  // Another interface for insert_arc
184  out_arc_iterator insert(const nodeid & Initial, const nodeid & Terminal) { return insert_arc(Initial, Terminal); }
185  out_arc_iterator insert(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem) { return insert_arc(Initial, Terminal, Elem); }
186  out_arc_iterator insert(const node_iterator & Initial, const node_iterator & Terminal) { return insert_arc(Initial, Terminal); }
187  out_arc_iterator insert(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem) { return insert_arc(Initial, Terminal, Elem); }
188 
189  // Optimized (overloaded) functions
190  void swap(_mytype & Right);
191 // removed since it was causing g++ 2.95.3 to produce many compile errors
192 // presumably due to implicit import of the std::swap implementation.
193 // Robert Osfield, Jan 2002.
194 // friend void swap(_mytype & Left, _mytype & Right) { Left.swap(Right); }
195 
196 protected:
197  size_t m_NbArcs;
198  std::vector<node> m_Nodes;
199 };
200 
201 
202 
203 // Additional "low level", graph related, functions
204 template <class nodetype, class arctype>
206 
207 template <class nodetype, class arctype>
209 
210 template <class nodetype, class arctype>
212 
213 
214 
215 
217 // graph_array Inline functions
219 
220 template <class nodetype, class arctype>
222 
223 
224 template <class nodetype, class arctype>
225 inline graph_array<nodetype, arctype>::graph_array(const size_t NbNodes) : m_NbArcs(0), m_Nodes(NbNodes) { }
226 
227 
228 template <class nodetype, class arctype>
230  m_NbArcs = 0;
231  m_Nodes.clear();
232 }
233 
234 
235 
236 template <class nodetype, class arctype>
238  return m_Nodes.empty();
239 }
240 
241 
242 template <class nodetype, class arctype>
244  return m_Nodes.size();
245 }
246 
247 
248 template <class nodetype, class arctype>
249 inline void graph_array<nodetype, arctype>::setsize(const size_t NbNodes) {
250  clear();
251  m_Nodes.resize(NbNodes);
252 }
253 
254 
255 template <class nodetype, class arctype>
257  // Debug check
258  // assert(i < size());
259  if (i >= size()) throw "graph_array<nodetype, arctype>::operator [] out of range";
260 
261  return m_Nodes[i];
262 }
263 
264 
265 template <class nodetype, class arctype>
267  // Debug check
268  // assert(i < size());
269  if (i >= size()) throw "graph_array<nodetype, arctype>::operator [] out of range";
270 
271  return m_Nodes[i];
272 }
273 
274 
275 template <class nodetype, class arctype>
277  return m_Nodes.begin();
278 }
279 
280 
281 template <class nodetype, class arctype>
283  return m_Nodes.end();
284 }
285 
286 
287 template <class nodetype, class arctype>
289  return m_Nodes.begin();
290 }
291 
292 
293 template <class nodetype, class arctype>
295  return m_Nodes.end();
296 }
297 
298 
299 template <class nodetype, class arctype>
301  return m_Nodes.rbegin();
302 }
303 
304 
305 template <class nodetype, class arctype>
307  return m_Nodes.rend();
308 }
309 
310 
311 template <class nodetype, class arctype>
313  return m_Nodes.rbegin();
314 }
315 
316 
317 template <class nodetype, class arctype>
319  return m_Nodes.rend();
320 }
321 
322 
323 template <class nodetype, class arctype>
325  return m_NbArcs;
326 }
327 
328 
329 template <class nodetype, class arctype>
331  return (insert(begin() + Initial, begin() + Terminal));
332 }
333 
334 
335 template <class nodetype, class arctype>
336 inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const nodeid & Initial, const nodeid & Terminal, const arctype & Elem) {
337  return (insert(begin() + Initial, begin() + Terminal, Elem));
338 }
339 
340 
341 template <class nodetype, class arctype>
343  ++m_NbArcs;
344  Initial->m_OutArcs.push_back(arc(Initial, Terminal));
345  return (--(Initial->m_OutArcs.end()));
346 }
347 
348 
349 template <class nodetype, class arctype>
350 inline typename graph_array<nodetype, arctype>::out_arc_iterator graph_array<nodetype, arctype>::insert_arc(const node_iterator & Initial, const node_iterator & Terminal, const arctype & Elem) {
351  ++m_NbArcs;
352  Initial->m_OutArcs.push_back(arc(Initial, Terminal, Elem));
353  return (--(Initial->m_OutArcs.end()));
354 }
355 
356 
357 template <class nodetype, class arctype>
359  --m_NbArcs;
360  return (Pos->initial()->m_OutArcs.erase(Pos));
361 }
362 
363 
364 template <class nodetype, class arctype>
366  m_NbArcs -= (Initial->m_OutArcs.size());
367  Initial->m_OutArcs.clear();
368 }
369 
370 
371 template <class nodetype, class arctype>
373  m_NbArcs = 0;
374  for (nodeid i = 0; i < this->Size(); ++i)
375  m_Nodes[i].m_OutArcs.clear();
376 }
377 
378 
379 template <class nodetype, class arctype>
381  std::swap(m_NbArcs, Right.m_NbArcs);
382  std::swap(m_Nodes, Right.m_Nodes);
383 }
384 
385 
386 
388 // additional functions
390 
391 template <class nodetype, class arctype>
393 {
394  typedef typename graph_array<nodetype, arctype>::node_iterator node_it;
395 
396  for (node_it NodeIt = G.begin(); NodeIt != G.end(); ++NodeIt)
397  NodeIt->unmark();
398 }
399 
400 
401 template <class nodetype, class arctype>
403 {
404  typedef typename graph_array<nodetype, arctype>::out_arc_iterator arc_it;
405 
406  for (arc_it ArcIt = N.out_begin(); ArcIt != N.out_end(); ++ArcIt)
407  ArcIt->unmark();
408 }
409 
410 
411 template <class nodetype, class arctype>
413 {
414  typedef typename graph_array<nodetype, arctype>::node_iterator node_it;
415 
416  for (node_it NodeIt = G.begin(); NodeIt != G.end(); ++NodeIt)
417  unmark_arcs_from_node(* NodeIt);
418 }
419 
420 
421 
422 
423 } // namespace common_structures
424 
425 #endif
out_arc_iterator insert(const nodeid &Initial, const nodeid &Terminal)
std::list< arc >::const_iterator const_out_arc_iterator
std::list< arc >::iterator out_arc_iterator
out_arc_iterator insert(const node_iterator &Initial, const node_iterator &Terminal)
arc(const node_iterator &Initial, const node_iterator &Terminal)
void unmark_arcs_from_node(typename graph_array< nodetype, arctype >::node &N)
out_arc_iterator erase_arc(const out_arc_iterator &Pos)
ush Pos
Definition: deflate.h:89
#define G(x, y, z)
Definition: md5.c:52
std::vector< node >::iterator node_iterator
out_arc_iterator insert(const nodeid &Initial, const nodeid &Terminal, const arctype &Elem)
png_uint_32 i
Definition: png.h:2640
void setsize(const size_t NbNodes)
arc(const node_iterator &Initial, const node_iterator &Terminal, const arctype &Elem)
std::vector< node >::const_reverse_iterator const_node_reverse_iterator
const_out_arc_iterator out_end() const
std::vector< node >::const_iterator const_node_iterator
void unmark_nodes(graph_array< nodetype, arctype > &G)
out_arc_iterator insert(const node_iterator &Initial, const node_iterator &Terminal, const arctype &Elem)
node & operator[](const nodeid &i)
out_arc_iterator insert_arc(const nodeid &Initial, const nodeid &Terminal)
void unmark_arcs(graph_array< nodetype, arctype > &G)
const_out_arc_iterator out_begin() const
std::vector< node >::reverse_iterator node_reverse_iterator
graph_array< nodetype, arctype > _mytype
#define false
Definition: ftrandom.c:50
#define N(a)
Definition: tif_fax3.c:1133