COIN-OR::LEMON - Graph Library

Changeset 638:2153dd45937a in lemon-0.x


Ignore:
Timestamp:
05/14/04 17:01:21 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@836
Message:

for_eachmacros.h in include

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/for_each_macros.h

    r637 r638  
    55// /// \ingroup gwrappers
    66/// \file
    7 /// \brief Iteraton macros.
     7/// \brief Iteration macros.
    88///
    99/// This file contains several macros which make easier writting
    10 /// for cycles in HUGO, using HUGO iterators.
     10/// for cycles in HUGO using HUGO iterators.
    1111///
    1212/// \author Marton Makai
     
    1414namespace hugo {
    1515
    16 /// The iteration with HUGO iterators i.e. for cycles can be
    17 /// written very comfortable with this macro.
    18 /// \code
    19 /// Graph g;
    20 /// Graph::NodeIt n;
    21 /// FOR_EACH_GLOB(n, g) {
    22 /// ...
    23 /// }
    24 /// Graph::EdgeIt e;
    25 /// FOR_EACH_GLOB(e, g) {
    26 /// ...
    27 /// }
    28 /// In the above cycle, the iterator variable \c n and \c e are global ones.
    29 /// \endcode
     16  /// This macro provides a comfortable interface for iterating with HUGO
     17  /// iterators.
     18  /// \code
     19  /// Graph g;
     20  /// Graph::NodeIt n;
     21  /// FOR_EACH_GLOB(n, g) {
     22  /// ...
     23  /// }
     24  /// Graph::EdgeIt e;
     25  /// FOR_EACH_GLOB(e, g) {
     26  /// ...
     27  /// }
     28  /// \endcode
     29  /// Note that the iterated variables \c n and \c e are global ones.
    3030#define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    3131
    32 /// The iteration with HUGO iterators i.e. for cycles can be
    33 /// written very comfortable with this macro.
    34 /// \code
    35 /// Graph g;
    36 /// Graph::Node v;
    37 /// Graph::OutEdgeIt e;
    38 /// FOR_EACH_INC_GLOB(e, g, v) {
    39 /// ...
    40 /// }
    41 /// typedef BipartiteGraph<Graph> BGraph;
    42 /// BGraph h;
    43 /// BGraph::ClassNodeIt n;
    44 /// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
    45 /// ...
    46 /// }
    47 /// In the above cycle, the iterator variable \c e and \c n are global ones.
    48 /// \endcode
     32  /// This macro provides a comfortable interface for iterating with HUGO
     33  /// iterators.
     34  /// \code
     35  /// Graph g;
     36  /// Graph::Node v;
     37  /// Graph::OutEdgeIt e;
     38  /// FOR_EACH_INC_GLOB(e, g, v) {
     39  /// ...
     40  /// }
     41  /// typedef BipartiteGraph<Graph> BGraph;
     42  /// BGraph h;
     43  /// BGraph::ClassNodeIt n;
     44  /// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
     45  /// ...
     46  /// }
     47  /// \endcode
     48  /// Note that iterated variables \c e and \c n are global ones.
    4949#define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    50 
     50 
    5151/// \deprecated
    52 #define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
     52//#define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    5353/// \deprecated
    54 #define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
     54//#define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    5555/// \deprecated
    56 #define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
     56//#define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    5757/// \deprecated
    58 #define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
     58//#define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    5959
    6060//   template<typename It, typename Graph>
     
    117117//   }
    118118
    119 /// The iteration with HUGO iterators i.e. for cycles can be
    120 /// written very comfortable with this macro.
    121 /// \code
    122 /// Graph g;
    123 /// FOR_EACH_LOC(Graph::NodeIt, n, g) {
    124 /// ...
    125 /// }
    126 /// FOR_EACH_LOC(Graph::EdgeIt, e, g) {
    127 /// ...
    128 /// }
    129 /// In the above cycle, the iterator variable \c n and \c e are local ones.
    130 /// \endcode
     119  /// This macro provides a comfortable interface for iterating with HUGO
     120  /// iterators.
     121  /// \code
     122  /// Graph g;
     123  /// FOR_EACH_LOC(Graph::NodeIt, n, g) {
     124  /// ...
     125  /// }
     126  /// FOR_EACH_LOC(Graph::EdgeIt, e, g) {
     127  /// ...
     128  /// }
     129  /// \endcode
     130  /// Note that the iterated variables \c n and \c e are local ones.
    131131#define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e))
    132 
    133 /// The iteration with HUGO iterators i.e. for cycles can be
    134 /// written very comfortable with this macro.
    135 /// \code
    136 /// Graph g;
    137 /// Graph::Node v;
    138 /// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {
    139 /// ...
    140 /// }
    141 /// typedef BipartiteGraph<Graph> BGraph;
    142 /// BGraph h;
    143 /// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
    144 /// ...
    145 /// }
    146 /// In the above cycle, the iterator variable \c e and \c n are local ones.
    147 /// \endcode
     132 
     133  /// This macro provides a comfortable interface for iterating with HUGO
     134  /// iterators.
     135  /// \code
     136  /// Graph g;
     137  /// Graph::Node v;
     138  /// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {
     139  /// ...
     140  /// }
     141  /// typedef BipartiteGraph<Graph> BGraph;
     142  /// BGraph h;
     143  /// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {
     144  /// ...
     145  /// }
     146  /// \endcode
     147  /// Note that the iterated variables \c e and \c n are local ones.
    148148#define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e))
    149 
     149 
    150150// #define FOR_EACH_EDGE_LOC(e, g) ezt nem tom hogy kell for((g).first((e)); (g).valid((e)); (g).next((e)))
    151151// #define FOR_EACH_NODE_LOC(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
Note: See TracChangeset for help on using the changeset viewer.