src/work/marci/dimacs.hh
changeset 105 a3c73e9b9b2e
parent 69 24c2c2989e0f
equal deleted inserted replaced
0:e637c7b8d8a2 1:2a57f2a2d403
     3 
     3 
     4 #include <iostream>
     4 #include <iostream>
     5 #include <string>
     5 #include <string>
     6 #include <vector>
     6 #include <vector>
     7 
     7 
     8 namespace marci {
     8 namespace hugo {
     9 
     9 
    10   template<typename Graph, typename CapacityMap>
    10   template<typename Graph, typename CapacityMap>
    11   void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::NodeIt &s, typename Graph::NodeIt &t, CapacityMap& capacity) {
    11   void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::NodeIt &s, typename Graph::NodeIt &t, CapacityMap& capacity) {
    12     G.clear();
    12     G.clear();
    13     int cap;
    13     int cap;
    47 	break;
    47 	break;
    48       case 'a':
    48       case 'a':
    49 	is >> i >> j >> cap;
    49 	is >> i >> j >> cap;
    50 	getline(is, str);
    50 	getline(is, str);
    51 	typename Graph::EdgeIt e=G.addEdge(nodes[i], nodes[j]);
    51 	typename Graph::EdgeIt e=G.addEdge(nodes[i], nodes[j]);
    52 	capacity.resize();
    52 	capacity.update();
    53 	capacity.set(e, cap);
    53 	capacity.set(e, cap);
    54 	break;
    54 	break;
    55       }
    55       }
    56     }
    56     }
    57   }
    57   }
    58   
    58   
    59 } //namespace marci
    59 } //namespace hugo
    60 
    60 
    61 #endif //DIMACS_HH
    61 #endif //DIMACS_HH