COIN-OR::LEMON - Graph Library

Changeset 2207:75a29ac69c19 in lemon-0.x for demo


Ignore:
Timestamp:
09/07/06 15:27:16 (13 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2933
Message:

xy -> dim2::Point

Location:
demo
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • demo/coloring.cc

    r2172 r2207  
    5656
    5757  UGraphReader<Graph> reader("coloring.lgf", graph);
    58   Graph::NodeMap<xy<double> > coords(graph);
     58  Graph::NodeMap<dim2::Point<double> > coords(graph);
    5959  reader.readNodeMap("coords", coords);
    6060 
  • demo/descriptor_map_demo.cc

    r2081 r2207  
    3030#include <lemon/graph_utils.h>
    3131#include <lemon/graph_writer.h>
    32 #include <lemon/xy.h>
     32#include <lemon/dim2.h>
    3333#include <lemon/graph_to_eps.h>
    3434
     
    4141using namespace lemon;
    4242
    43 // Special xy<double> map type
     43// Special dim2::Point<double> map type
    4444//
    4545// It gives back a position for each node. The position of the nodes
     
    5252public:
    5353
    54   typedef xy<double> Value;
     54  typedef dim2::Point<double> Value;
    5555  typedef typename Graph::Node Key;
    5656
     
    119119  // Make postscript from the graph.
    120120   
    121   CircleMap<Graph> coords(graph, xy<double>(0.0, 0.0), 10.0);
     121  CircleMap<Graph> coords(graph, dim2::Point<double>(0.0, 0.0), 10.0);
    122122   
    123123  graphToEps(graph,"descriptor_map_demo.eps").scaleToA4().
  • demo/disjoint_paths_demo.cc

    r2174 r2207  
    5353  Graph graph;
    5454
    55   Graph::NodeMap<xy<double> > coords(graph);
     55  Graph::NodeMap<dim2::Point<double> > coords(graph);
    5656  Graph::Node source, target;
    5757  GraphReader<Graph>("disjoint_paths_demo.lgf", graph).
     
    9999    title("node disjoint path").copyright("(C) 2006 LEMON Project").drawArrows().
    100100    edgeColors(composeMap(functorMap(color), sflow)).
    101     coords(SGraph::combinedNodeMap(coords, shiftMap(coords, xy<double>(5, 0)))).
     101    coords(SGraph::combinedNodeMap(coords,
     102                                   shiftMap(coords,
     103                                            dim2::Point<double>(5, 0)))).
    102104    autoNodeScale().run();
    103105
  • demo/graph_orientation.cc

    r2172 r2207  
    2020#include <lemon/graph_reader.h>
    2121#include <lemon/iterable_maps.h>
    22 #include <lemon/xy.h>
     22#include <lemon/dim2.h>
    2323#include <lemon/graph_to_eps.h>
    2424
     
    4646  ListGraph::NodeMap<int> f(g); //in-deg requirement;
    4747  ListGraph::NodeMap<int> label(g);
    48   ListGraph::NodeMap<xy<double> > coords(g);
     48  ListGraph::NodeMap<dim2::Point<double> > coords(g);
    4949 
    5050  try {
  • demo/graph_to_eps_demo.cc

    r2178 r2207  
    4949  typedef ListGraph::NodeIt NodeIt;
    5050  typedef ListGraph::Edge Edge;
    51   typedef xy<int> Xy;
     51  typedef dim2::Point<int> Point;
    5252 
    5353  Node n1=g.addNode();
     
    5757  Node n5=g.addNode();
    5858
    59   ListGraph::NodeMap<Xy> coords(g);
     59  ListGraph::NodeMap<Point> coords(g);
    6060  ListGraph::NodeMap<double> sizes(g);
    6161  ListGraph::NodeMap<int> colors(g);
     
    6464  ListGraph::EdgeMap<int> widths(g);
    6565 
    66   coords[n1]=Xy(50,50);  sizes[n1]=1; colors[n1]=1; shapes[n1]=0;
    67   coords[n2]=Xy(50,70);  sizes[n2]=2; colors[n2]=2; shapes[n2]=2;
    68   coords[n3]=Xy(70,70);  sizes[n3]=1; colors[n3]=3; shapes[n3]=0;
    69   coords[n4]=Xy(70,50);  sizes[n4]=2; colors[n4]=4; shapes[n4]=1;
    70   coords[n5]=Xy(85,60);  sizes[n5]=3; colors[n5]=5; shapes[n5]=2;
     66  coords[n1]=Point(50,50);  sizes[n1]=1; colors[n1]=1; shapes[n1]=0;
     67  coords[n2]=Point(50,70);  sizes[n2]=2; colors[n2]=2; shapes[n2]=2;
     68  coords[n3]=Point(70,70);  sizes[n3]=1; colors[n3]=3; shapes[n3]=0;
     69  coords[n4]=Point(70,50);  sizes[n4]=2; colors[n4]=4; shapes[n4]=1;
     70  coords[n5]=Point(85,60);  sizes[n5]=3; colors[n5]=5; shapes[n5]=2;
    7171 
    7272  Edge e;
     
    184184  ListGraph h;
    185185  ListGraph::NodeMap<int> hcolors(h);
    186   ListGraph::NodeMap<Xy> hcoords(h);
     186  ListGraph::NodeMap<Point> hcoords(h);
    187187 
    188188  int cols=int(sqrt(double(palette.size())));
    189189  for(int i=0;i<int(paletteW.size());i++) {
    190190    Node n=h.addNode();
    191     hcoords[n]=Xy(i%cols,i/cols);
     191    hcoords[n]=Point(i%cols,i/cols);
    192192    hcolors[n]=i;
    193193  }
  • demo/grid_ugraph_demo.cc

    r2172 r2207  
    2121#include <lemon/graph_to_eps.h>
    2222#include <lemon/bfs.h>
    23 #include <lemon/xy.h>
     23#include <lemon/dim2.h>
    2424
    2525#include <iostream>
  • demo/min_route.cc

    r1959 r2207  
    2323#include <lemon/dijkstra.h>
    2424#include <lemon/maps.h>
    25 #include <lemon/xy.h>
     25#include <lemon/dim2.h>
    2626#include <lemon/graph_reader.h>
    2727
     
    4747  typedef typename CoordMap::Key Key;
    4848
    49   PotentialMap(const CoordMap& _coord, const xy<double>& _target)
     49  PotentialMap(const CoordMap& _coord, const dim2::Point<double>& _target)
    5050    : coord(_coord), target(_target) {}
    5151
     
    5656private:
    5757  const CoordMap& coord;
    58   xy<double> target;
     58  dim2::Point<double> target;
    5959};
    6060
     
    8787  typedef Graph::NodeIt NodeIt;
    8888  typedef Graph::EdgeMap<double> LengthMap;
    89   typedef Graph::NodeMap<xy<double> > CoordMap;
     89  typedef Graph::NodeMap<dim2::Point<double> > CoordMap;
    9090
    9191  SmartGraph graph;
     
    9595 
    9696  CoordMap coord(graph);
    97   XMap<CoordMap> xcoord = xMap(coord);
     97  dim2::XMap<CoordMap> xcoord = xMap(coord);
    9898  reader.readNodeMap("coordinates_x", xcoord);
    99   YMap<CoordMap> ycoord = yMap(coord);
     99  dim2::YMap<CoordMap> ycoord = yMap(coord);
    100100  reader.readNodeMap("coordinates_y", ycoord);
    101101
  • demo/strongly_connected_orientation.cc

    r2174 r2207  
    7979
    8080  UGraph ugraph;
    81   UGraph::NodeMap<xy<double> > coords(ugraph);
     81  UGraph::NodeMap<dim2::Point<double> > coords(ugraph);
    8282  UGraphReader<UGraph>("strongly_connected_orientation.lgf", ugraph).
    8383    readNodeMap("coords", coords).run();
  • demo/topology_demo.cc

    r2174 r2207  
    2121#include <lemon/graph_to_eps.h>
    2222#include <lemon/graph_reader.h>
    23 #include <lemon/xy.h>
     23#include <lemon/dim2.h>
    2424
    2525#include <iostream>
     
    5050
    5151  Graph graph;
    52   Graph::NodeMap<xy<double> > coords(graph);
     52  Graph::NodeMap<dim2::Point<double> > coords(graph);
    5353
    5454  UGraphReader<Graph>("u_components.lgf", graph).
     
    7575
    7676  Graph graph;
    77   Graph::NodeMap<xy<double> > coords(graph);
     77  Graph::NodeMap<dim2::Point<double> > coords(graph);
    7878
    7979  GraphReader<Graph>("dir_components.lgf", graph).
     
    105105
    106106  Graph graph;
    107   Graph::NodeMap<xy<double> > coords(graph);
     107  Graph::NodeMap<dim2::Point<double> > coords(graph);
    108108
    109109  UGraphReader<Graph>("u_components.lgf", graph).
     
    135135
    136136  Graph graph;
    137   Graph::NodeMap<xy<double> > coords(graph);
     137  Graph::NodeMap<dim2::Point<double> > coords(graph);
    138138
    139139  UGraphReader<Graph>("u_components.lgf", graph).
     
    164164
    165165  Graph graph;
    166   Graph::NodeMap<xy<double> > coords(graph);
     166  Graph::NodeMap<dim2::Point<double> > coords(graph);
    167167
    168168  UGraphReader<Graph>("partitions.lgf", graph).
Note: See TracChangeset for help on using the changeset viewer.