We do not yet need it.
authoralpar
Thu, 22 Jul 2004 14:09:21 +0000
changeset 7259fa4045571cd
parent 724 1fa2a88e2b50
child 726 835ebe1b3250
We do not yet need it.
src/hugo/for_each_macros.h
src/work/marci/for_each_macros.h
     1.1 --- a/src/hugo/for_each_macros.h	Thu Jul 22 13:59:10 2004 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,175 +0,0 @@
     1.4 -// -*- c++ -*-
     1.5 -#ifndef HUGO_FOR_EACH_MACROS_H
     1.6 -#define HUGO_FOR_EACH_MACROS_H
     1.7 -
     1.8 -// /// \ingroup gwrappers
     1.9 -/// \file
    1.10 -/// \brief Iteration macros.
    1.11 -///
    1.12 -/// This file contains several macros which make easier writting 
    1.13 -/// for cycles in HUGO using HUGO iterators.
    1.14 -///
    1.15 -/// \author Marton Makai
    1.16 -
    1.17 -namespace hugo {
    1.18 -
    1.19 -  /// This macro provides a comfortable interface for iterating with HUGO 
    1.20 -  /// iterators.
    1.21 -  /// \code
    1.22 -  /// Graph g;
    1.23 -  /// ...
    1.24 -  /// Graph::NodeIt n;
    1.25 -  /// h_for_glob(n, g) {
    1.26 -  /// ...
    1.27 -  /// }
    1.28 -  /// Graph::EdgeIt e;
    1.29 -  /// h_for_glob(e, g) {
    1.30 -  /// ...
    1.31 -  /// }
    1.32 -  /// \endcode
    1.33 -  /// Note that the iterated variables \c n and \c e are global ones. 
    1.34 -#define h_for_glob(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    1.35 -
    1.36 -/// \deprecated
    1.37 -#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    1.38 -
    1.39 -  /// This macro provides a comfortable interface for iterating with HUGO 
    1.40 -  /// iterators.
    1.41 -  /// \code
    1.42 -  /// Graph g;
    1.43 -  /// ...
    1.44 -  /// Graph::Node v;
    1.45 -  /// Graph::OutEdgeIt e;
    1.46 -  /// h_for_inc_glob(e, g, v) {
    1.47 -  /// ...
    1.48 -  /// }
    1.49 -  /// typedef BipartiteGraph<Graph> BGraph;
    1.50 -  /// BGraph h;
    1.51 -  /// ...
    1.52 -  /// BGraph::ClassNodeIt n;
    1.53 -  /// h_for_inc_glob(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
    1.54 -  /// ...
    1.55 -  /// }
    1.56 -  /// \endcode
    1.57 -  /// Note that iterated variables \c e and \c n are global ones. 
    1.58 -#define h_for_inc_glob(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    1.59 -
    1.60 -/// \deprecated
    1.61 -#define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    1.62 -  
    1.63 -/// \deprecated
    1.64 -//#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    1.65 -/// \deprecated
    1.66 -//#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    1.67 -/// \deprecated
    1.68 -//#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    1.69 -/// \deprecated
    1.70 -//#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    1.71 -
    1.72 -//   template<typename It, typename Graph> 
    1.73 -//   It loopFirst(const Graph& g) const {
    1.74 -//     It e; g.first(e); return e; 
    1.75 -//   }
    1.76 -
    1.77 -//   template<typename It, typename Graph> 
    1.78 -//   It loopFirst(const Graph& g, const Node& v) const {
    1.79 -//     It e; g.first(e, v); return e; 
    1.80 -//   }
    1.81 -
    1.82 -//   template<typename Graph> 
    1.83 -//   typename Graph::NodeIt loopFirstNode(const Graph& g) const {
    1.84 -//     typename Graph::NodeIt e; g.first(e); return e; 
    1.85 -//   }
    1.86 -//   template<typename Graph> 
    1.87 -//   typename Graph::EdgeIt loopFirstEdge(const Graph& g) const {
    1.88 -//     typename Graph::EdgeIt e; g.first(e); return e; 
    1.89 -//   }
    1.90 -//   template<typename Graph> 
    1.91 -//   typename Graph::OutEdgeIt 
    1.92 -//   loopFirstOutEdge(const Graph& g, const Node& n) const {
    1.93 -//     typename Graph::OutEdgeIt e; g.first(e, n); return e; 
    1.94 -//   }
    1.95 -//   template<typename Graph> 
    1.96 -//   typename Graph::InEdgeIt 
    1.97 -//   loopFirstIn Edge(const Graph& g, const Node& n) const {
    1.98 -//     typename Graph::InEdgeIt e; g.first(e, n); return e; 
    1.99 -//   }
   1.100 -
   1.101 -//FIXME ezt hogy a gorcsbe birja levezetni. Csak ugy leveszi a const-ot??
   1.102 -  template<typename It, typename Graph> 
   1.103 -  It loopFirst(const It&, const Graph& g) {
   1.104 -    It e; g.first(e); return e; 
   1.105 -  }
   1.106 -
   1.107 -  template<typename It, typename Graph, typename Node> 
   1.108 -  It loopFirst(const It&, const Graph& g, const Node& v) {
   1.109 -    It e; g.first(e, v); return e; 
   1.110 -  }
   1.111 -
   1.112 -//   template<typename Graph> 
   1.113 -//   typename Graph::NodeIt loopFirstNode(const Graph& g) const {
   1.114 -//     typename Graph::NodeIt e; g.first(e); return e; 
   1.115 -//   }
   1.116 -//   template<typename Graph> 
   1.117 -//   typename Graph::EdgeIt loopFirstEdge(const Graph& g) const {
   1.118 -//     typename Graph::EdgeIt e; g.first(e); return e; 
   1.119 -//   }
   1.120 -//   template<typename Graph> 
   1.121 -//   typename Graph::OutEdgeIt 
   1.122 -//   loopFirstOutEdge(const Graph& g, const Node& n) const {
   1.123 -//     typename Graph::OutEdgeIt e; g.first(e, n); return e; 
   1.124 -//   }
   1.125 -//   template<typename Graph> 
   1.126 -//   typename Graph::InEdgeIt 
   1.127 -//   loopFirstIn Edge(const Graph& g, const Node& n) const {
   1.128 -//     typename Graph::InEdgeIt e; g.first(e, n); return e; 
   1.129 -//   }
   1.130 -
   1.131 -  /// This macro provides a comfortable interface for iterating with HUGO 
   1.132 -  /// iterators.
   1.133 -  /// \code
   1.134 -  /// Graph g;
   1.135 -  /// ...
   1.136 -  /// h_for(Graph::NodeIt, n, g) {
   1.137 -  /// ...
   1.138 -  /// }
   1.139 -  /// h_for(Graph::EdgeIt, e, g) {
   1.140 -  /// ...
   1.141 -  /// }
   1.142 -  /// \endcode
   1.143 -  /// Note that the iterated variables \c n and \c e are local ones. 
   1.144 -#define h_for(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
   1.145 -  
   1.146 -/// \deprecated
   1.147 -#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
   1.148 -
   1.149 -  /// This macro provides a comfortable interface for iterating with HUGO 
   1.150 -  /// iterators.
   1.151 -  /// \code
   1.152 -  /// Graph g;
   1.153 -  /// ...
   1.154 -  /// Graph::Node v;
   1.155 -  /// h_for_inc(Graph::OutEdgeIt, e, g, v) {
   1.156 -  /// ...
   1.157 -  /// }
   1.158 -  /// typedef BipartiteGraph<Graph> BGraph;
   1.159 -  /// BGraph h;
   1.160 -  /// ...
   1.161 -  /// h_for_inc(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
   1.162 -  /// ...
   1.163 -  /// }
   1.164 -  /// \endcode
   1.165 -  /// Note that the iterated variables \c e and \c n are local ones. 
   1.166 -#define h_for_inc(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
   1.167 -  
   1.168 -/// \deprecated
   1.169 -#define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
   1.170 -  
   1.171 -// #define FOR_EACH_EDGE_LOC(e, g) ezt nem tom hogy kell for((g).first((e)); (g).valid((e)); (g).next((e)))
   1.172 -// #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
   1.173 -// #define FOR_EACH_INEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
   1.174 -// #define FOR_EACH_OUTEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
   1.175 -
   1.176 -} //namespace hugo
   1.177 -
   1.178 -#endif //HUGO_FOR_EACH_MACROS_H
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/work/marci/for_each_macros.h	Thu Jul 22 14:09:21 2004 +0000
     2.3 @@ -0,0 +1,175 @@
     2.4 +// -*- c++ -*-
     2.5 +#ifndef HUGO_FOR_EACH_MACROS_H
     2.6 +#define HUGO_FOR_EACH_MACROS_H
     2.7 +
     2.8 +// /// \ingroup gwrappers
     2.9 +/// \file
    2.10 +/// \brief Iteration macros.
    2.11 +///
    2.12 +/// This file contains several macros which make easier writting 
    2.13 +/// for cycles in HUGO using HUGO iterators.
    2.14 +///
    2.15 +/// \author Marton Makai
    2.16 +
    2.17 +namespace hugo {
    2.18 +
    2.19 +  /// This macro provides a comfortable interface for iterating with HUGO 
    2.20 +  /// iterators.
    2.21 +  /// \code
    2.22 +  /// Graph g;
    2.23 +  /// ...
    2.24 +  /// Graph::NodeIt n;
    2.25 +  /// h_for_glob(n, g) {
    2.26 +  /// ...
    2.27 +  /// }
    2.28 +  /// Graph::EdgeIt e;
    2.29 +  /// h_for_glob(e, g) {
    2.30 +  /// ...
    2.31 +  /// }
    2.32 +  /// \endcode
    2.33 +  /// Note that the iterated variables \c n and \c e are global ones. 
    2.34 +#define h_for_glob(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    2.35 +
    2.36 +/// \deprecated
    2.37 +#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    2.38 +
    2.39 +  /// This macro provides a comfortable interface for iterating with HUGO 
    2.40 +  /// iterators.
    2.41 +  /// \code
    2.42 +  /// Graph g;
    2.43 +  /// ...
    2.44 +  /// Graph::Node v;
    2.45 +  /// Graph::OutEdgeIt e;
    2.46 +  /// h_for_inc_glob(e, g, v) {
    2.47 +  /// ...
    2.48 +  /// }
    2.49 +  /// typedef BipartiteGraph<Graph> BGraph;
    2.50 +  /// BGraph h;
    2.51 +  /// ...
    2.52 +  /// BGraph::ClassNodeIt n;
    2.53 +  /// h_for_inc_glob(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
    2.54 +  /// ...
    2.55 +  /// }
    2.56 +  /// \endcode
    2.57 +  /// Note that iterated variables \c e and \c n are global ones. 
    2.58 +#define h_for_inc_glob(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    2.59 +
    2.60 +/// \deprecated
    2.61 +#define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    2.62 +  
    2.63 +/// \deprecated
    2.64 +//#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    2.65 +/// \deprecated
    2.66 +//#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    2.67 +/// \deprecated
    2.68 +//#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    2.69 +/// \deprecated
    2.70 +//#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    2.71 +
    2.72 +//   template<typename It, typename Graph> 
    2.73 +//   It loopFirst(const Graph& g) const {
    2.74 +//     It e; g.first(e); return e; 
    2.75 +//   }
    2.76 +
    2.77 +//   template<typename It, typename Graph> 
    2.78 +//   It loopFirst(const Graph& g, const Node& v) const {
    2.79 +//     It e; g.first(e, v); return e; 
    2.80 +//   }
    2.81 +
    2.82 +//   template<typename Graph> 
    2.83 +//   typename Graph::NodeIt loopFirstNode(const Graph& g) const {
    2.84 +//     typename Graph::NodeIt e; g.first(e); return e; 
    2.85 +//   }
    2.86 +//   template<typename Graph> 
    2.87 +//   typename Graph::EdgeIt loopFirstEdge(const Graph& g) const {
    2.88 +//     typename Graph::EdgeIt e; g.first(e); return e; 
    2.89 +//   }
    2.90 +//   template<typename Graph> 
    2.91 +//   typename Graph::OutEdgeIt 
    2.92 +//   loopFirstOutEdge(const Graph& g, const Node& n) const {
    2.93 +//     typename Graph::OutEdgeIt e; g.first(e, n); return e; 
    2.94 +//   }
    2.95 +//   template<typename Graph> 
    2.96 +//   typename Graph::InEdgeIt 
    2.97 +//   loopFirstIn Edge(const Graph& g, const Node& n) const {
    2.98 +//     typename Graph::InEdgeIt e; g.first(e, n); return e; 
    2.99 +//   }
   2.100 +
   2.101 +//FIXME ezt hogy a gorcsbe birja levezetni. Csak ugy leveszi a const-ot??
   2.102 +  template<typename It, typename Graph> 
   2.103 +  It loopFirst(const It&, const Graph& g) {
   2.104 +    It e; g.first(e); return e; 
   2.105 +  }
   2.106 +
   2.107 +  template<typename It, typename Graph, typename Node> 
   2.108 +  It loopFirst(const It&, const Graph& g, const Node& v) {
   2.109 +    It e; g.first(e, v); return e; 
   2.110 +  }
   2.111 +
   2.112 +//   template<typename Graph> 
   2.113 +//   typename Graph::NodeIt loopFirstNode(const Graph& g) const {
   2.114 +//     typename Graph::NodeIt e; g.first(e); return e; 
   2.115 +//   }
   2.116 +//   template<typename Graph> 
   2.117 +//   typename Graph::EdgeIt loopFirstEdge(const Graph& g) const {
   2.118 +//     typename Graph::EdgeIt e; g.first(e); return e; 
   2.119 +//   }
   2.120 +//   template<typename Graph> 
   2.121 +//   typename Graph::OutEdgeIt 
   2.122 +//   loopFirstOutEdge(const Graph& g, const Node& n) const {
   2.123 +//     typename Graph::OutEdgeIt e; g.first(e, n); return e; 
   2.124 +//   }
   2.125 +//   template<typename Graph> 
   2.126 +//   typename Graph::InEdgeIt 
   2.127 +//   loopFirstIn Edge(const Graph& g, const Node& n) const {
   2.128 +//     typename Graph::InEdgeIt e; g.first(e, n); return e; 
   2.129 +//   }
   2.130 +
   2.131 +  /// This macro provides a comfortable interface for iterating with HUGO 
   2.132 +  /// iterators.
   2.133 +  /// \code
   2.134 +  /// Graph g;
   2.135 +  /// ...
   2.136 +  /// h_for(Graph::NodeIt, n, g) {
   2.137 +  /// ...
   2.138 +  /// }
   2.139 +  /// h_for(Graph::EdgeIt, e, g) {
   2.140 +  /// ...
   2.141 +  /// }
   2.142 +  /// \endcode
   2.143 +  /// Note that the iterated variables \c n and \c e are local ones. 
   2.144 +#define h_for(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
   2.145 +  
   2.146 +/// \deprecated
   2.147 +#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
   2.148 +
   2.149 +  /// This macro provides a comfortable interface for iterating with HUGO 
   2.150 +  /// iterators.
   2.151 +  /// \code
   2.152 +  /// Graph g;
   2.153 +  /// ...
   2.154 +  /// Graph::Node v;
   2.155 +  /// h_for_inc(Graph::OutEdgeIt, e, g, v) {
   2.156 +  /// ...
   2.157 +  /// }
   2.158 +  /// typedef BipartiteGraph<Graph> BGraph;
   2.159 +  /// BGraph h;
   2.160 +  /// ...
   2.161 +  /// h_for_inc(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
   2.162 +  /// ...
   2.163 +  /// }
   2.164 +  /// \endcode
   2.165 +  /// Note that the iterated variables \c e and \c n are local ones. 
   2.166 +#define h_for_inc(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
   2.167 +  
   2.168 +/// \deprecated
   2.169 +#define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
   2.170 +  
   2.171 +// #define FOR_EACH_EDGE_LOC(e, g) ezt nem tom hogy kell for((g).first((e)); (g).valid((e)); (g).next((e)))
   2.172 +// #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
   2.173 +// #define FOR_EACH_INEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
   2.174 +// #define FOR_EACH_OUTEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
   2.175 +
   2.176 +} //namespace hugo
   2.177 +
   2.178 +#endif //HUGO_FOR_EACH_MACROS_H