Add artificial addNode() function to the arc/edge set classes
authorPeter Kovacs <kpeter@inf.elte.hu>
Wed, 13 May 2009 10:42:26 +0200
changeset 717926c47568a56
parent 716 4faca85d40e6
child 718 da70af8844b9
child 845 06f816565bef
Add artificial addNode() function to the arc/edge set classes
lemon/edge_set.h
     1.1 --- a/lemon/edge_set.h	Tue May 12 20:08:23 2009 +0200
     1.2 +++ b/lemon/edge_set.h	Wed May 13 10:42:26 2009 +0200
     1.3 @@ -84,6 +84,12 @@
     1.4  
     1.5      ListArcSetBase() : first_arc(-1), first_free_arc(-1) {}
     1.6  
     1.7 +    Node addNode() {
     1.8 +      LEMON_ASSERT(false,
     1.9 +        "This graph structure does not support node insertion");
    1.10 +      return INVALID; // avoid warning
    1.11 +    }
    1.12 +
    1.13      Arc addArc(const Node& u, const Node& v) {
    1.14        int n;
    1.15        if (first_free_arc == -1) {
    1.16 @@ -416,6 +422,12 @@
    1.17  
    1.18      ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {}
    1.19  
    1.20 +    Node addNode() {
    1.21 +      LEMON_ASSERT(false,
    1.22 +        "This graph structure does not support node insertion");
    1.23 +      return INVALID; // avoid warning
    1.24 +    }
    1.25 +
    1.26      Edge addEdge(const Node& u, const Node& v) {
    1.27        int n;
    1.28  
    1.29 @@ -816,6 +828,12 @@
    1.30  
    1.31      SmartArcSetBase() {}
    1.32  
    1.33 +    Node addNode() {
    1.34 +      LEMON_ASSERT(false,
    1.35 +        "This graph structure does not support node insertion");
    1.36 +      return INVALID; // avoid warning
    1.37 +    }
    1.38 +
    1.39      Arc addArc(const Node& u, const Node& v) {
    1.40        int n = arcs.size();
    1.41        arcs.push_back(ArcT());
    1.42 @@ -1112,6 +1130,12 @@
    1.43  
    1.44      SmartEdgeSetBase() {}
    1.45  
    1.46 +    Node addNode() {
    1.47 +      LEMON_ASSERT(false,
    1.48 +        "This graph structure does not support node insertion");
    1.49 +      return INVALID; // avoid warning
    1.50 +    }
    1.51 +
    1.52      Edge addEdge(const Node& u, const Node& v) {
    1.53        int n = arcs.size();
    1.54        arcs.push_back(ArcT());