Oops: "static" and "const" does not like each other.
authoralpar
Tue, 20 Jul 2004 10:58:11 +0000
changeset 71357c0b110b31e
parent 712 6f1abe741fb6
child 714 104069336039
Oops: "static" and "const" does not like each other.
src/hugo/full_graph.h
src/hugo/list_graph.h
src/hugo/smart_graph.h
     1.1 --- a/src/hugo/full_graph.h	Tue Jul 20 09:52:03 2004 +0000
     1.2 +++ b/src/hugo/full_graph.h	Tue Jul 20 10:58:11 2004 +0000
     1.3 @@ -77,8 +77,8 @@
     1.4      InEdgeIt& first(InEdgeIt& e, const Node v) const { 
     1.5        e=InEdgeIt(*this,v); return e; }
     1.6  
     1.7 -    static bool valid(Edge e) const { return e.n!=-1; }
     1.8 -    static bool valid(Node n) const { return n.n!=-1; }
     1.9 +    static bool valid(Edge e) { return e.n!=-1; }
    1.10 +    static bool valid(Node n) { return n.n!=-1; }
    1.11      
    1.12      template <typename It> It getNext(It it) const
    1.13      { It tmp(it); return next(tmp); }
    1.14 @@ -91,10 +91,10 @@
    1.15      { it.n+=NodeNum; if(it.n>=EdgeNum) it.n=-1; return it; }
    1.16      InEdgeIt& next(InEdgeIt& it) const
    1.17      { if(!((++it.n)%NodeNum)) it.n=-1; return it; }
    1.18 -    static EdgeIt& next(EdgeIt& it) const { --it.n; return it; }
    1.19 +    static EdgeIt& next(EdgeIt& it) { --it.n; return it; }
    1.20  
    1.21 -    static int id(Node v) const { return v.n; }
    1.22 -    static int id(Edge e) const { return e.n; }
    1.23 +    static int id(Node v) { return v.n; }
    1.24 +    static int id(Edge e) { return e.n; }
    1.25  
    1.26      class Node {
    1.27        friend class FullGraph;
     2.1 --- a/src/hugo/list_graph.h	Tue Jul 20 09:52:03 2004 +0000
     2.2 +++ b/src/hugo/list_graph.h	Tue Jul 20 10:58:11 2004 +0000
     2.3 @@ -137,13 +137,13 @@
     2.4      Node bNode(OutEdgeIt e) const { return edges[e.n].head; }
     2.5      Node bNode(InEdgeIt e) const { return edges[e.n].tail; }
     2.6  
     2.7 -    static NodeIt& first(NodeIt& v) const { 
     2.8 +    NodeIt& first(NodeIt& v) const { 
     2.9        v=NodeIt(*this); return v; }
    2.10 -    static EdgeIt& first(EdgeIt& e) const { 
    2.11 +    EdgeIt& first(EdgeIt& e) const { 
    2.12        e=EdgeIt(*this); return e; }
    2.13 -    static OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    2.14 +    OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    2.15        e=OutEdgeIt(*this,v); return e; }
    2.16 -    static InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    2.17 +    InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    2.18        e=InEdgeIt(*this,v); return e; }
    2.19  
    2.20  //     template< typename It >
    2.21 @@ -152,13 +152,13 @@
    2.22  //     template< typename It >
    2.23  //     It first(Node v) const { It e; first(e,v); return e; }
    2.24  
    2.25 -    static bool valid(Edge e) const { return e.n!=-1; }
    2.26 -    static bool valid(Node n) const { return n.n!=-1; }
    2.27 +    static bool valid(Edge e) { return e.n!=-1; }
    2.28 +    static bool valid(Node n) { return n.n!=-1; }
    2.29      
    2.30      static void setInvalid(Edge &e) { e.n=-1; }
    2.31      static void setInvalid(Node &n) { n.n=-1; }
    2.32      
    2.33 -    template <typename It> static It getNext(It it) const
    2.34 +    template <typename It> static It getNext(It it)
    2.35      { It tmp(it); return next(tmp); }
    2.36  
    2.37      NodeIt& next(NodeIt& it) const { 
    2.38 @@ -183,8 +183,8 @@
    2.39        return it;
    2.40      }
    2.41  
    2.42 -    static int id(Node v) const { return v.n; }
    2.43 -    static int id(Edge e) const { return e.n; }
    2.44 +    static int id(Node v) { return v.n; }
    2.45 +    static int id(Edge e) { return e.n; }
    2.46  
    2.47      /// Adds a new node to the graph.
    2.48  
    2.49 @@ -627,7 +627,7 @@
    2.50  
    2.51      ///Returns the oppositely directed
    2.52      ///pair of the edge \c e.
    2.53 -    static Edge opposite(Edge e) const
    2.54 +    static Edge opposite(Edge e)
    2.55      {
    2.56        Edge f;
    2.57        f.idref() = e.idref() - 2*(e.idref()%2) + 1;
     3.1 --- a/src/hugo/smart_graph.h	Tue Jul 20 09:52:03 2004 +0000
     3.2 +++ b/src/hugo/smart_graph.h	Tue Jul 20 10:58:11 2004 +0000
     3.3 @@ -136,21 +136,21 @@
     3.4  //     template< typename It >
     3.5  //     It first(Node v) const { It e; first(e,v); return e; }
     3.6  
     3.7 -    bool valid(Edge e) const { return e.n!=-1; }
     3.8 -    bool valid(Node n) const { return n.n!=-1; }
     3.9 +    static bool valid(Edge e) { return e.n!=-1; }
    3.10 +    static bool valid(Node n) { return n.n!=-1; }
    3.11      
    3.12      ///\deprecated Use
    3.13      ///\code
    3.14      ///  e=INVALID;
    3.15      ///\endcode
    3.16      ///instead.
    3.17 -    void setInvalid(Edge &e) { e.n=-1; }
    3.18 +    static void setInvalid(Edge &e) { e.n=-1; }
    3.19      ///\deprecated Use
    3.20      ///\code
    3.21      ///  e=INVALID;
    3.22      ///\endcode
    3.23      ///instead.
    3.24 -    void setInvalid(Node &n) { n.n=-1; }
    3.25 +    static void setInvalid(Node &n) { n.n=-1; }
    3.26      
    3.27      template <typename It> It getNext(It it) const
    3.28      { It tmp(it); return next(tmp); }
    3.29 @@ -165,8 +165,8 @@
    3.30      { it.n=edges[it.n].next_in; return it; }
    3.31      EdgeIt& next(EdgeIt& it) const { --it.n; return it; }
    3.32  
    3.33 -    int id(Node v) const { return v.n; }
    3.34 -    int id(Edge e) const { return e.n; }
    3.35 +    static int id(Node v) { return v.n; }
    3.36 +    static int id(Edge e) { return e.n; }
    3.37  
    3.38      Node addNode() {
    3.39        Node n; n.n=nodes.size();
    3.40 @@ -503,7 +503,7 @@
    3.41  
    3.42      ///Returns the oppositely directed
    3.43      ///pair of the edge \c e.
    3.44 -    Edge opposite(Edge e) const
    3.45 +    static Edge opposite(Edge e)
    3.46      {
    3.47        Edge f;
    3.48        f.idref() = e.idref() - 2*(e.idref()%2) + 1;