diff -r a34e5a909e97 -r ee17030e5f47 src/work/alpar/smart_graph_demo.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/work/alpar/smart_graph_demo.cc Sun Mar 07 19:33:34 2004 +0000 @@ -0,0 +1,36 @@ +#include + +#include + +using namespace hugo; + +SmartGraph::OutEdgeIt safeFirstOut(const SmartGraph &G, SmartGraph::NodeIt n) +{ + return G.valid(n) ? SmartGraph::OutEdgeIt(G,n):Invalid; +} + +int main() +{ + + typedef SmartGraph::EdgeIt EdgeIt; + typedef SmartGraph::InEdgeIt InEdgeIt; + typedef SmartGraph::OutEdgeIt OutEdgeIt; + typedef SmartGraph::EachEdgeIt EachEdgeIt; + typedef SmartGraph::NodeIt NodeIt; + typedef SmartGraph::EachNodeIt EachNodeIt; + + SmartGraph G; + EachNodeIt n; + + + // std::cout.form("%s: %d\n","Sztring",15); + + for(int i=0;i<10;i++) G.addNode(); + for(G.getFirst(n);G.valid(n);G.next(n)) + for(EachNodeIt m(G);m!=Invalid;G.next(m)) + if(n!=m) G.addEdge(n,m); + + OutEdgeIt e = safeFirstOut(G,n); + OutEdgeIt f = safeFirstOut(G,EachNodeIt(G)); + +}