# HG changeset patch # User marci # Date 1085134710 0 # Node ID 8fd8933312986945ebbe03b4085284b8cfeb3222 # Parent c3ad7c661a49bd51f74ede828ab0b26e27afa068 The new for macros are: h_for, h_for_inc, h_for_glob, h_for_inc_glob. diff -r c3ad7c661a49 -r 8fd893331298 src/hugo/for_each_macros.h --- a/src/hugo/for_each_macros.h Fri May 21 08:15:45 2004 +0000 +++ b/src/hugo/for_each_macros.h Fri May 21 10:18:30 2004 +0000 @@ -19,15 +19,18 @@ /// Graph g; /// ... /// Graph::NodeIt n; - /// FOR_EACH_GLOB(n, g) { + /// h_for_glob(n, g) { /// ... /// } /// Graph::EdgeIt e; - /// FOR_EACH_GLOB(e, g) { + /// 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 @@ -37,18 +40,21 @@ /// ... /// Graph::Node v; /// Graph::OutEdgeIt e; - /// FOR_EACH_INC_GLOB(e, g, v) { + /// h_for_inc_glob(e, g, v) { /// ... /// } /// typedef BipartiteGraph BGraph; /// BGraph h; /// ... /// BGraph::ClassNodeIt n; - /// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) { + /// 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 @@ -124,33 +130,39 @@ /// \code /// Graph g; /// ... - /// FOR_EACH_LOC(Graph::NodeIt, n, g) { + /// h_for(Graph::NodeIt, n, g) { /// ... /// } - /// FOR_EACH_LOC(Graph::EdgeIt, e, 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; - /// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) { + /// h_for_inc(Graph::OutEdgeIt, e, g, v) { /// ... /// } /// typedef BipartiteGraph BGraph; /// BGraph h; /// ... - /// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) { + /// 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))) @@ -158,7 +170,6 @@ // #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 c3ad7c661a49 -r 8fd893331298 src/work/marci/makefile --- a/src/work/marci/makefile Fri May 21 08:15:45 2004 +0000 +++ b/src/work/marci/makefile Fri May 21 10:18:30 2004 +0000 @@ -4,7 +4,7 @@ INCLUDEDIRS ?= -I../.. -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT) LEDABINARIES = leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo -BINARIES = proba6 max_flow_demo iterator_bfs_demo macro_test lg_vs_sg_vs_sg bfsit_vs_byhand bipartite_graph_wrapper_test bipartite_matching_try bipartite_matching_try_3 top_sort_test max_flow_1 +BINARIES = max_flow_demo iterator_bfs_demo macro_test lg_vs_sg_vs_sg bfsit_vs_byhand bipartite_graph_wrapper_test bipartite_matching_try bipartite_matching_try_3 top_sort_test max_flow_1 #gw_vs_not preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda include ../makefile