src/work/peter/edgepathgraph.h
changeset 986 e997802b855c
parent 921 818510fa3d99
child 987 87f7c54892df
equal deleted inserted replaced
3:3b69d53ec2e7 4:c3e9d205cd8a
    71       for(EdgeIt e(actuallayer);actuallayer.valid(e);actuallayer.next(e))
    71       for(EdgeIt e(actuallayer);actuallayer.valid(e);actuallayer.next(e))
    72       {
    72       {
    73 	typedef typename P::EdgeIt PEdgeIt;
    73 	typedef typename P::EdgeIt PEdgeIt;
    74 	PEdgeIt f;
    74 	PEdgeIt f;
    75 
    75 
    76 	//dep//cout << "Edge " << id(tail(e)) << " - " << id(head(e)) << " in actual layer is";
    76 	//dep//cout << "Edge " << id(source(e)) << " - " << id(target(e)) << " in actual layer is";
    77 	T1 incr=actmap[e];
    77 	T1 incr=actmap[e];
    78 	//cout << incr << endl;
    78 	//cout << incr << endl;
    79 
    79 
    80         if(edgepath[e])
    80         if(edgepath[e])
    81 	{
    81 	{
    82 	  //dep//cout << endl << "Path";
    82 	  //dep//cout << endl << "Path";
    83 	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
    83 	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
    84 	  {
    84 	  {
    85 	    //dep//cout << " " << sublayer->id(sublayer->tail(f)) << "-" << sublayer->id(sublayer->head(f));
    85 	    //dep//cout << " " << sublayer->id(sublayer->source(f)) << "-" << sublayer->id(sublayer->target(f));
    86 	    submap[f]+=incr;
    86 	    submap[f]+=incr;
    87 	  }
    87 	  }
    88 	  //dep////cout << EPGr2.id(EPGr2.head(f)) << endl;
    88 	  //dep////cout << EPGr2.id(EPGr2.target(f)) << endl;
    89 	  //dep//cout << endl;
    89 	  //dep//cout << endl;
    90 	}
    90 	}
    91 	else
    91 	else
    92 	{
    92 	{
    93 	  //dep//cout << " itself." <<endl;
    93 	  //dep//cout << " itself." <<endl;
   105       for(EdgeIt e(actuallayer);actuallayer.valid(e);actuallayer.next(e))
   105       for(EdgeIt e(actuallayer);actuallayer.valid(e);actuallayer.next(e))
   106       {
   106       {
   107 	typedef typename P::EdgeIt PEdgeIt;
   107 	typedef typename P::EdgeIt PEdgeIt;
   108 	PEdgeIt f;
   108 	PEdgeIt f;
   109 
   109 
   110 	cout << "Edge " << id(tail(e)) << " - " << id(head(e)) << " in actual layer is";
   110 	cout << "Edge " << id(source(e)) << " - " << id(target(e)) << " in actual layer is";
   111         if(edgepath[e])
   111         if(edgepath[e])
   112 	{
   112 	{
   113 	  cout << endl << "Path";
   113 	  cout << endl << "Path";
   114 	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
   114 	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
   115 	  {
   115 	  {
   116 	    cout << " " << sublayer->id(sublayer->tail(f)) << "-" << sublayer->id(sublayer->head(f));
   116 	    cout << " " << sublayer->id(sublayer->source(f)) << "-" << sublayer->id(sublayer->target(f));
   117 	  }
   117 	  }
   118 	  //cout << EPGr2.id(EPGr2.head(f)) << endl;
   118 	  //cout << EPGr2.id(EPGr2.target(f)) << endl;
   119 	  cout << endl;
   119 	  cout << endl;
   120 	}
   120 	}
   121 	else
   121 	else
   122 	{
   122 	{
   123 	  cout << " itself." <<endl;
   123 	  cout << " itself." <<endl;
   232     typename Gact::OutEdgeIt &next(typename Gact::OutEdgeIt &i) const { return actuallayer.next(i);}
   232     typename Gact::OutEdgeIt &next(typename Gact::OutEdgeIt &i) const { return actuallayer.next(i);}
   233     //SymEdgeIt &next(SymEdgeIt &) const {}
   233     //SymEdgeIt &next(SymEdgeIt &) const {}
   234     /// Go to the next edge.
   234     /// Go to the next edge.
   235     typename Gact::EdgeIt &next(typename Gact::EdgeIt &i) const { return actuallayer.next(i);}
   235     typename Gact::EdgeIt &next(typename Gact::EdgeIt &i) const { return actuallayer.next(i);}
   236 
   236 
   237     ///Gives back the head node of an edge.
   237     ///Gives back the target node of an edge.
   238     typename Gact::Node head(typename Gact::Edge edge) const { return actuallayer.head(edge); }
   238     typename Gact::Node target(typename Gact::Edge edge) const { return actuallayer.target(edge); }
   239     ///Gives back the tail node of an edge.
   239     ///Gives back the source node of an edge.
   240     typename Gact::Node tail(typename Gact::Edge edge) const { return actuallayer.tail(edge); }
   240     typename Gact::Node source(typename Gact::Edge edge) const { return actuallayer.source(edge); }
   241   
   241   
   242     //   Node aNode(InEdgeIt) const {}
   242     //   Node aNode(InEdgeIt) const {}
   243     //   Node aNode(OutEdgeIt) const {}
   243     //   Node aNode(OutEdgeIt) const {}
   244     //   Node aNode(SymEdgeIt) const {}
   244     //   Node aNode(SymEdgeIt) const {}
   245 
   245 
   277     /// \return the new node.
   277     /// \return the new node.
   278     ///
   278     ///
   279     typename Gact::Node addNode() { return actuallayer.addNode();}
   279     typename Gact::Node addNode() { return actuallayer.addNode();}
   280     ///Add a new edge to the graph.
   280     ///Add a new edge to the graph.
   281 
   281 
   282     ///Add a new edge to the graph with tail node \c tail
   282     ///Add a new edge to the graph with source node \c source
   283     ///and head node \c head.
   283     ///and target node \c target.
   284     ///\return the new edge.
   284     ///\return the new edge.
   285     typename Gact::Edge addEdge(typename Gact::Node node1, typename Gact::Node node2) { return actuallayer.addEdge(node1, node2);}
   285     typename Gact::Edge addEdge(typename Gact::Node node1, typename Gact::Node node2) { return actuallayer.addEdge(node1, node2);}
   286     
   286     
   287     /// Resets the graph.
   287     /// Resets the graph.
   288 
   288