Changeset 713:57c0b110b31e in lemon-0.x for src/hugo
- Timestamp:
- 07/20/04 12:58:11 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@965
- Location:
- src/hugo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/full_graph.h
r710 r713 78 78 e=InEdgeIt(*this,v); return e; } 79 79 80 static bool valid(Edge e) const{ return e.n!=-1; }81 static bool valid(Node n) const{ return n.n!=-1; }80 static bool valid(Edge e) { return e.n!=-1; } 81 static bool valid(Node n) { return n.n!=-1; } 82 82 83 83 template <typename It> It getNext(It it) const … … 92 92 InEdgeIt& next(InEdgeIt& it) const 93 93 { if(!((++it.n)%NodeNum)) it.n=-1; return it; } 94 static EdgeIt& next(EdgeIt& it) const{ --it.n; return it; }95 96 static int id(Node v) const{ return v.n; }97 static int id(Edge e) const{ return e.n; }94 static EdgeIt& next(EdgeIt& it) { --it.n; return it; } 95 96 static int id(Node v) { return v.n; } 97 static int id(Edge e) { return e.n; } 98 98 99 99 class Node { -
src/hugo/list_graph.h
r710 r713 138 138 Node bNode(InEdgeIt e) const { return edges[e.n].tail; } 139 139 140 staticNodeIt& first(NodeIt& v) const {140 NodeIt& first(NodeIt& v) const { 141 141 v=NodeIt(*this); return v; } 142 staticEdgeIt& first(EdgeIt& e) const {142 EdgeIt& first(EdgeIt& e) const { 143 143 e=EdgeIt(*this); return e; } 144 staticOutEdgeIt& first(OutEdgeIt& e, const Node v) const {144 OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 145 145 e=OutEdgeIt(*this,v); return e; } 146 staticInEdgeIt& first(InEdgeIt& e, const Node v) const {146 InEdgeIt& first(InEdgeIt& e, const Node v) const { 147 147 e=InEdgeIt(*this,v); return e; } 148 148 … … 153 153 // It first(Node v) const { It e; first(e,v); return e; } 154 154 155 static bool valid(Edge e) const{ return e.n!=-1; }156 static bool valid(Node n) const{ return n.n!=-1; }155 static bool valid(Edge e) { return e.n!=-1; } 156 static bool valid(Node n) { return n.n!=-1; } 157 157 158 158 static void setInvalid(Edge &e) { e.n=-1; } 159 159 static void setInvalid(Node &n) { n.n=-1; } 160 160 161 template <typename It> static It getNext(It it) const161 template <typename It> static It getNext(It it) 162 162 { It tmp(it); return next(tmp); } 163 163 … … 184 184 } 185 185 186 static int id(Node v) const{ return v.n; }187 static int id(Edge e) const{ return e.n; }186 static int id(Node v) { return v.n; } 187 static int id(Edge e) { return e.n; } 188 188 189 189 /// Adds a new node to the graph. … … 628 628 ///Returns the oppositely directed 629 629 ///pair of the edge \c e. 630 static Edge opposite(Edge e) const630 static Edge opposite(Edge e) 631 631 { 632 632 Edge f; -
src/hugo/smart_graph.h
r706 r713 137 137 // It first(Node v) const { It e; first(e,v); return e; } 138 138 139 bool valid(Edge e) const{ return e.n!=-1; }140 bool valid(Node n) const{ return n.n!=-1; }139 static bool valid(Edge e) { return e.n!=-1; } 140 static bool valid(Node n) { return n.n!=-1; } 141 141 142 142 ///\deprecated Use … … 145 145 ///\endcode 146 146 ///instead. 147 void setInvalid(Edge &e) { e.n=-1; }147 static void setInvalid(Edge &e) { e.n=-1; } 148 148 ///\deprecated Use 149 149 ///\code … … 151 151 ///\endcode 152 152 ///instead. 153 void setInvalid(Node &n) { n.n=-1; }153 static void setInvalid(Node &n) { n.n=-1; } 154 154 155 155 template <typename It> It getNext(It it) const … … 166 166 EdgeIt& next(EdgeIt& it) const { --it.n; return it; } 167 167 168 int id(Node v) const{ return v.n; }169 int id(Edge e) const{ return e.n; }168 static int id(Node v) { return v.n; } 169 static int id(Edge e) { return e.n; } 170 170 171 171 Node addNode() { … … 504 504 ///Returns the oppositely directed 505 505 ///pair of the edge \c e. 506 Edge opposite(Edge e) const506 static Edge opposite(Edge e) 507 507 { 508 508 Edge f;
Note: See TracChangeset
for help on using the changeset viewer.