src/work/marci/dimacs.h
changeset 190 6f8e34f638c0
parent 174 44700ed9ffaa
child 206 47f62d789fe7
equal deleted inserted replaced
0:282ffa7ff534 1:e36176da39d3
    16     std::string problem;
    16     std::string problem;
    17     char c;
    17     char c;
    18     int i, j;
    18     int i, j;
    19     std::string str;
    19     std::string str;
    20     int n, m; 
    20     int n, m; 
       
    21     typename Graph::Edge e;
    21     std::vector<typename Graph::Node> nodes;
    22     std::vector<typename Graph::Node> nodes;
    22     while (is>>c) {
    23     while (is>>c) {
    23       switch (c) {
    24       switch (c) {
    24       case 'c': //comment
    25       case 'c': //comment
    25 	getline(is, str);
    26 	getline(is, str);
    47 	}
    48 	}
    48 	break;
    49 	break;
    49       case 'a':
    50       case 'a':
    50 	is >> i >> j >> cap;
    51 	is >> i >> j >> cap;
    51 	getline(is, str);
    52 	getline(is, str);
    52 	typename Graph::Edge e=G.addEdge(nodes[i], nodes[j]);
    53 	e=G.addEdge(nodes[i], nodes[j]);
    53 	capacity.update();
    54 	capacity.update();
    54 	capacity.set(e, cap);
    55 	capacity.set(e, cap);
    55 	break;
    56 	break;
    56       }
    57       }
    57     }
    58     }