# HG changeset patch # User alpar # Date 1090505361 0 # Node ID 9fa4045571cdd6180c85f1c9746ff9581b082062 # Parent 1fa2a88e2b50c7cf88e91605d53b9587544750c3 We do not yet need it. diff -r 1fa2a88e2b50 -r 9fa4045571cd src/hugo/for_each_macros.h --- a/src/hugo/for_each_macros.h Thu Jul 22 13:59:10 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -// -*- c++ -*- -#ifndef HUGO_FOR_EACH_MACROS_H -#define HUGO_FOR_EACH_MACROS_H - -// /// \ingroup gwrappers -/// \file -/// \brief Iteration macros. -/// -/// This file contains several macros which make easier writting -/// for cycles in HUGO using HUGO iterators. -/// -/// \author Marton Makai - -namespace hugo { - - /// This macro provides a comfortable interface for iterating with HUGO - /// iterators. - /// \code - /// Graph g; - /// ... - /// Graph::NodeIt n; - /// h_for_glob(n, g) { - /// ... - /// } - /// Graph::EdgeIt e; - /// h_for_glob(e, g) { - /// ... - /// } - /// \endcode - /// Note that the iterated variables \c n and \c e are global ones. -#define h_for_glob(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) - -/// \deprecated -#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) - - /// This macro provides a comfortable interface for iterating with HUGO - /// iterators. - /// \code - /// Graph g; - /// ... - /// Graph::Node v; - /// Graph::OutEdgeIt e; - /// h_for_inc_glob(e, g, v) { - /// ... - /// } - /// typedef BipartiteGraph BGraph; - /// BGraph h; - /// ... - /// BGraph::ClassNodeIt n; - /// h_for_inc_glob(BGraph::ClassNodeIt, n, h, h.S_CLASS) { - /// ... - /// } - /// \endcode - /// Note that iterated variables \c e and \c n are global ones. -#define h_for_inc_glob(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) - -/// \deprecated -#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 -// It loopFirst(const Graph& g) const { -// It e; g.first(e); return e; -// } - -// template -// It loopFirst(const Graph& g, const Node& v) const { -// It e; g.first(e, v); return e; -// } - -// template -// typename Graph::NodeIt loopFirstNode(const Graph& g) const { -// typename Graph::NodeIt e; g.first(e); return e; -// } -// template -// typename Graph::EdgeIt loopFirstEdge(const Graph& g) const { -// typename Graph::EdgeIt e; g.first(e); return e; -// } -// template -// typename Graph::OutEdgeIt -// loopFirstOutEdge(const Graph& g, const Node& n) const { -// typename Graph::OutEdgeIt e; g.first(e, n); return e; -// } -// template -// typename Graph::InEdgeIt -// loopFirstIn Edge(const Graph& g, const Node& n) const { -// typename Graph::InEdgeIt e; g.first(e, n); return e; -// } - -//FIXME ezt hogy a gorcsbe birja levezetni. Csak ugy leveszi a const-ot?? - template - It loopFirst(const It&, const Graph& g) { - It e; g.first(e); return e; - } - - template - It loopFirst(const It&, const Graph& g, const Node& v) { - It e; g.first(e, v); return e; - } - -// template -// typename Graph::NodeIt loopFirstNode(const Graph& g) const { -// typename Graph::NodeIt e; g.first(e); return e; -// } -// template -// typename Graph::EdgeIt loopFirstEdge(const Graph& g) const { -// typename Graph::EdgeIt e; g.first(e); return e; -// } -// template -// typename Graph::OutEdgeIt -// loopFirstOutEdge(const Graph& g, const Node& n) const { -// typename Graph::OutEdgeIt e; g.first(e, n); return e; -// } -// template -// typename Graph::InEdgeIt -// loopFirstIn Edge(const Graph& g, const Node& n) const { -// typename Graph::InEdgeIt e; g.first(e, n); return e; -// } - - /// This macro provides a comfortable interface for iterating with HUGO - /// iterators. - /// \code - /// Graph g; - /// ... - /// h_for(Graph::NodeIt, n, g) { - /// ... - /// } - /// h_for(Graph::EdgeIt, e, g) { - /// ... - /// } - /// \endcode - /// Note that the iterated variables \c n and \c e are local ones. -#define h_for(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) - -/// \deprecated -#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) - - /// This macro provides a comfortable interface for iterating with HUGO - /// iterators. - /// \code - /// Graph g; - /// ... - /// Graph::Node v; - /// h_for_inc(Graph::OutEdgeIt, e, g, v) { - /// ... - /// } - /// typedef BipartiteGraph BGraph; - /// BGraph h; - /// ... - /// h_for_inc(BGraph::ClassNodeIt, n, h, h.S_CLASS) { - /// ... - /// } - /// \endcode - /// Note that the iterated variables \c e and \c n are local ones. -#define h_for_inc(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e)) - -/// \deprecated -#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))) -// #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) -// #define FOR_EACH_INEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) -// #define FOR_EACH_OUTEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) - -} //namespace hugo - -#endif //HUGO_FOR_EACH_MACROS_H diff -r 1fa2a88e2b50 -r 9fa4045571cd src/work/marci/for_each_macros.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/work/marci/for_each_macros.h Thu Jul 22 14:09:21 2004 +0000 @@ -0,0 +1,175 @@ +// -*- c++ -*- +#ifndef HUGO_FOR_EACH_MACROS_H +#define HUGO_FOR_EACH_MACROS_H + +// /// \ingroup gwrappers +/// \file +/// \brief Iteration macros. +/// +/// This file contains several macros which make easier writting +/// for cycles in HUGO using HUGO iterators. +/// +/// \author Marton Makai + +namespace hugo { + + /// This macro provides a comfortable interface for iterating with HUGO + /// iterators. + /// \code + /// Graph g; + /// ... + /// Graph::NodeIt n; + /// h_for_glob(n, g) { + /// ... + /// } + /// Graph::EdgeIt e; + /// h_for_glob(e, g) { + /// ... + /// } + /// \endcode + /// Note that the iterated variables \c n and \c e are global ones. +#define h_for_glob(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) + +/// \deprecated +#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) + + /// This macro provides a comfortable interface for iterating with HUGO + /// iterators. + /// \code + /// Graph g; + /// ... + /// Graph::Node v; + /// Graph::OutEdgeIt e; + /// h_for_inc_glob(e, g, v) { + /// ... + /// } + /// typedef BipartiteGraph BGraph; + /// BGraph h; + /// ... + /// BGraph::ClassNodeIt n; + /// h_for_inc_glob(BGraph::ClassNodeIt, n, h, h.S_CLASS) { + /// ... + /// } + /// \endcode + /// Note that iterated variables \c e and \c n are global ones. +#define h_for_inc_glob(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) + +/// \deprecated +#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 +// It loopFirst(const Graph& g) const { +// It e; g.first(e); return e; +// } + +// template +// It loopFirst(const Graph& g, const Node& v) const { +// It e; g.first(e, v); return e; +// } + +// template +// typename Graph::NodeIt loopFirstNode(const Graph& g) const { +// typename Graph::NodeIt e; g.first(e); return e; +// } +// template +// typename Graph::EdgeIt loopFirstEdge(const Graph& g) const { +// typename Graph::EdgeIt e; g.first(e); return e; +// } +// template +// typename Graph::OutEdgeIt +// loopFirstOutEdge(const Graph& g, const Node& n) const { +// typename Graph::OutEdgeIt e; g.first(e, n); return e; +// } +// template +// typename Graph::InEdgeIt +// loopFirstIn Edge(const Graph& g, const Node& n) const { +// typename Graph::InEdgeIt e; g.first(e, n); return e; +// } + +//FIXME ezt hogy a gorcsbe birja levezetni. Csak ugy leveszi a const-ot?? + template + It loopFirst(const It&, const Graph& g) { + It e; g.first(e); return e; + } + + template + It loopFirst(const It&, const Graph& g, const Node& v) { + It e; g.first(e, v); return e; + } + +// template +// typename Graph::NodeIt loopFirstNode(const Graph& g) const { +// typename Graph::NodeIt e; g.first(e); return e; +// } +// template +// typename Graph::EdgeIt loopFirstEdge(const Graph& g) const { +// typename Graph::EdgeIt e; g.first(e); return e; +// } +// template +// typename Graph::OutEdgeIt +// loopFirstOutEdge(const Graph& g, const Node& n) const { +// typename Graph::OutEdgeIt e; g.first(e, n); return e; +// } +// template +// typename Graph::InEdgeIt +// loopFirstIn Edge(const Graph& g, const Node& n) const { +// typename Graph::InEdgeIt e; g.first(e, n); return e; +// } + + /// This macro provides a comfortable interface for iterating with HUGO + /// iterators. + /// \code + /// Graph g; + /// ... + /// h_for(Graph::NodeIt, n, g) { + /// ... + /// } + /// h_for(Graph::EdgeIt, e, g) { + /// ... + /// } + /// \endcode + /// Note that the iterated variables \c n and \c e are local ones. +#define h_for(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) + +/// \deprecated +#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) + + /// This macro provides a comfortable interface for iterating with HUGO + /// iterators. + /// \code + /// Graph g; + /// ... + /// Graph::Node v; + /// h_for_inc(Graph::OutEdgeIt, e, g, v) { + /// ... + /// } + /// typedef BipartiteGraph BGraph; + /// BGraph h; + /// ... + /// h_for_inc(BGraph::ClassNodeIt, n, h, h.S_CLASS) { + /// ... + /// } + /// \endcode + /// Note that the iterated variables \c e and \c n are local ones. +#define h_for_inc(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e)) + +/// \deprecated +#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))) +// #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) +// #define FOR_EACH_INEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) +// #define FOR_EACH_OUTEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) + +} //namespace hugo + +#endif //HUGO_FOR_EACH_MACROS_H