COIN-OR::LEMON - Graph Library

Changeset 2031:080d51024ac5 in lemon-0.x for lemon/graph_utils.h


Ignore:
Timestamp:
04/03/06 11:45:23 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2670
Message:

Correcting the structure of the graph's and adaptor's map.
The template assign operators and map iterators can be used for adaptors also.

Some bugfix in the adaptors

New class SwapBpUGraphAdaptor which swaps the two nodeset of the graph.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_utils.h

    r2029 r2031  
    4949  ///This \c \#define creates convenience typedefs for the following types
    5050  ///of \c Graph: \c Node,  \c NodeIt, \c Edge, \c EdgeIt, \c InEdgeIt,
    51   ///\c OutEdgeIt,  \c BoolNodeMap,  \c IntNodeMap,  \c DoubleNodeMap,
    52   ///\c BoolEdgeMap, \c IntEdgeMap,  \c DoubleEdgeMap. 
     51  ///\c OutEdgeIt
    5352  ///\note If \c G it a template parameter, it should be used in this way.
    5453  ///\code
     
    6564    typedef Graph:: InEdgeIt  InEdgeIt;                 \
    6665    typedef Graph::OutEdgeIt OutEdgeIt;                 
    67 //     typedef Graph::template NodeMap<bool> BoolNodeMap;             
    68 //     typedef Graph::template NodeMap<int> IntNodeMap;       
    69 //     typedef Graph::template NodeMap<double> DoubleNodeMap; 
    70 //     typedef Graph::template EdgeMap<bool> BoolEdgeMap;             
    71 //     typedef Graph::template EdgeMap<int> IntEdgeMap;       
    72 //     typedef Graph::template EdgeMap<double> DoubleEdgeMap;
    73  
     66
    7467  ///Creates convenience typedefs for the undirected graph types and iterators
    7568
     
    7770  ///\ref GRAPH_TYPEDEFS(Graph) and three more, namely it creates
    7871  ///\c UEdge, \c UEdgeIt, \c IncEdgeIt,
    79   ///\c BoolUEdgeMap, \c IntUEdgeMap,  \c DoubleUEdgeMap. 
    8072  ///
    8173  ///\note If \c G it a template parameter, it should be used in this way.
     
    9486//     typedef Graph::template UEdgeMap<int> IntUEdgeMap;
    9587//     typedef Graph::template UEdgeMap<double> DoubleUEdgeMap;
    96  
    97 
     88
     89  ///\brief Creates convenience typedefs for the bipartite undirected graph
     90  ///types and iterators
     91
     92  ///This \c \#define creates the same convenience typedefs as defined by
     93  ///\ref UGRAPH_TYPEDEFS(Graph) and two more, namely it creates
     94  ///\c ANodeIt, \c BNodeIt,
     95  ///
     96  ///\note If \c G it a template parameter, it should be used in this way.
     97  ///\code
     98  ///  BPUGRAPH_TYPEDEFS(typename G)
     99  ///\endcode
     100  ///
     101  ///\warning There are no typedefs for the graph maps because of the lack of
     102  ///template typedefs in C++.
     103#define BPUGRAPH_TYPEDEFS(Graph)            \
     104  UGRAPH_TYPEDEFS(Graph)                    \
     105    typedef Graph::ANodeIt ANodeIt;         \
     106    typedef Graph::BNodeIt BNodeIt;
    98107
    99108  /// \brief Function to count the items in the graph.
     
    431440        if (u != v) {
    432441          if (e == INVALID) {
    433             g.firstInc(e, u, b);
     442            g.firstInc(e, b, u);
    434443          } else {
    435444            b = g.source(e) == u;
     
    441450        } else {
    442451          if (e == INVALID) {
    443             g.firstInc(e, u, b);
     452            g.firstInc(e, b, u);
    444453          } else {
    445454            b = true;
     
    486495  ///\endcode
    487496  template <typename Graph>
    488   inline typename Graph::UEdge findEdge(const Graph &g,
    489                                         typename Graph::Node u,
    490                                         typename Graph::Node v,
    491                                         typename Graph::UEdge prev = INVALID) {
    492     return _graph_utils_bits::FindUEdgeSelector<Graph>::find(g, u, v, prev);
     497  inline typename Graph::UEdge findUEdge(const Graph &g,
     498                                         typename Graph::Node u,
     499                                         typename Graph::Node v,
     500                                         typename Graph::UEdge p = INVALID) {
     501    return _graph_utils_bits::FindUEdgeSelector<Graph>::find(g, u, v, p);
    493502  }
    494503
Note: See TracChangeset for help on using the changeset viewer.