# HG changeset patch # User marci # Date 1076067947 0 # Node ID 5f86199dcf3ecd72412d1503dce99ceb468dad60 # Parent cd56b9c11492f6b07b610ef9d9f93a5507b4b763 . diff -r cd56b9c11492 -r 5f86199dcf3e src/work/alpar/emptygraph.h --- a/src/work/alpar/emptygraph.h Thu Feb 05 17:35:42 2004 +0000 +++ b/src/work/alpar/emptygraph.h Fri Feb 06 11:45:47 2004 +0000 @@ -5,66 +5,67 @@ public: class EdgeIt {}; - class InEdgeIt : public EdgeIt + class InEdgeIt : public EdgeIt {}; class OutEdgeIt : public EdgeIt {}; class SymEdgeIt : public EdgeIt {}; class EachEdgeIt : public EdgeIt {}; class NodeIt {}; - NodeIt &getFirst(NodeIt &) const {}; - InEdgeIt &getFirst(InEdgeIt &,const NodeIt) const {}; - OutEdgeIt &getFirst(OutEdgeIt &,const NodeIt) const {}; - SymEdgeIt &getFirst(SymEdgeIt &,const NodeIt) const {}; - EachEdgeIt &getFirst(EachEdgeIt &) const {}; + NodeIt &getFirst(NodeIt &) const {} + InEdgeIt &getFirst(InEdgeIt &, NodeIt) const {} + OutEdgeIt &getFirst(OutEdgeIt &, NodeIt) const {} + SymEdgeIt &getFirst(SymEdgeIt &, NodeIt) const {} + EachEdgeIt &getFirst(EachEdgeIt &) const {} - NodeIt next(const NodeIt) const {}; - InEdgeIt next(const InEdgeIt) const {}; - OutEdgeIt next(const OutEdgeIt) const {}; - SymEdgeIt next(const SymEdgeIt) const {}; - EachEdgeIt next(const EachEdgeIt) const {}; + NodeIt next(NodeIt) const {} + InEdgeIt next(InEdgeIt) const {} + OutEdgeIt next(OutEdgeIt) const {} + SymEdgeIt next(SymEdgeIt) const {} + EachEdgeIt next(EachEdgeIt) const {} - NodeIt &goNext(NodeIt &) const {}; - InEdgeIt &goNext(InEdgeIt &) const {}; - OutEdgeIt &goNext(OutEdgeIt &) const {}; - SymEdgeIt &goNext(SymEdgeIt &) const {}; - EachEdgeIt &goNext(EachEdgeIt &) const {}; + NodeIt &goNext(NodeIt &) const {} + InEdgeIt &goNext(InEdgeIt &) const {} + OutEdgeIt &goNext(OutEdgeIt &) const {} + SymEdgeIt &goNext(SymEdgeIt &) const {} + EachEdgeIt &goNext(EachEdgeIt &) const {} - NodeIt head(const EdgeIt) const {}; - NodeIt tail(const EdgeIt) const {}; + NodeIt head(EdgeIt) const {} + NodeIt tail(EdgeIt) const {} - NodeIt aNode(const InEdgeIt) const {}; - NodeIt aNode(const OutEdgeIt) const {}; - NodeIt aNode(const SymEdgeIt) const {}; + NodeIt aNode(InEdgeIt) const {} + NodeIt aNode(OutEdgeIt) const {} + NodeIt aNode(SymEdgeIt) const {} - NodeIt bNode(const InEdgeIt) const {}; - NodeIt bNode(const OutEdgeIt) const {}; - NodeIt bNode(const SymEdgeIt) const {}; + NodeIt bNode(InEdgeIt) const {} + NodeIt bNode(OutEdgeIt) const {} + NodeIt bNode(SymEdgeIt) const {} - bool valid(const NodeIt) const {}; - bool valid(const EdgeIt) const {}; + //bool valid(const NodeIt) const {}; + //bool valid(const EdgeIt) const {}; - void setInvalid(NodeIt &) const {}; - void setInvalid(EdgeIt &) const {}; + //void setInvalid(NodeIt &) const {}; + //void setInvalid(EdgeIt &) const {}; - NodeIt addNode() {}; - EdgeIt addEdge(const NodeIt from,const NodeIt to) {}; + NodeIt addNode() {} + EdgeIt addEdge(NodeIt tail, NodeIt head) {} - void delete(NodeIt n) {}; - void delete(EdgeIt e) {}; + void erase(NodeIt n) {} + void erase(EdgeIt e) {} - void clear() {}; + void clear() {} template class NodeMap { public: typedef T ValueType; typedef NodeIt KeyType; - void set(const NodeIt i, const T &t) {}; - T get(const NodeIt i) const {}; - T &operator[](const NodeIt i) {}; + void set(NodeIt i, T t) {} + T get(NodeIt i) const {} + T &operator[](NodeIt i) {} - NodeMap(const Graph &G) {}; + NodeMap(const Graph &G) {} + NodeMap(const Graph &G, T t) {} }; template class EdgeMap @@ -72,10 +73,11 @@ public: typedef T ValueType; typedef EdgeIt KeyType; - void set(const EdgeIt i, const T &t) {}; - T get(const EdgeIt i) const {}; - T &operator[](const EdgeIt i) {}; + void set(EdgeIt i, T t) {} + T get(EdgeIt i) const {} + T &operator[](EdgeIt i) {} - EdgeMap(const Graph &G) {}; + EdgeMap(const Graph &G) {} + EdgeMap(const Graph &G, T t) {} }; }; diff -r cd56b9c11492 -r 5f86199dcf3e src/work/list_graph.hh --- a/src/work/list_graph.hh Thu Feb 05 17:35:42 2004 +0000 +++ b/src/work/list_graph.hh Fri Feb 06 11:45:47 2004 +0000 @@ -212,7 +212,7 @@ ListGraph() : node_id(0), edge_id(0), _node_num(0), _edge_num(0), _first_node(0), _last_node(0) { } ~ListGraph() { - while (first().valid()) deleteNode(first()); + while (first().valid()) erase(first()); } int nodeNum() const { return _node_num; } @@ -293,13 +293,13 @@ return EdgeIt(_add_edge(u.node, v.node)); } - void deleteNode(NodeIt i) { - while (first(i).valid()) deleteEdge(first(i)); - while (first(i).valid()) deleteEdge(first(i)); + void erase(NodeIt i) { + while (first(i).valid()) erase(first(i)); + while (first(i).valid()) erase(first(i)); _delete_node(i.node); } - void deleteEdge(EdgeIt e) { _delete_edge(e.edge); } + void erase(EdgeIt e) { _delete_edge(e.edge); } void setTail(EdgeIt e, NodeIt tail) { _set_tail(e.edge, tail.node);