[Lemon-commits] [lemon_svn] alpar: r965 - hugo/trunk/src/hugo

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:42:28 CET 2006


Author: alpar
Date: Tue Jul 20 12:58:11 2004
New Revision: 965

Modified:
   hugo/trunk/src/hugo/full_graph.h
   hugo/trunk/src/hugo/list_graph.h
   hugo/trunk/src/hugo/smart_graph.h

Log:
Oops: "static" and "const" does not like each other.




Modified: hugo/trunk/src/hugo/full_graph.h
==============================================================================
--- hugo/trunk/src/hugo/full_graph.h	(original)
+++ hugo/trunk/src/hugo/full_graph.h	Tue Jul 20 12:58:11 2004
@@ -77,8 +77,8 @@
     InEdgeIt& first(InEdgeIt& e, const Node v) const { 
       e=InEdgeIt(*this,v); return e; }
 
-    static bool valid(Edge e) const { return e.n!=-1; }
-    static bool valid(Node n) const { return n.n!=-1; }
+    static bool valid(Edge e) { return e.n!=-1; }
+    static bool valid(Node n) { return n.n!=-1; }
     
     template <typename It> It getNext(It it) const
     { It tmp(it); return next(tmp); }
@@ -91,10 +91,10 @@
     { it.n+=NodeNum; if(it.n>=EdgeNum) it.n=-1; return it; }
     InEdgeIt& next(InEdgeIt& it) const
     { if(!((++it.n)%NodeNum)) it.n=-1; return it; }
-    static EdgeIt& next(EdgeIt& it) const { --it.n; return it; }
+    static EdgeIt& next(EdgeIt& it) { --it.n; return it; }
 
-    static int id(Node v) const { return v.n; }
-    static int id(Edge e) const { return e.n; }
+    static int id(Node v) { return v.n; }
+    static int id(Edge e) { return e.n; }
 
     class Node {
       friend class FullGraph;

Modified: hugo/trunk/src/hugo/list_graph.h
==============================================================================
--- hugo/trunk/src/hugo/list_graph.h	(original)
+++ hugo/trunk/src/hugo/list_graph.h	Tue Jul 20 12:58:11 2004
@@ -137,13 +137,13 @@
     Node bNode(OutEdgeIt e) const { return edges[e.n].head; }
     Node bNode(InEdgeIt e) const { return edges[e.n].tail; }
 
-    static NodeIt& first(NodeIt& v) const { 
+    NodeIt& first(NodeIt& v) const { 
       v=NodeIt(*this); return v; }
-    static EdgeIt& first(EdgeIt& e) const { 
+    EdgeIt& first(EdgeIt& e) const { 
       e=EdgeIt(*this); return e; }
-    static OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
+    OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
       e=OutEdgeIt(*this,v); return e; }
-    static InEdgeIt& first(InEdgeIt& e, const Node v) const { 
+    InEdgeIt& first(InEdgeIt& e, const Node v) const { 
       e=InEdgeIt(*this,v); return e; }
 
 //     template< typename It >
@@ -152,13 +152,13 @@
 //     template< typename It >
 //     It first(Node v) const { It e; first(e,v); return e; }
 
-    static bool valid(Edge e) const { return e.n!=-1; }
-    static bool valid(Node n) const { return n.n!=-1; }
+    static bool valid(Edge e) { return e.n!=-1; }
+    static bool valid(Node n) { return n.n!=-1; }
     
     static void setInvalid(Edge &e) { e.n=-1; }
     static void setInvalid(Node &n) { n.n=-1; }
     
-    template <typename It> static It getNext(It it) const
+    template <typename It> static It getNext(It it)
     { It tmp(it); return next(tmp); }
 
     NodeIt& next(NodeIt& it) const { 
@@ -183,8 +183,8 @@
       return it;
     }
 
-    static int id(Node v) const { return v.n; }
-    static int id(Edge e) const { return e.n; }
+    static int id(Node v) { return v.n; }
+    static int id(Edge e) { return e.n; }
 
     /// Adds a new node to the graph.
 
@@ -627,7 +627,7 @@
 
     ///Returns the oppositely directed
     ///pair of the edge \c e.
-    static Edge opposite(Edge e) const
+    static Edge opposite(Edge e)
     {
       Edge f;
       f.idref() = e.idref() - 2*(e.idref()%2) + 1;

Modified: hugo/trunk/src/hugo/smart_graph.h
==============================================================================
--- hugo/trunk/src/hugo/smart_graph.h	(original)
+++ hugo/trunk/src/hugo/smart_graph.h	Tue Jul 20 12:58:11 2004
@@ -136,21 +136,21 @@
 //     template< typename It >
 //     It first(Node v) const { It e; first(e,v); return e; }
 
-    bool valid(Edge e) const { return e.n!=-1; }
-    bool valid(Node n) const { return n.n!=-1; }
+    static bool valid(Edge e) { return e.n!=-1; }
+    static bool valid(Node n) { return n.n!=-1; }
     
     ///\deprecated Use
     ///\code
     ///  e=INVALID;
     ///\endcode
     ///instead.
-    void setInvalid(Edge &e) { e.n=-1; }
+    static void setInvalid(Edge &e) { e.n=-1; }
     ///\deprecated Use
     ///\code
     ///  e=INVALID;
     ///\endcode
     ///instead.
-    void setInvalid(Node &n) { n.n=-1; }
+    static void setInvalid(Node &n) { n.n=-1; }
     
     template <typename It> It getNext(It it) const
     { It tmp(it); return next(tmp); }
@@ -165,8 +165,8 @@
     { it.n=edges[it.n].next_in; return it; }
     EdgeIt& next(EdgeIt& it) const { --it.n; return it; }
 
-    int id(Node v) const { return v.n; }
-    int id(Edge e) const { return e.n; }
+    static int id(Node v) { return v.n; }
+    static int id(Edge e) { return e.n; }
 
     Node addNode() {
       Node n; n.n=nodes.size();
@@ -503,7 +503,7 @@
 
     ///Returns the oppositely directed
     ///pair of the edge \c e.
-    Edge opposite(Edge e) const
+    static Edge opposite(Edge e)
     {
       Edge f;
       f.idref() = e.idref() - 2*(e.idref()%2) + 1;



More information about the Lemon-commits mailing list