src/work/marci/leda/leda_graph_wrapper.h
changeset 1068 e0b0dcee5e17
parent 986 e997802b855c
equal deleted inserted replaced
10:a398bf342fc1 11:e6407306df80
   259     /// Read/write map from the nodes to type \c T.
   259     /// Read/write map from the nodes to type \c T.
   260     template<typename T> class NodeMap
   260     template<typename T> class NodeMap
   261     {
   261     {
   262       leda_node_map<T> leda_stuff;
   262       leda_node_map<T> leda_stuff;
   263     public:
   263     public:
   264       typedef T ValueType;
   264       typedef T Value;
   265       typedef Node KeyType;
   265       typedef Node Key;
   266 
   266 
   267       NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
   267       NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
   268       NodeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   268       NodeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   269 
   269 
   270       void set(Node i, T t) { leda_stuff[i.l_n]=t; }
   270       void set(Node i, T t) { leda_stuff[i.l_n]=t; }
   279     /// Read/write map from the edges to type \c T.
   279     /// Read/write map from the edges to type \c T.
   280     template<typename T> class EdgeMap
   280     template<typename T> class EdgeMap
   281     {
   281     {
   282       leda_edge_map<T> leda_stuff;
   282       leda_edge_map<T> leda_stuff;
   283     public:
   283     public:
   284       typedef T ValueType;
   284       typedef T Value;
   285       typedef Edge KeyType;
   285       typedef Edge Key;
   286 
   286 
   287       EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
   287       EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
   288       EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   288       EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   289 
   289 
   290       void set(Edge i, T t) { leda_stuff[i.l_e]=t; }
   290       void set(Edge i, T t) { leda_stuff[i.l_e]=t; }
   301     /// LEDA node-maps to LEMON ones.
   301     /// LEDA node-maps to LEMON ones.
   302     template<typename T> class NodeMapWrapper
   302     template<typename T> class NodeMapWrapper
   303     {
   303     {
   304       leda_node_array<T>* leda_stuff;
   304       leda_node_array<T>* leda_stuff;
   305     public:
   305     public:
   306       typedef T ValueType;
   306       typedef T Value;
   307       typedef Node KeyType;
   307       typedef Node Key;
   308 
   308 
   309       NodeMapWrapper(leda_node_array<T>& _leda_stuff) : 
   309       NodeMapWrapper(leda_node_array<T>& _leda_stuff) : 
   310 	leda_stuff(&_leda_stuff) { }
   310 	leda_stuff(&_leda_stuff) { }
   311       //NodeMap(leda_node_map& &G, T t) : leda_stuff(*(G.l_graph), t) {}
   311       //NodeMap(leda_node_map& &G, T t) : leda_stuff(*(G.l_graph), t) {}
   312 
   312 
   323     /// LEDA edge-maps to LEMON ones.
   323     /// LEDA edge-maps to LEMON ones.
   324     template<typename T> class EdgeMapWrapper
   324     template<typename T> class EdgeMapWrapper
   325     {
   325     {
   326       leda_edge_array<T>* leda_stuff;
   326       leda_edge_array<T>* leda_stuff;
   327     public:
   327     public:
   328       typedef T ValueType;
   328       typedef T Value;
   329       typedef Edge KeyType;
   329       typedef Edge Key;
   330 
   330 
   331       EdgeMapWrapper(leda_edge_array<T>& _leda_stuff) : 
   331       EdgeMapWrapper(leda_edge_array<T>& _leda_stuff) : 
   332 	leda_stuff(_leda_stuff) { }
   332 	leda_stuff(_leda_stuff) { }
   333       //EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   333       //EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {}
   334 
   334