[Lemon-commits] [lemon_svn] marci: r834 - hugo/trunk/src/work/marci
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:41:45 CET 2006
Author: marci
Date: Fri May 14 16:41:30 2004
New Revision: 834
Modified:
hugo/trunk/src/work/marci/for_each_macros.h
Log:
Modified: hugo/trunk/src/work/marci/for_each_macros.h
==============================================================================
--- hugo/trunk/src/work/marci/for_each_macros.h (original)
+++ hugo/trunk/src/work/marci/for_each_macros.h Fri May 14 16:41:30 2004
@@ -2,14 +2,59 @@
#ifndef FOR_EACH_MACROS_H
#define FOR_EACH_MACROS_H
+// /// \ingroup gwrappers
+/// \file
+/// \brief Iteraton macros.
+///
+/// This file contains several macros which make easier writting
+/// for cycles in HUGO, using HUGO iterators.
+///
+/// \author Marton Makai
+
namespace hugo {
+/// The iteration with HUGO iterators i.e. for cycles can be
+/// written very comfortable with this macro.
+/// \code
+/// Graph g;
+/// Graph::NodeIt n;
+/// FOR_EACH_GLOB(n, g) {
+/// ...
+/// }
+/// Graph::EdgeIt e;
+/// FOR_EACH_GLOB(e, g) {
+/// ...
+/// }
+/// In the above cycle, the iterator variable \c n and \c e are global ones.
+/// \endcode
#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
+
+/// The iteration with HUGO iterators i.e. for cycles can be
+/// written very comfortable with this macro.
+/// \code
+/// Graph g;
+/// Graph::Node v;
+/// Graph::OutEdgeIt e;
+/// FOR_EACH_INC_GLOB(e, g, v) {
+/// ...
+/// }
+/// typedef BipartiteGraph<Graph> BGraph;
+/// BGraph h;
+/// BGraph::ClassNodeIt n;
+/// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
+/// ...
+/// }
+/// In the above cycle, the iterator variable \c e and \c n are global ones.
+/// \endcode
#define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
+/// \deprecated
#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
+/// \deprecated
#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
+/// \deprecated
#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
+/// \deprecated
#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
// template<typename It, typename Graph>
@@ -71,7 +116,35 @@
// typename Graph::InEdgeIt e; g.first(e, n); return e;
// }
+/// The iteration with HUGO iterators i.e. for cycles can be
+/// written very comfortable with this macro.
+/// \code
+/// Graph g;
+/// FOR_EACH_LOC(Graph::NodeIt, n, g) {
+/// ...
+/// }
+/// FOR_EACH_LOC(Graph::EdgeIt, e, g) {
+/// ...
+/// }
+/// In the above cycle, the iterator variable \c n and \c e are local ones.
+/// \endcode
#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
+
+/// The iteration with HUGO iterators i.e. for cycles can be
+/// written very comfortable with this macro.
+/// \code
+/// Graph g;
+/// Graph::Node v;
+/// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {
+/// ...
+/// }
+/// typedef BipartiteGraph<Graph> BGraph;
+/// BGraph h;
+/// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
+/// ...
+/// }
+/// In the above cycle, the iterator variable \c e and \c n are local ones.
+/// \endcode
#define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
// #define FOR_EACH_EDGE_LOC(e, g) ezt nem tom hogy kell for((g).first((e)); (g).valid((e)); (g).next((e)))
More information about the Lemon-commits
mailing list