COIN-OR::LEMON - Graph Library

Changeset 209:765619b7cbb2 in lemon-main for demo


Ignore:
Timestamp:
07/13/08 20:51:02 (16 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Apply unify-sources.sh to the source tree

Location:
demo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • demo/arg_parser_demo.cc

    r204 r209  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    55 * Copyright (C) 2003-2008
     
    6565  ap.other("infile", "The input file.")
    6666    .other("...");
    67  
     67
    6868  // Perform the parsing process
    6969  // (in case of any error it terminates the program)
     
    8585  if(ap.given("grb")) std::cout << "  -grb is given\n";
    8686  if(ap.given("grc")) std::cout << "  -grc is given\n";
    87  
     87
    8888  switch(ap.files().size()) {
    8989  case 0:
     
    9595  default:
    9696    std::cout << "  "
    97               << ap.files().size() << " file arguments were given. They are:\n";
     97              << ap.files().size() << " file arguments were given. They are:\n";
    9898  }
    9999  for(unsigned int i=0;i<ap.files().size();++i)
    100100    std::cout << "    '" << ap.files()[i] << "'\n";
    101  
     101
    102102  return 0;
    103103}
  • demo/graph_to_eps_demo.cc

    r206 r209  
    1 /* -*- C++ -*-
    2  *
    3  * This file is a part of LEMON, a generic C++ optimization library
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
     2 *
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    55 * Copyright (C) 2003-2008
     
    5050  typedef ListDigraph::Arc Arc;
    5151  typedef dim2::Point<int> Point;
    52  
     52
    5353  Node n1=g.addNode();
    5454  Node n2=g.addNode();
     
    6363  ListDigraph::ArcMap<int> acolors(g);
    6464  ListDigraph::ArcMap<int> widths(g);
    65  
     65
    6666  coords[n1]=Point(50,50);  sizes[n1]=1; colors[n1]=1; shapes[n1]=0;
    6767  coords[n2]=Point(50,70);  sizes[n2]=2; colors[n2]=2; shapes[n2]=2;
     
    6969  coords[n4]=Point(70,50);  sizes[n4]=2; colors[n4]=4; shapes[n4]=1;
    7070  coords[n5]=Point(85,60);  sizes[n5]=3; colors[n5]=5; shapes[n5]=2;
    71  
     71
    7272  Arc a;
    7373
     
    7979  a=g.addArc(n2,n4); acolors[a]=1; widths[a]=2;
    8080  a=g.addArc(n3,n4); acolors[a]=2; widths[a]=1;
    81  
     81
    8282  IdMap<ListDigraph,Node> id(g);
    8383
     
    183183  ListDigraph::NodeMap<int> hcolors(h);
    184184  ListDigraph::NodeMap<Point> hcoords(h);
    185  
     185
    186186  int cols=int(sqrt(double(palette.size())));
    187187  for(int i=0;i<int(paletteW.size());i++) {
     
    190190    hcolors[n]=i;
    191191  }
    192  
     192
    193193  cout << "Create 'graph_to_eps_demo_out_6_colors.eps'" << endl;
    194194  graphToEps(h,"graph_to_eps_demo_out_6_colors.eps").
     
    203203    nodeColors(composeMap(paletteW,hcolors)).
    204204    run();
    205    
     205
    206206  return 0;
    207207}
  • demo/lgf_demo.cc

    r193 r209  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    55 * Copyright (C) 2003-2008
     
    2222///
    2323/// This program gives an example of how to read and write a digraph
    24 /// and additional maps from/to a stream or a file using the 
     24/// and additional maps from/to a stream or a file using the
    2525/// \ref lgf-format "LGF" format.
    2626///
     
    4343  SmartDigraph::ArcMap<int> cap(g);
    4444  SmartDigraph::Node s, t;
    45  
     45
    4646  try {
    4747    digraphReader("digraph.lgf", g). // read the directed graph into g
Note: See TracChangeset for help on using the changeset viewer.