Changeset 1381:998e8def9676 in lemon0.x for src/demo/lp_maxflow_demo.cc
 Timestamp:
 04/22/05 19:47:01 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1834
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/demo/lp_maxflow_demo.cc
r1361 r1381 1 #include<lemon/lp_glpk.h>2 1 #include<lemon/graph_reader.h> 3 2 #include<lemon/list_graph.h> 4 3 4 5 #ifdef HAVE_GLPK 6 #include <lemon/lp_glpk.h> 7 #elif HAVE_CPLEX 8 #include <lemon/lp_cplex.h> 9 #endif 10 5 11 using namespace lemon; 12 13 #ifdef HAVE_GLPK 14 typedef LpGlpk LpDefault; 15 #elif HAVE_CPLEX 16 typedef LpCplex LpDefault; 17 #endif 18 6 19 7 20 template<class G,class C> 8 21 double maxFlow(const G &g,const C &cap,typename G::Node s,typename G::Node t) 9 22 { 10 Lp Glpklp;23 LpDefault lp; 11 24 12 25 typedef G Graph; … … 18 31 typedef typename G::InEdgeIt InEdgeIt; 19 32 20 typename G::template EdgeMap<Lp Glpk::Col> x(g);33 typename G::template EdgeMap<LpDefault::Col> x(g); 21 34 lp.addColSet(x); 22 35 … … 27 40 28 41 for(NodeIt n(g);n!=INVALID;++n) if(n!=s&&n!=t) { 29 Lp Glpk::Expr ex;42 LpDefault::Expr ex; 30 43 for(InEdgeIt e(g,n);e!=INVALID;++e) ex+=x[e]; 31 44 for(OutEdgeIt e(g,n);e!=INVALID;++e) ex=x[e]; … … 33 46 } 34 47 { 35 Lp Glpk::Expr ex;48 LpDefault::Expr ex; 36 49 for(InEdgeIt e(g,t);e!=INVALID;++e) ex+=x[e]; 37 50 for(OutEdgeIt e(g,t);e!=INVALID;++e) ex=x[e]; … … 40 53 lp.max(); 41 54 55 #ifdef HAVE_GLPK 42 56 lp.presolver(true); 43 44 57 lp.messageLevel(3); 58 #endif 45 59 46 60 lp.solve();
Note: See TracChangeset
for help on using the changeset viewer.