1.1 --- a/src/hugo/for_each_macros.h Fri May 14 14:42:58 2004 +0000
1.2 +++ b/src/hugo/for_each_macros.h Fri May 14 15:01:21 2004 +0000
1.3 @@ -4,58 +4,58 @@
1.4
1.5 // /// \ingroup gwrappers
1.6 /// \file
1.7 -/// \brief Iteraton macros.
1.8 +/// \brief Iteration macros.
1.9 ///
1.10 /// This file contains several macros which make easier writting
1.11 -/// for cycles in HUGO, using HUGO iterators.
1.12 +/// for cycles in HUGO using HUGO iterators.
1.13 ///
1.14 /// \author Marton Makai
1.15
1.16 namespace hugo {
1.17
1.18 -/// The iteration with HUGO iterators i.e. for cycles can be
1.19 -/// written very comfortable with this macro.
1.20 -/// \code
1.21 -/// Graph g;
1.22 -/// Graph::NodeIt n;
1.23 -/// FOR_EACH_GLOB(n, g) {
1.24 -/// ...
1.25 -/// }
1.26 -/// Graph::EdgeIt e;
1.27 -/// FOR_EACH_GLOB(e, g) {
1.28 -/// ...
1.29 -/// }
1.30 -/// In the above cycle, the iterator variable \c n and \c e are global ones.
1.31 -/// \endcode
1.32 + /// This macro provides a comfortable interface for iterating with HUGO
1.33 + /// iterators.
1.34 + /// \code
1.35 + /// Graph g;
1.36 + /// Graph::NodeIt n;
1.37 + /// FOR_EACH_GLOB(n, g) {
1.38 + /// ...
1.39 + /// }
1.40 + /// Graph::EdgeIt e;
1.41 + /// FOR_EACH_GLOB(e, g) {
1.42 + /// ...
1.43 + /// }
1.44 + /// \endcode
1.45 + /// Note that the iterated variables \c n and \c e are global ones.
1.46 #define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.47
1.48 -/// The iteration with HUGO iterators i.e. for cycles can be
1.49 -/// written very comfortable with this macro.
1.50 -/// \code
1.51 -/// Graph g;
1.52 -/// Graph::Node v;
1.53 -/// Graph::OutEdgeIt e;
1.54 -/// FOR_EACH_INC_GLOB(e, g, v) {
1.55 -/// ...
1.56 -/// }
1.57 -/// typedef BipartiteGraph<Graph> BGraph;
1.58 -/// BGraph h;
1.59 -/// BGraph::ClassNodeIt n;
1.60 -/// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
1.61 -/// ...
1.62 -/// }
1.63 -/// In the above cycle, the iterator variable \c e and \c n are global ones.
1.64 -/// \endcode
1.65 + /// This macro provides a comfortable interface for iterating with HUGO
1.66 + /// iterators.
1.67 + /// \code
1.68 + /// Graph g;
1.69 + /// Graph::Node v;
1.70 + /// Graph::OutEdgeIt e;
1.71 + /// FOR_EACH_INC_GLOB(e, g, v) {
1.72 + /// ...
1.73 + /// }
1.74 + /// typedef BipartiteGraph<Graph> BGraph;
1.75 + /// BGraph h;
1.76 + /// BGraph::ClassNodeIt n;
1.77 + /// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
1.78 + /// ...
1.79 + /// }
1.80 + /// \endcode
1.81 + /// Note that iterated variables \c e and \c n are global ones.
1.82 #define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
1.83 -
1.84 +
1.85 /// \deprecated
1.86 -#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.87 +//#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.88 /// \deprecated
1.89 -#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.90 +//#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.91 /// \deprecated
1.92 -#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
1.93 +//#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
1.94 /// \deprecated
1.95 -#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
1.96 +//#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
1.97
1.98 // template<typename It, typename Graph>
1.99 // It loopFirst(const Graph& g) const {
1.100 @@ -116,37 +116,37 @@
1.101 // typename Graph::InEdgeIt e; g.first(e, n); return e;
1.102 // }
1.103
1.104 -/// The iteration with HUGO iterators i.e. for cycles can be
1.105 -/// written very comfortable with this macro.
1.106 -/// \code
1.107 -/// Graph g;
1.108 -/// FOR_EACH_LOC(Graph::NodeIt, n, g) {
1.109 -/// ...
1.110 -/// }
1.111 -/// FOR_EACH_LOC(Graph::EdgeIt, e, g) {
1.112 -/// ...
1.113 -/// }
1.114 -/// In the above cycle, the iterator variable \c n and \c e are local ones.
1.115 -/// \endcode
1.116 + /// This macro provides a comfortable interface for iterating with HUGO
1.117 + /// iterators.
1.118 + /// \code
1.119 + /// Graph g;
1.120 + /// FOR_EACH_LOC(Graph::NodeIt, n, g) {
1.121 + /// ...
1.122 + /// }
1.123 + /// FOR_EACH_LOC(Graph::EdgeIt, e, g) {
1.124 + /// ...
1.125 + /// }
1.126 + /// \endcode
1.127 + /// Note that the iterated variables \c n and \c e are local ones.
1.128 #define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
1.129 -
1.130 -/// The iteration with HUGO iterators i.e. for cycles can be
1.131 -/// written very comfortable with this macro.
1.132 -/// \code
1.133 -/// Graph g;
1.134 -/// Graph::Node v;
1.135 -/// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {
1.136 -/// ...
1.137 -/// }
1.138 -/// typedef BipartiteGraph<Graph> BGraph;
1.139 -/// BGraph h;
1.140 -/// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
1.141 -/// ...
1.142 -/// }
1.143 -/// In the above cycle, the iterator variable \c e and \c n are local ones.
1.144 -/// \endcode
1.145 +
1.146 + /// This macro provides a comfortable interface for iterating with HUGO
1.147 + /// iterators.
1.148 + /// \code
1.149 + /// Graph g;
1.150 + /// Graph::Node v;
1.151 + /// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {
1.152 + /// ...
1.153 + /// }
1.154 + /// typedef BipartiteGraph<Graph> BGraph;
1.155 + /// BGraph h;
1.156 + /// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
1.157 + /// ...
1.158 + /// }
1.159 + /// \endcode
1.160 + /// Note that the iterated variables \c e and \c n are local ones.
1.161 #define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
1.162 -
1.163 +
1.164 // #define FOR_EACH_EDGE_LOC(e, g) ezt nem tom hogy kell for((g).first((e)); (g).valid((e)); (g).next((e)))
1.165 // #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
1.166 // #define FOR_EACH_INEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))