Changeset 209:765619b7cbb2 in lemon for demo
- Timestamp:
- 07/13/08 20:51:02 (16 years ago)
- Branch:
- default
- Phase:
- public
- 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; -*- 2 2 * 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. 4 4 * 5 5 * Copyright (C) 2003-2008 … … 65 65 ap.other("infile", "The input file.") 66 66 .other("..."); 67 67 68 68 // Perform the parsing process 69 69 // (in case of any error it terminates the program) … … 85 85 if(ap.given("grb")) std::cout << " -grb is given\n"; 86 86 if(ap.given("grc")) std::cout << " -grc is given\n"; 87 87 88 88 switch(ap.files().size()) { 89 89 case 0: … … 95 95 default: 96 96 std::cout << " " 97 97 << ap.files().size() << " file arguments were given. They are:\n"; 98 98 } 99 99 for(unsigned int i=0;i<ap.files().size();++i) 100 100 std::cout << " '" << ap.files()[i] << "'\n"; 101 101 102 102 return 0; 103 103 } -
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. 4 4 * 5 5 * Copyright (C) 2003-2008 … … 50 50 typedef ListDigraph::Arc Arc; 51 51 typedef dim2::Point<int> Point; 52 52 53 53 Node n1=g.addNode(); 54 54 Node n2=g.addNode(); … … 63 63 ListDigraph::ArcMap<int> acolors(g); 64 64 ListDigraph::ArcMap<int> widths(g); 65 65 66 66 coords[n1]=Point(50,50); sizes[n1]=1; colors[n1]=1; shapes[n1]=0; 67 67 coords[n2]=Point(50,70); sizes[n2]=2; colors[n2]=2; shapes[n2]=2; … … 69 69 coords[n4]=Point(70,50); sizes[n4]=2; colors[n4]=4; shapes[n4]=1; 70 70 coords[n5]=Point(85,60); sizes[n5]=3; colors[n5]=5; shapes[n5]=2; 71 71 72 72 Arc a; 73 73 … … 79 79 a=g.addArc(n2,n4); acolors[a]=1; widths[a]=2; 80 80 a=g.addArc(n3,n4); acolors[a]=2; widths[a]=1; 81 81 82 82 IdMap<ListDigraph,Node> id(g); 83 83 … … 183 183 ListDigraph::NodeMap<int> hcolors(h); 184 184 ListDigraph::NodeMap<Point> hcoords(h); 185 185 186 186 int cols=int(sqrt(double(palette.size()))); 187 187 for(int i=0;i<int(paletteW.size());i++) { … … 190 190 hcolors[n]=i; 191 191 } 192 192 193 193 cout << "Create 'graph_to_eps_demo_out_6_colors.eps'" << endl; 194 194 graphToEps(h,"graph_to_eps_demo_out_6_colors.eps"). … … 203 203 nodeColors(composeMap(paletteW,hcolors)). 204 204 run(); 205 205 206 206 return 0; 207 207 } -
demo/lgf_demo.cc
r193 r209 1 /* -*- C++-*-1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 2 * 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. 4 4 * 5 5 * Copyright (C) 2003-2008 … … 22 22 /// 23 23 /// 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 25 25 /// \ref lgf-format "LGF" format. 26 26 /// … … 43 43 SmartDigraph::ArcMap<int> cap(g); 44 44 SmartDigraph::Node s, t; 45 45 46 46 try { 47 47 digraphReader("digraph.lgf", g). // read the directed graph into g
Note: See TracChangeset
for help on using the changeset viewer.