author | klao |
Fri, 04 Jun 2004 16:05:20 +0000 | |
changeset 675 | 38755a4d4b51 |
parent 627 | 6cc21a9c9fda |
child 698 | 625de6f1e766 |
permissions | -rw-r--r-- |
deba@378 | 1 |
#include <iostream> |
deba@595 | 2 |
#include <cstdlib> |
deba@378 | 3 |
#include "test_graph.h" |
deba@378 | 4 |
|
deba@378 | 5 |
using namespace std; |
deba@378 | 6 |
using namespace hugo; |
deba@378 | 7 |
|
deba@378 | 8 |
|
deba@378 | 9 |
int main() { |
deba@627 | 10 |
ListGraph g; |
deba@627 | 11 |
for (int i = 0; i < 10; ++i) { |
deba@627 | 12 |
ListGraph::Node node = g.addNode(); |
deba@627 | 13 |
} |
deba@674 | 14 |
ListGraph::NodeMap<int> map(g); |
deba@627 | 15 |
for (int i = 0; i < 10; ++i) { |
deba@627 | 16 |
ListGraph::Node node = g.addNode(); |
deba@627 | 17 |
map[node] = rand()%100; |
deba@627 | 18 |
} |
deba@627 | 19 |
for (ListGraph::NodeIt it(g); g.valid(it); g.next(it)) { |
deba@627 | 20 |
cout << map[it] << endl; |
deba@627 | 21 |
} |
deba@627 | 22 |
return 0; |
deba@378 | 23 |
} |
deba@378 | 24 |