Changeset 421:54b943063901 in lemon0.x for src/work/marci
 Timestamp:
 04/26/04 18:58:14 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@561
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/dimacs.h
r259 r421 9 9 namespace hugo { 10 10 11 /// Dimacs flow files. 12 13 /// This function reads a flow instance from dimacs flow format. 14 /// At the beginning \c g is destroyed by \c g.clear(). 15 /// If the data coming from \c is is a max flow innstance, then 16 /// \c s and \t will be respectively the source and target nodes 17 /// and \c capacity will contain the edge capacities. 18 /// If the data is a shortest path problem then \c s will be the 19 /// source node and \capacity will contain the edge lengths. 11 20 template<typename Graph, typename CapacityMap> 12 void readDimacsMaxFlow(std::istream& is, Graph & G, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) {13 G.clear();21 void readDimacsMaxFlow(std::istream& is, Graph &g, typename Graph::Node &s, typename Graph::Node &t, CapacityMap& capacity) { 22 g.clear(); 14 23 int cap; 15 24 char d; … … 30 39 getline(is, str); 31 40 nodes.resize(n+1); 32 for (int k=1; k<=n; ++k) nodes[k]= G.addNode();41 for (int k=1; k<=n; ++k) nodes[k]=g.addNode(); 33 42 break; 34 43 case 'n': //node definition … … 48 57 is >> i >> j >> cap; 49 58 getline(is, str); 50 e= G.addEdge(nodes[i], nodes[j]);59 e=g.addEdge(nodes[i], nodes[j]); 51 60 capacity.update(); 52 61 capacity.set(e, cap);
Note: See TracChangeset
for help on using the changeset viewer.