lemon/edge_set.h
changeset 689 86c49553fea5
parent 660 d9cf3b5858ae
child 778 a143f19f465b
equal deleted inserted replaced
4:1e1e30ba2c6f 5:fb590dfdaa58
    82       bool operator<(const Arc& arc) const { return id < arc.id; }
    82       bool operator<(const Arc& arc) const { return id < arc.id; }
    83     };
    83     };
    84 
    84 
    85     ListArcSetBase() : first_arc(-1), first_free_arc(-1) {}
    85     ListArcSetBase() : first_arc(-1), first_free_arc(-1) {}
    86 
    86 
       
    87     Node addNode() {
       
    88       LEMON_ASSERT(false,
       
    89         "This graph structure does not support node insertion");
       
    90       return INVALID; // avoid warning
       
    91     }
       
    92 
    87     Arc addArc(const Node& u, const Node& v) {
    93     Arc addArc(const Node& u, const Node& v) {
    88       int n;
    94       int n;
    89       if (first_free_arc == -1) {
    95       if (first_free_arc == -1) {
    90         n = arcs.size();
    96         n = arcs.size();
    91         arcs.push_back(ArcT());
    97         arcs.push_back(ArcT());
   413       bool operator!=(const Arc& arc) const { return id != arc.id; }
   419       bool operator!=(const Arc& arc) const { return id != arc.id; }
   414       bool operator<(const Arc& arc) const { return id < arc.id; }
   420       bool operator<(const Arc& arc) const { return id < arc.id; }
   415     };
   421     };
   416 
   422 
   417     ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {}
   423     ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {}
       
   424 
       
   425     Node addNode() {
       
   426       LEMON_ASSERT(false,
       
   427         "This graph structure does not support node insertion");
       
   428       return INVALID; // avoid warning
       
   429     }
   418 
   430 
   419     Edge addEdge(const Node& u, const Node& v) {
   431     Edge addEdge(const Node& u, const Node& v) {
   420       int n;
   432       int n;
   421 
   433 
   422       if (first_free_arc == -1) {
   434       if (first_free_arc == -1) {
   814       bool operator<(const Arc& arc) const { return id < arc.id; }
   826       bool operator<(const Arc& arc) const { return id < arc.id; }
   815     };
   827     };
   816 
   828 
   817     SmartArcSetBase() {}
   829     SmartArcSetBase() {}
   818 
   830 
       
   831     Node addNode() {
       
   832       LEMON_ASSERT(false,
       
   833         "This graph structure does not support node insertion");
       
   834       return INVALID; // avoid warning
       
   835     }
       
   836 
   819     Arc addArc(const Node& u, const Node& v) {
   837     Arc addArc(const Node& u, const Node& v) {
   820       int n = arcs.size();
   838       int n = arcs.size();
   821       arcs.push_back(ArcT());
   839       arcs.push_back(ArcT());
   822       arcs[n].next_in = (*_nodes)[v].first_in;
   840       arcs[n].next_in = (*_nodes)[v].first_in;
   823       (*_nodes)[v].first_in = n;
   841       (*_nodes)[v].first_in = n;
  1110       bool operator<(const Arc& arc) const { return id < arc.id; }
  1128       bool operator<(const Arc& arc) const { return id < arc.id; }
  1111     };
  1129     };
  1112 
  1130 
  1113     SmartEdgeSetBase() {}
  1131     SmartEdgeSetBase() {}
  1114 
  1132 
       
  1133     Node addNode() {
       
  1134       LEMON_ASSERT(false,
       
  1135         "This graph structure does not support node insertion");
       
  1136       return INVALID; // avoid warning
       
  1137     }
       
  1138 
  1115     Edge addEdge(const Node& u, const Node& v) {
  1139     Edge addEdge(const Node& u, const Node& v) {
  1116       int n = arcs.size();
  1140       int n = arcs.size();
  1117       arcs.push_back(ArcT());
  1141       arcs.push_back(ArcT());
  1118       arcs.push_back(ArcT());
  1142       arcs.push_back(ArcT());
  1119 
  1143