COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
05/19/04 18:06:57 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@846
Message:

max_flow.h: status flags for actMinCut
leda_graph_wrapper.h: NodeMapWrapper?, EdgeMapWrapper?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/leda/leda_graph_wrapper.h

    r617 r646  
    4141    template <typename T> class NodeMap;
    4242    template <typename T> class EdgeMap;
     43    template <typename T> class NodeMapWrapper;
     44    template <typename T> class EdgeMapWrapper;
    4345
    4446    class Node;
     
    292294    };
    293295
     296
     297    ///Read/write map from the nodes to type \c T.
     298    template<typename T> class NodeMapWrapper
     299    {
     300      leda_node_map<T>* leda_stuff;
     301    public:
     302      typedef T ValueType;
     303      typedef Node KeyType;
     304
     305      NodeMapWrapper(leda_node_map<T>& _leda_stuff) :
     306        leda_stuff(&_leda_stuff) { }
     307      //NodeMap(leda_node_map& &G, T t) : leda_stuff(*(G.l_graph), t) {}
     308
     309      void set(Node i, T t) { (*leda_stuff)[i.l_n]=t; }
     310      T get(Node i) const { return (*leda_stuff)[i.l_n]; }  //FIXME: Is it necessary
     311      T &operator[](Node i) { return (*leda_stuff)[i.l_n]; }
     312      const T &operator[](Node i) const { return (*leda_stuff)[i.l_n]; }
     313
     314      void update() { /*leda_stuff.init(leda_stuff.get_graph());*/ }
     315      //void update(T a) { leda_stuff.init(leda_stuff.get_graph()/**(G.l_graph)*/, a); }   //FIXME: Is it necessary
     316    };
     317
     318    ///Read/write map from the edges to type \c T.
     319    template<typename T> class EdgeMapWrapper
     320    {
     321      leda_edge_map<T>* leda_stuff;
     322    public:
     323      typedef T ValueType;
     324      typedef Edge KeyType;
     325
     326      EdgeMapWrapper(leda_edge_map<T>& _leda_stuff) :
     327        leda_stuff(_leda_stuff) { }
     328      //EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
     329
     330      void set(Edge i, T t) { (*leda_stuff)[i.l_e]=t; }
     331      T get(Edge i) const { return (*leda_stuff)[i.l_e]; }  //FIXME: Is it necessary
     332      T &operator[](Edge i) { return (*leda_stuff)[i.l_e]; }
     333      const T &operator[](Edge i) const { return (*leda_stuff)[i.l_e]; }
     334
     335      void update() { /*leda_stuff.init(leda_stuff.get_graph());*/ }
     336      //void update(T a) { leda_stuff.init(leda_stuff.get_graph()/**(G.l_graph)*/, a); }   //FIXME: Is it necessary
     337    };
     338
    294339  };
    295340
Note: See TracChangeset for help on using the changeset viewer.