demo/dim_to_dot.cc
changeset 2537 4a2091b1796a
parent 2391 14a343be7a5a
child 2553 bfced05fa852
equal deleted inserted replaced
6:c59c519c5174 7:af02cb70e2cf
    15  * purpose.
    15  * purpose.
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 ///\file
    19 ///\file
    20 ///\brief Dim (Dimacs) to Dot (Graphviz) converter
    20 ///\brief Dim (DIMACS) to Dot (Graphviz) converter
    21 ///
    21 ///
    22 /// This program can convert the dimacs format to graphviz dot format.
    22 /// This program can convert the DIMACS format to Graphviz format.
    23 ///
    23 ///
    24 /// Use a DIMACS max flow file as stdin.
    24 /// <tt>dim_to_dot dimacs_max_flow_file > dot_output_file</tt>
    25 ///
    25 ///
    26 /// <tt>dim_to_dot < dimacs_max_flow_file > dot_output_file</tt>
    26 /// This program makes a dot file from a DIMACS max flow file. 
    27 ///
    27 /// This program can be an aid in making up to date visualized 
    28 /// This program makes a dot file from a dimacs max flow file. 
    28 /// documantation of demo programs.
    29 /// This program can be an aid in making up to date visualized documantation 
       
    30 /// of demo programs.
       
    31 ///
    29 ///
    32 /// \include dim_to_dot.cc
    30 /// \include dim_to_dot.cc
    33 
    31 
    34 #include <iostream>
    32 #include <iostream>
    35 #include <fstream>
    33 #include <fstream>
    44 
    42 
    45 int main(int argc, char *argv[]) 
    43 int main(int argc, char *argv[]) 
    46 {
    44 {
    47   if(argc<2)
    45   if(argc<2)
    48   {
    46   {
    49       std::cerr << "USAGE: sub_graph_adaptor_demo input_file.dim" << std::endl;
    47       std::cerr << "USAGE: dim_to_dot input_file.dim" << std::endl;
    50       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;
    48       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;
    51       return 0;
    49       return 0;
    52   }
    50   }
    53 
       
    54 
    51 
    55   //input stream to read the graph from
    52   //input stream to read the graph from
    56   std::ifstream is(argv[1]);
    53   std::ifstream is(argv[1]);
    57 
    54 
    58   typedef SmartGraph Graph;
    55   typedef SmartGraph Graph;