Changeset 956:141f9c0db4a3 in lemon for lemon/suurballe.h
 Timestamp:
 03/06/10 15:35:12 (10 years ago)
 Branch:
 default
 Children:
 957:f802439d2b58, 959:38213abd2911, 1041:f112c18bc304
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/suurballe.h
r941 r956 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 200320 095 * Copyright (C) 20032010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 66 66 /// and it must have an \c addBack() function. 67 67 typedef lemon::Path<Digraph> Path; 68 68 69 69 /// The cross reference type used for the heap. 70 70 typedef typename GR::template NodeMap<int> HeapCrossRef; … … 159 159 Node _s; 160 160 Node _t; 161 161 162 162 PotentialMap _dist; 163 163 std::vector<Node> _proc_nodes; … … 168 168 ResidualDijkstra(Suurballe &srb) : 169 169 _graph(srb._graph), _length(srb._length), 170 _flow(*srb._flow), _pi(*srb._potential), _pred(srb._pred), 170 _flow(*srb._flow), _pi(*srb._potential), _pred(srb._pred), 171 171 _s(srb._s), _t(srb._t), _dist(_graph) {} 172 172 173 173 // Run the algorithm and return true if a path is found 174 174 // from the source node to the target node. … … 178 178 179 179 private: 180 180 181 181 // Execute the algorithm for the first time (the flow and potential 182 182 // functions have to be identically zero). … … 349 349 typedef Suurballe<GR, LEN, SetPathTraits<T> > Create; 350 350 }; 351 351 352 352 template <typename H, typename CR> 353 353 struct SetHeapTraits : public Traits { … … 360 360 /// 361 361 /// \ref namedtemplparam "Named parameter" for setting \c Heap 362 /// and \c HeapCrossRef types with automatic allocation. 362 /// and \c HeapCrossRef types with automatic allocation. 363 363 /// They will be used for internal Dijkstra computations. 364 364 /// The heap type must conform to the \ref lemon::concepts::Heap "Heap" … … 398 398 // The pred arc map 399 399 PredMap _pred; 400 400 401 401 // Data for full init 402 402 PotentialMap *_init_dist; … … 556 556 dijk.distMap(*_init_dist).predMap(*_init_pred); 557 557 dijk.run(s); 558 558 559 559 _full_init = true; 560 560 } … … 600 600 _t = t; 601 601 ResidualDijkstra dijkstra(*this); 602 602 603 603 // Initialization 604 604 for (ArcIt e(_graph); e != INVALID; ++e) { … … 614 614 (*_flow)[e] = 1; 615 615 u = _graph.source(e); 616 } 616 } 617 617 _path_num = 1; 618 618 } else {
Note: See TracChangeset
for help on using the changeset viewer.