Set up automake environment.
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 ValueType() const
26 std::cout << G.id(G.tail(e)) << "->"
27 << G.id(G.head(e)) << ": ";
31 ValueType operator = (ValueType v) const
33 std::cout << G.id(G.tail(e)) << "->"
34 << G.id(G.head(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(ValueType v) : val(v) { }
58 operator ValueType() const { return val; }
59 ValueType operator = (ValueType v) const { return val; }
65 NullMap(ValueType v) : val(v) { }
66 RefType operator[] (KeyType 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];