COIN-OR::LEMON - Graph Library

Changeset 386:9d1faab5e0f1 in lemon-1.2


Ignore:
Timestamp:
11/27/08 23:05:35 (11 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Give different names to the different DIMACS readers

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/dimacs.h

    r385 r386  
    5555    typename CapacityMap, typename CostMap,
    5656    typename SupplyMap>
    57   void readDimacs( std::istream& is,
     57  void readDimacsMin( std::istream& is,
    5858                   Digraph &g,
    5959                   LowerMap& lower,
     
    119119  /// set to the source and the target nodes.
    120120  template<typename Digraph, typename CapacityMap>
    121   void readDimacs(std::istream& is, Digraph &g, CapacityMap& capacity,
     121  void readDimacsMax(std::istream& is, Digraph &g, CapacityMap& capacity,
    122122                  typename Digraph::Node &s, typename Digraph::Node &t) {
    123123    g.clear();
     
    182182  /// source node.
    183183  template<typename Digraph, typename CapacityMap>
    184   void readDimacs(std::istream& is, Digraph &g, CapacityMap& capacity,
     184  void readDimacsSp(std::istream& is, Digraph &g, CapacityMap& capacity,
    185185                  typename Digraph::Node &s) {
    186     readDimacs(is, g, capacity, s, s);
     186    typename Digraph::Node t;
     187    readDimacsMax(is, g, capacity, s, t);
    187188  }
    188189
     
    193194  /// and the arc capacities are written to \c capacity.
    194195  template<typename Digraph, typename CapacityMap>
    195   void readDimacs(std::istream& is, Digraph &g, CapacityMap& capacity) {
    196     typename Digraph::Node u;
    197     readDimacs(is, g, capacity, u, u);
     196  void readDimacsMax(std::istream& is, Digraph &g, CapacityMap& capacity) {
     197    typename Digraph::Node u,v;
     198    readDimacsMax(is, g, capacity, u, v);
    198199  }
    199200
     
    208209  /// At the beginning \c g is cleared by \c g.clear().
    209210  template<typename Digraph>
    210   void readDimacs(std::istream& is, Digraph &g) {
    211     typename Digraph::Node u;
     211  void readDimacsMat(std::istream& is, Digraph &g) {
     212    typename Digraph::Node u,v;
    212213    NullMap<typename Digraph::Arc, int> n;
    213     readDimacs(is, g, n, u, u);
     214    readDimacsMax(is, g, n, u, v);
    214215  }
    215216
     
    223224  /// \endcode
    224225  template<typename Digraph>
    225   void writeDimacs(std::ostream& os, const Digraph &g) {
     226  void writeDimacsMat(std::ostream& os, const Digraph &g) {
    226227    typedef typename Digraph::NodeIt NodeIt;
    227228    typedef typename Digraph::ArcIt ArcIt;
  • tools/dimacs-to-lgf.cc

    r385 r386  
    124124    DoubleArcMap lower(digraph), capacity(digraph), cost(digraph);
    125125    DoubleNodeMap supply(digraph);
    126     readDimacs(is, digraph, lower, capacity, cost, supply);
     126    readDimacsMin(is, digraph, lower, capacity, cost, supply);
    127127    DigraphWriter<Digraph>(digraph, os).
    128128      nodeMap("supply", supply).
     
    135135    Node s, t;
    136136    DoubleArcMap capacity(digraph);
    137     readDimacs(is, digraph, capacity, s, t);
     137    readDimacsMax(is, digraph, capacity, s, t);
    138138    DigraphWriter<Digraph>(digraph, os).
    139139      arcMap("capacity", capacity).
     
    145145    Node s;
    146146    DoubleArcMap capacity(digraph);
    147     readDimacs(is, digraph, capacity, s);
     147    readDimacsSp(is, digraph, capacity, s);
    148148    DigraphWriter<Digraph>(digraph, os).
    149149      arcMap("capacity", capacity).
     
    153153    Digraph digraph;
    154154    DoubleArcMap capacity(digraph);
    155     readDimacs(is, digraph, capacity);
     155    readDimacsMax(is, digraph, capacity);
    156156    DigraphWriter<Digraph>(digraph, os).
    157157      arcMap("capacity", capacity).
     
    159159  } else if (plain) {
    160160    Digraph digraph;
    161     readDimacs(is, digraph);
     161    readDimacsMat(is, digraph);
    162162    DigraphWriter<Digraph>(digraph, os).run();
    163163  } else {
Note: See TracChangeset for help on using the changeset viewer.