COIN-OR::LEMON - Graph Library

Changeset 421:54b943063901 in lemon-0.x for src/work


Ignore:
Timestamp:
04/26/04 18:58:14 (21 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@561
Message:

For working with undirected graphs, head is changed to aNode.
Some dimacs doki.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/dimacs.h

    r259 r421  
    99namespace hugo {
    1010
     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.
    1120  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();
    1423    int cap;
    1524    char d;
     
    3039        getline(is, str);
    3140        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();
    3342        break;
    3443      case 'n': //node definition
     
    4857        is >> i >> j >> cap;
    4958        getline(is, str);
    50         e=G.addEdge(nodes[i], nodes[j]);
     59        e=g.addEdge(nodes[i], nodes[j]);
    5160        capacity.update();
    5261        capacity.set(e, cap);
Note: See TracChangeset for help on using the changeset viewer.