alpar@157: #include alpar@157: alpar@157: #include alpar@157: alpar@157: using namespace hugo; alpar@157: alpar@157: SmartGraph::OutEdgeIt safeFirstOut(const SmartGraph &G, SmartGraph::NodeIt n) alpar@157: { alpar@157: return G.valid(n) ? SmartGraph::OutEdgeIt(G,n):Invalid; alpar@157: } alpar@157: alpar@157: int main() alpar@157: { alpar@157: alpar@157: typedef SmartGraph::EdgeIt EdgeIt; alpar@157: typedef SmartGraph::InEdgeIt InEdgeIt; alpar@157: typedef SmartGraph::OutEdgeIt OutEdgeIt; alpar@157: typedef SmartGraph::EachEdgeIt EachEdgeIt; alpar@157: typedef SmartGraph::NodeIt NodeIt; alpar@157: typedef SmartGraph::EachNodeIt EachNodeIt; alpar@157: alpar@157: SmartGraph G; alpar@157: EachNodeIt n; alpar@157: alpar@157: alpar@157: // std::cout.form("%s: %d\n","Sztring",15); alpar@157: alpar@157: for(int i=0;i<10;i++) G.addNode(); alpar@157: for(G.getFirst(n);G.valid(n);G.next(n)) alpar@157: for(EachNodeIt m(G);m!=Invalid;G.next(m)) alpar@157: if(n!=m) G.addEdge(n,m); alpar@157: alpar@157: OutEdgeIt e = safeFirstOut(G,n); alpar@157: OutEdgeIt f = safeFirstOut(G,EachNodeIt(G)); alpar@157: alpar@157: }