src/hugo/list_graph.h
changeset 710 891f99700ea1
parent 706 0fe42b8ec5a6
child 713 57c0b110b31e
     1.1 --- a/src/hugo/list_graph.h	Mon Jul 19 13:32:28 2004 +0000
     1.2 +++ b/src/hugo/list_graph.h	Tue Jul 20 09:43:12 2004 +0000
     1.3 @@ -137,13 +137,13 @@
     1.4      Node bNode(OutEdgeIt e) const { return edges[e.n].head; }
     1.5      Node bNode(InEdgeIt e) const { return edges[e.n].tail; }
     1.6  
     1.7 -    NodeIt& first(NodeIt& v) const { 
     1.8 +    static NodeIt& first(NodeIt& v) const { 
     1.9        v=NodeIt(*this); return v; }
    1.10 -    EdgeIt& first(EdgeIt& e) const { 
    1.11 +    static EdgeIt& first(EdgeIt& e) const { 
    1.12        e=EdgeIt(*this); return e; }
    1.13 -    OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    1.14 +    static OutEdgeIt& first(OutEdgeIt& e, const Node v) const { 
    1.15        e=OutEdgeIt(*this,v); return e; }
    1.16 -    InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    1.17 +    static InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    1.18        e=InEdgeIt(*this,v); return e; }
    1.19  
    1.20  //     template< typename It >
    1.21 @@ -152,13 +152,13 @@
    1.22  //     template< typename It >
    1.23  //     It first(Node v) const { It e; first(e,v); return e; }
    1.24  
    1.25 -    bool valid(Edge e) const { return e.n!=-1; }
    1.26 -    bool valid(Node n) const { return n.n!=-1; }
    1.27 +    static bool valid(Edge e) const { return e.n!=-1; }
    1.28 +    static bool valid(Node n) const { return n.n!=-1; }
    1.29      
    1.30 -    void setInvalid(Edge &e) { e.n=-1; }
    1.31 -    void setInvalid(Node &n) { n.n=-1; }
    1.32 +    static void setInvalid(Edge &e) { e.n=-1; }
    1.33 +    static void setInvalid(Node &n) { n.n=-1; }
    1.34      
    1.35 -    template <typename It> It getNext(It it) const
    1.36 +    template <typename It> static It getNext(It it) const
    1.37      { It tmp(it); return next(tmp); }
    1.38  
    1.39      NodeIt& next(NodeIt& it) const { 
    1.40 @@ -183,8 +183,8 @@
    1.41        return it;
    1.42      }
    1.43  
    1.44 -    int id(Node v) const { return v.n; }
    1.45 -    int id(Edge e) const { return e.n; }
    1.46 +    static int id(Node v) const { return v.n; }
    1.47 +    static int id(Edge e) const { return e.n; }
    1.48  
    1.49      /// Adds a new node to the graph.
    1.50  
    1.51 @@ -627,7 +627,7 @@
    1.52  
    1.53      ///Returns the oppositely directed
    1.54      ///pair of the edge \c e.
    1.55 -    Edge opposite(Edge e) const
    1.56 +    static Edge opposite(Edge e) const
    1.57      {
    1.58        Edge f;
    1.59        f.idref() = e.idref() - 2*(e.idref()%2) + 1;