lemon/johnson.h
changeset 1747 bccf2379b5dd
parent 1741 7a98fe2ed989
child 1754 4bf5ceb49023
equal deleted inserted replaced
3:c24422727ecd 4:6463cb97760a
   492     template DefPredMap<NullMap<Node, Edge> >::
   492     template DefPredMap<NullMap<Node, Edge> >::
   493     Create BelmannFordType;
   493     Create BelmannFordType;
   494 
   494 
   495     void shiftedRun(const BelmannFordType& belmannford) {
   495     void shiftedRun(const BelmannFordType& belmannford) {
   496       
   496       
   497       typedef PotentialDifferenceMap<Graph, 
   497       typename Graph::template EdgeMap<Value> shiftlen(*graph);
   498       typename BelmannFordType::DistMap> PotDiffMap;
   498       for (EdgeIt it(*graph);  it != INVALID; ++it) {
   499       PotDiffMap potdiff(*graph, belmannford.distMap());
   499       	shiftlen[it] = (*length)[it] 
   500       typedef SubMap<LengthMap, PotDiffMap> ShiftLengthMap;
   500 	  + belmannford.dist(graph->source(it)) 
   501       ShiftLengthMap shiftlen(*length, potdiff);
   501 	  - belmannford.dist(graph->target(it));
   502 
   502       }
   503       typename Dijkstra<Graph, ShiftLengthMap>::
   503       
   504       template DefHeap<Heap, HeapCrossRef>::Create dijkstra(*graph, shiftlen);
   504       typename Dijkstra<Graph, typename Graph::template EdgeMap<Value> >::
       
   505 	template DefHeap<Heap, HeapCrossRef>::
       
   506 	Create dijkstra(*graph, shiftlen);
   505 
   507 
   506       dijkstra.heap(*_heap, *_heap_cross_ref);
   508       dijkstra.heap(*_heap, *_heap_cross_ref);
   507       
   509       
   508       for (NodeIt it(*graph); it != INVALID; ++it) {
   510       for (NodeIt it(*graph); it != INVALID; ++it) {
   509 	dijkstra.run(it);
   511 	dijkstra.run(it);