Changeset 2335:27aa03cd3121 in lemon-0.x for lemon/suurballe.h
- Timestamp:
- 01/08/07 11:39:59 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3123
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/suurballe.h
r2276 r2335 27 27 #include <lemon/maps.h> 28 28 #include <vector> 29 #include <lemon/path.h> 29 30 #include <lemon/ssp_min_cost_flow.h> 30 31 … … 83 84 84 85 //Container to store found paths 85 std::vector< std::vector<Edge> > paths;86 std::vector<SimplePath<Graph> > paths; 86 87 87 88 public : … … 135 136 } 136 137 n = G.target(e); 137 paths[j]. push_back(e);138 paths[j].addBack(e); 138 139 reversed[e] = 1-reversed[e]; 139 140 } … … 171 172 } 172 173 174 typedef SimplePath<Graph> Path; 175 173 176 /// \brief Read the found paths. 174 177 /// … … 182 185 /// (\c j can be 0 as well). 183 186 /// 184 /// \param Path The type of the path structure to put the result185 /// to (must meet lemon path concept).186 /// \param p The path to put the result to.187 187 /// \param j Which path you want to get from the found paths (in a 188 188 /// real application you would get the found paths iteratively). 189 template<typename Path> 190 void getPath(Path& p, size_t j){ 191 192 p.clear(); 193 if (j>paths.size()-1){ 194 return; 195 } 196 typename Path::Builder B(p); 197 for(typename std::vector<Edge>::iterator i=paths[j].begin(); 198 i!=paths[j].end(); ++i ){ 199 B.pushBack(*i); 200 } 201 202 B.commit(); 189 Path path(int j) const { 190 return paths[j]; 191 } 192 193 /// \brief Gives back the number of the paths. 194 /// 195 /// Gives back the number of the constructed paths. 196 int pathNum() const { 197 return paths.size(); 203 198 } 204 199
Note: See TracChangeset
for help on using the changeset viewer.