4.4.1-es ledahoz a demo atalakitva
authorklao
Mon, 23 Feb 2004 19:02:16 +0000
changeset 1257d7dc3fab826
parent 124 8d24100ad408
child 126 89c6e4687fcc
4.4.1-es ledahoz a demo atalakitva
src/work/marci/makefile
src/work/marci/preflow_demo_leda_uj.cc
     1.1 --- a/src/work/marci/makefile	Mon Feb 23 17:33:50 2004 +0000
     1.2 +++ b/src/work/marci/makefile	Mon Feb 23 19:02:16 2004 +0000
     1.3 @@ -1,7 +1,8 @@
     1.4  CXX3 = g++-3.0
     1.5  CXX2 = g++-2.95
     1.6 +CXX3.3 = g++
     1.7  CXXFLAGS = -W -Wall -ansi -pedantic
     1.8 -LEDAROOT = /ledasrc/LEDA-4.1
     1.9 +LEDAROOT ?= /ledasrc/LEDA-4.1
    1.10  
    1.11  BINARIES = edmonds_karp_demo edmonds_karp_demo_alpar preflow_demo_leda preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos 
    1.12  
    1.13 @@ -24,6 +25,9 @@
    1.14  preflow_demo_leda:
    1.15  	$(CXX2) -W -Wall -O3 -DLEDA_PREFIX -I. -I$(LEDAROOT)/incl -L$(LEDAROOT) -o preflow_demo_leda preflow_demo_leda.cc -lP -lm -lL -lG
    1.16  
    1.17 +preflow_demo_leda_uj:
    1.18 +	$(CXX3.3) -Wall -O3 -I$(LEDAROOT)/incl -I. -L$(LEDAROOT) -o preflow_demo_leda_uj preflow_demo_leda_uj.cc -lG -lL -lm
    1.19 +
    1.20  preflow_demo_boost:
    1.21  	$(CXX2) -ftemplate-depth-30 -O3 -I. -I/home/marci/boost -o preflow_demo_boost preflow_demo_boost.cc
    1.22  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/work/marci/preflow_demo_leda_uj.cc	Mon Feb 23 19:02:16 2004 +0000
     2.3 @@ -0,0 +1,37 @@
     2.4 +#include <iostream>
     2.5 +#include <fstream>
     2.6 +
     2.7 +#include <LEDA/graph.h>
     2.8 +#include <LEDA/graph_alg.h>
     2.9 +#include <LEDA/dimacs.h>
    2.10 +
    2.11 +#if defined(LEDA_NAMESPACE)
    2.12 +using namespace leda;
    2.13 +#endif
    2.14 +
    2.15 +using namespace std;
    2.16 +
    2.17 +#include <time_measure.h>
    2.18 +
    2.19 +// Use a DIMACS max flow file as stdin.
    2.20 +// read_dimacs_demo_leda < dimacs_max_flow_file
    2.21 +int main() 
    2.22 +{
    2.23 +  GRAPH<int,int> G;
    2.24 +  leda_node s,t;
    2.25 +  leda_edge_array<int> cap;
    2.26 +  Read_Dimacs_MF(cin,G,s,t,cap);
    2.27 + 
    2.28 +  leda_edge_array<int> flow(G);
    2.29 +
    2.30 +  std::cout << "preflow demo (LEDA)..." << std::endl;
    2.31 +  double pre_time=currTime();
    2.32 +  int flow_value = MAX_FLOW(G,s,t,cap,flow); 
    2.33 +  double post_time=currTime();
    2.34 +  //std::cout << "maximum flow: "<< std::endl;
    2.35 +  //std::cout<<std::endl;
    2.36 +  std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    2.37 +  std::cout << "flow value: "<< flow_value << std::endl;
    2.38 +
    2.39 +  return 0;
    2.40 +}