We have UndirGraph, so BidirGraph has been removed.
2 #include <smart_graph.h>
6 template<class GG,class TT>
11 typedef typename GG::Edge Edge;
21 RefType(Graph &_G,Edge _e) : G(_G), e(_e) { }
23 operator Value() const
26 std::cout << G.id(G.source(e)) << "->"
27 << G.id(G.target(e)) << ": ";
31 Value operator = (Value v) const
33 std::cout << G.id(G.source(e)) << "->"
34 << G.id(G.target(e)) << ": " << v << '\n';
42 CinCoutMap(Graph &_G) : G(_G) { }
43 RefType operator[] (Edge e) const { return RefType(G,e);}
46 template<class K,class T>
57 RefType(Value v) : val(v) { }
58 operator Value() const { return val; }
59 Value operator = (Value v) const { return val; }
65 NullMap(Value v) : val(v) { }
66 RefType operator[] (Key e) const { return RefType(v);}
71 typedef SmartGraph Graph;
72 typedef Graph::NodeIt NodeIt;
73 typedef Graph::OutEdgeIt OutEdgeIt;
74 typedef Graph::EdgeIt EdgeIt;
78 CinCoutMap<Graph,int> map(G);
80 Graph::EdgeMap<int> emap(G);
82 for(int i=0;i<3;i++) G.addNode();
84 for(NodeIt n(G);G.valid(n);G.next(n))
85 for(NodeIt m(G);G.valid(m);G.next(m)) if(n!=m)
88 //for(OutEdgeIt e(G,NodeIt(G));G.valid(e);G.next(e))
90 for(EdgeIt e(G);G.valid(e);G.next(e)) emap[e] = map[e];
94 for(EdgeIt e(G);G.valid(e);G.next(e)) map[e] = emap[e];