equal
deleted
inserted
replaced
75 OutEdgeIt& first(OutEdgeIt& e, const Node v) const { |
75 OutEdgeIt& first(OutEdgeIt& e, const Node v) const { |
76 e=OutEdgeIt(*this,v); return e; } |
76 e=OutEdgeIt(*this,v); return e; } |
77 InEdgeIt& first(InEdgeIt& e, const Node v) const { |
77 InEdgeIt& first(InEdgeIt& e, const Node v) const { |
78 e=InEdgeIt(*this,v); return e; } |
78 e=InEdgeIt(*this,v); return e; } |
79 |
79 |
80 static bool valid(Edge e) const { return e.n!=-1; } |
80 static bool valid(Edge e) { return e.n!=-1; } |
81 static bool valid(Node n) const { return n.n!=-1; } |
81 static bool valid(Node n) { return n.n!=-1; } |
82 |
82 |
83 template <typename It> It getNext(It it) const |
83 template <typename It> It getNext(It it) const |
84 { It tmp(it); return next(tmp); } |
84 { It tmp(it); return next(tmp); } |
85 |
85 |
86 NodeIt& next(NodeIt& it) const { |
86 NodeIt& next(NodeIt& it) const { |
89 } |
89 } |
90 OutEdgeIt& next(OutEdgeIt& it) const |
90 OutEdgeIt& next(OutEdgeIt& it) const |
91 { it.n+=NodeNum; if(it.n>=EdgeNum) it.n=-1; return it; } |
91 { it.n+=NodeNum; if(it.n>=EdgeNum) it.n=-1; return it; } |
92 InEdgeIt& next(InEdgeIt& it) const |
92 InEdgeIt& next(InEdgeIt& it) const |
93 { if(!((++it.n)%NodeNum)) it.n=-1; return it; } |
93 { if(!((++it.n)%NodeNum)) it.n=-1; return it; } |
94 static EdgeIt& next(EdgeIt& it) const { --it.n; return it; } |
94 static EdgeIt& next(EdgeIt& it) { --it.n; return it; } |
95 |
95 |
96 static int id(Node v) const { return v.n; } |
96 static int id(Node v) { return v.n; } |
97 static int id(Edge e) const { return e.n; } |
97 static int id(Edge e) { return e.n; } |
98 |
98 |
99 class Node { |
99 class Node { |
100 friend class FullGraph; |
100 friend class FullGraph; |
101 template <typename T> friend class NodeMap; |
101 template <typename T> friend class NodeMap; |
102 |
102 |