src/work/marci/graph_wrapper_time.cc
changeset 1365 c280de819a73
parent 1364 ee5959aa4410
child 1366 d00b85f8be45
     1.1 --- a/src/work/marci/graph_wrapper_time.cc	Sun Apr 17 18:57:22 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,71 +0,0 @@
     1.4 -// -*- c++ -*-
     1.5 -
     1.6 -// Use a DIMACS max flow file as follows:
     1.7 -// graph_wrapper_time dimacs_max_flow_file
     1.8 -
     1.9 -#include <iostream>
    1.10 -#include <fstream>
    1.11 -#include <string>
    1.12 -#include <vector>
    1.13 -#include <lemon/invalid.h>
    1.14 -#include <lemon/time_measure.h>
    1.15 -#include <lemon/graph_wrapper.h>
    1.16 -#include <lemon/preflow.h>
    1.17 -#include <lemon/dimacs.h>
    1.18 -#include <lemon/list_graph.h>
    1.19 -
    1.20 -using namespace lemon;
    1.21 -
    1.22 -using std::cout;
    1.23 -using std::endl;
    1.24 -
    1.25 -template<typename Graph>
    1.26 -void timeTest(std::string str, Graph& g) {
    1.27 -  g.clear();
    1.28 -  typename Graph::Node s;
    1.29 -  typename Graph::Node t;
    1.30 -  typedef typename Graph::template EdgeMap<int> FlowMap;
    1.31 -  FlowMap cap(g);
    1.32 -  FlowMap flow(g);
    1.33 -  std::ifstream is(str.c_str());
    1.34 -  readDimacs(is, g, cap, s, t);
    1.35 -  Timer ts;
    1.36 -  ts.reset();
    1.37 -
    1.38 -  typedef Preflow<Graph, int, FlowMap, FlowMap> MyPreflow;
    1.39 -  MyPreflow max_flow(g, s, t, cap, flow);
    1.40 -  max_flow.run(MyPreflow::NO_FLOW);
    1.41 -  cout << "flow value: " << max_flow.flowValue() << endl;
    1.42 -  cout << ts << endl;
    1.43 -}
    1.44 -
    1.45 -int main(int, char** argv) {
    1.46 -   std::string in=argv[1];
    1.47 -
    1.48 -  typedef ListGraph Graph; 
    1.49 -  Graph g;
    1.50 -  timeTest<Graph>(in, g);
    1.51 -  typedef GraphWrapper<Graph> Graph1;
    1.52 -  Graph1 g1(g);
    1.53 -  timeTest<Graph1>(in, g1);
    1.54 -  typedef GraphWrapper<Graph1> Graph2;
    1.55 -  Graph2 g2(g1);
    1.56 -  timeTest<Graph2>(in, g2);
    1.57 -  typedef GraphWrapper<Graph2> Graph3;
    1.58 -  Graph3 g3(g2);
    1.59 -  timeTest<Graph3>(in, g3);
    1.60 -  typedef GraphWrapper<Graph3> Graph4;
    1.61 -  Graph4 g4(g3);
    1.62 -  timeTest<Graph4>(in, g4);
    1.63 -  typedef GraphWrapper<Graph4> Graph5;
    1.64 -  Graph5 g5(g4);
    1.65 -  timeTest<Graph5>(in, g5);
    1.66 -  typedef GraphWrapper<Graph5> Graph6;
    1.67 -  Graph6 g6(g5);
    1.68 -  timeTest<Graph6>(in, g6);  
    1.69 -  typedef GraphWrapper<Graph6> Graph7;
    1.70 -  Graph7 g7(g6);
    1.71 -  timeTest<Graph7>(in, g7);
    1.72 -
    1.73 -  return 0;
    1.74 -}