COIN-OR::LEMON - Graph Library

Changeset 1560:01707a8a4ca6 in lemon-0.x for demo/coloring.cc


Ignore:
Timestamp:
07/15/05 18:01:55 (19 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/coloring.cc

    r1435 r1560  
    66#include <lemon/graph_to_eps.h>
    77
     8#include <fstream>
     9#include <iostream>
     10
     11
    812using namespace std;
    913using namespace lemon;
    1014
    11 int main() {
     15int main(int argc, char *argv[])
     16{
     17  if(argc<2)
     18  {
     19      std::cerr << "USAGE: coloring <input_file.lgf>" << std::endl;
     20      std::cerr << "The file 'input_file.lgf' has to contain a graph in LEMON format together with a nodemap called 'coords' to draw the graph (e.g. sample.lgf is not such a file)." << std::endl;
     21      return 0;
     22  }
     23
     24
     25  //input stream to read the graph from
     26  std::ifstream is(argv[1]);
     27
    1228  typedef UndirSmartGraph Graph;
    1329  typedef Graph::Node Node;
     
    1834  Graph graph;
    1935
    20   UndirGraphReader<Graph> reader(std::cin, graph);
     36  UndirGraphReader<Graph> reader(is, graph);
    2137  Graph::NodeMap<xy<double> > coords(graph);
    2238  reader.readNodeMap("coords", coords);
Note: See TracChangeset for help on using the changeset viewer.