COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
07/15/05 18:01:55 (14 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2058
Message:

Some demo programs got some interface. Most progress with lp_maxflow_demo.cc, which also got documented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo/sub_graph_adaptor_demo.cc

    r1544 r1560  
    11// -*- c++ -*-
    22
    3 // Use a DIMACS max flow file as stdin.
     3// Use a DIMACS max flow file as input.
    44// sub_graph_adaptor_demo < dimacs_max_flow_file
    55// This program computes a maximum number of edge-disjoint shortest paths
     
    2222using std::endl;
    2323
    24 int main()
    25 {   
     24int main(int argc, char *argv[])
     25{
     26  if(argc<2)
     27  {
     28      std::cerr << "USAGE: sub_graph_adaptor_demo <input_file.dim>" << std::endl;
     29      std::cerr << "The file 'input_file.dim' has to contain a max flow instance in DIMACS format (e.g. sub_graph_adaptor_demo.dim is such a file)." << std::endl;
     30      return 0;
     31  }
     32
     33
     34  //input stream to read the graph from
     35  std::ifstream is(argv[1]);
     36
    2637  typedef SmartGraph Graph;
    2738
     
    3647  LengthMap length(g);
    3748
    38   readDimacs(std::cin, g, length, s, t);
     49  readDimacs(is, g, length, s, t);
    3950
    4051  cout << "edges with lengths (of form id, source--length->target): " << endl;
Note: See TracChangeset for help on using the changeset viewer.