| ... | ... |
@@ -549,25 +549,25 @@ |
| 549 | 549 |
static Node nodeFromId(int id) { return Node(id);}
|
| 550 | 550 |
static Arc arcFromId(int id) { return Arc(id);}
|
| 551 | 551 |
static Edge edgeFromId(int id) { return Edge(id);}
|
| 552 | 552 |
|
| 553 | 553 |
Node addNode() {
|
| 554 | 554 |
int n = nodes.size(); |
| 555 | 555 |
nodes.push_back(NodeT()); |
| 556 | 556 |
nodes[n].first_out = -1; |
| 557 | 557 |
|
| 558 | 558 |
return Node(n); |
| 559 | 559 |
} |
| 560 | 560 |
|
| 561 |
Edge |
|
| 561 |
Edge addEdge(Node u, Node v) {
|
|
| 562 | 562 |
int n = arcs.size(); |
| 563 | 563 |
arcs.push_back(ArcT()); |
| 564 | 564 |
arcs.push_back(ArcT()); |
| 565 | 565 |
|
| 566 | 566 |
arcs[n].target = u._id; |
| 567 | 567 |
arcs[n | 1].target = v._id; |
| 568 | 568 |
|
| 569 | 569 |
arcs[n].next_out = nodes[v._id].first_out; |
| 570 | 570 |
nodes[v._id].first_out = n; |
| 571 | 571 |
|
| 572 | 572 |
arcs[n | 1].next_out = nodes[u._id].first_out; |
| 573 | 573 |
nodes[u._id].first_out = (n | 1); |
| ... | ... |
@@ -630,25 +630,25 @@ |
| 630 | 630 |
///Add a new node to the graph. |
| 631 | 631 |
|
| 632 | 632 |
/// \return the new node. |
| 633 | 633 |
/// |
| 634 | 634 |
Node addNode() { return Parent::addNode(); }
|
| 635 | 635 |
|
| 636 | 636 |
///Add a new edge to the graph. |
| 637 | 637 |
|
| 638 | 638 |
///Add a new edge to the graph with node \c s |
| 639 | 639 |
///and \c t. |
| 640 | 640 |
///\return the new edge. |
| 641 | 641 |
Edge addEdge(const Node& s, const Node& t) {
|
| 642 |
return Parent:: |
|
| 642 |
return Parent::addEdge(s, t); |
|
| 643 | 643 |
} |
| 644 | 644 |
|
| 645 | 645 |
///Clear the graph. |
| 646 | 646 |
|
| 647 | 647 |
///Erase all the nodes and edges from the graph. |
| 648 | 648 |
/// |
| 649 | 649 |
void clear() {
|
| 650 | 650 |
Parent::clear(); |
| 651 | 651 |
} |
| 652 | 652 |
|
| 653 | 653 |
public: |
| 654 | 654 |
|
0 comments (0 inline)