Changeset 11:4fc6ad2fb8a6 in lemon-project-template-glpk
- Timestamp:
- 11/06/11 21:43:29 (13 years ago)
- Branch:
- default
- Phase:
- public
- Tags:
- tip
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CMakeLists.txt
r8 r11 20 20 21 21 TARGET_LINK_LIBRARIES(lemon-project 22 ${LEMON_LIBRARIES} 22 ${LEMON_LIBRARIES} glpk 23 23 ) 24 24 -
src/main.cc
r7 r11 17 17 */ 18 18 19 #include<lemon/arg_parser.h> 19 20 #include<lemon/list_graph.h> 21 #include<lemon/glpk.h> 20 22 21 23 ///The main entry point 22 int main( )24 int main(int argc, char **argv) 23 25 { 26 27 lemon::ArgParser ap(argc,argv); 28 ap.run(); 29 24 30 lemon::ListGraph g; 25 31 g.addNode(); 32 33 typedef lemon::GlpkLp Solver; 34 Solver lp; 35 Solver::Col x = lp.addCol(); 36 Solver::Col y = lp.addCol(); 37 lp.colLowerBound(x,0); 38 lp.colLowerBound(y,0); 39 lp.addRow(3<=x+2*y<=10); 40 lp.obj(-4*x+3*y); 41 lp.max(); 42 lp.solve(); 43 26 44 }
Note: See TracChangeset
for help on using the changeset viewer.