Changeset 567:3314f58e7b25 in lemon-main
- Timestamp:
- 04/01/09 22:58:58 (16 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r564 r567 12 12 m4/lx_check_glpk.m4 \ 13 13 m4/lx_check_soplex.m4 \ 14 m4/lx_check_clp.m4 \ 15 m4/lx_check_cbc.m4 \ 14 16 CMakeLists.txt \ 15 17 cmake/FindGhostscript.cmake \ -
configure.ac
r564 r567 61 61 LX_CHECK_SOPLEX 62 62 LX_CHECK_CLP 63 LX_CHECK_CBC 63 64 64 65 AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"]) … … 120 121 echo SOPLEX support................ : $lx_soplex_found 121 122 echo CLP support................... : $lx_clp_found 123 echo CBC support................... : $lx_cbc_found 122 124 echo 123 125 echo Build additional tools........ : $enable_tools -
lemon/Makefile.am
r550 r567 13 13 lemon/lp_base.cc \ 14 14 lemon/lp_skeleton.cc \ 15 15 lemon/random.cc \ 16 16 lemon/bits/windows.cc 17 17 … … 22 22 $(CPLEX_CFLAGS) \ 23 23 $(SOPLEX_CXXFLAGS) \ 24 $(CLP_CXXFLAGS) 24 $(CLP_CXXFLAGS) \ 25 $(CBC_CXXFLAGS) 25 26 26 27 lemon_libemon_la_LDFLAGS = \ … … 28 29 $(CPLEX_LIBS) \ 29 30 $(SOPLEX_LIBS) \ 30 $(CLP_LIBS) 31 $(CLP_LIBS) \ 32 $(CBC_LIBS) 31 33 32 34 if HAVE_GLPK … … 44 46 if HAVE_CLP 45 47 lemon_libemon_la_SOURCES += lemon/clp.cc 48 endif 49 50 if HAVE_CBC 51 lemon_libemon_la_SOURCES += lemon/cbc.cc 46 52 endif 47 53 -
lemon/config.h.in
r517 r567 19 19 /* Define to 1 if you have CLP */ 20 20 #undef HAVE_CLP 21 22 /* Define to 1 if you have CBC */ 23 #undef HAVE_CBC -
test/mip_test.cc
r551 r567 19 19 #include "test_tools.h" 20 20 21 22 21 #ifdef HAVE_CONFIG_H 23 22 #include <lemon/config.h> … … 30 29 #ifdef HAVE_GLPK 31 30 #include <lemon/glpk.h> 31 #endif 32 33 #ifdef HAVE_CBC 34 #include <lemon/cbc.h> 32 35 #endif 33 36 … … 58 61 void aTest(MipSolver& mip) 59 62 { 60 //The following example is very simple63 //The following example is very simple 61 64 62 65 63 66 typedef MipSolver::Row Row; 64 67 typedef MipSolver::Col Col; 65 66 68 67 69 … … 75 77 mip.max(); 76 78 77 78 79 //Unconstrained optimization 79 80 mip.solve(); … … 81 82 82 83 //Constraints 83 mip.addRow(2 *x1+x2 <=2);84 mip.addRow(x1-2*x2 <=0);84 mip.addRow(2 * x1 + x2 <= 2); 85 Row y2 = mip.addRow(x1 - 2 * x2 <= 0); 85 86 86 87 //Nonnegativity of the variable x1 87 88 mip.colLowerBound(x1, 0); 89 88 90 89 91 //Maximization of x1 … … 91 93 double expected_opt=4.0/5.0; 92 94 solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt); 95 93 96 94 97 //Restrict x2 to integer … … 103 106 solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt); 104 107 105 108 //Erase a variable 109 mip.erase(x2); 110 mip.rowUpperBound(y2, 8); 111 expected_opt=1; 112 solveAndCheck(mip, MipSolver::OPTIMAL, expected_opt); 106 113 107 114 } 115 108 116 109 117 template<class MIP> … … 145 153 #endif 146 154 155 #ifdef HAVE_CBC 156 { 157 CbcMip mip1; 158 aTest(mip1); 159 cloneTest<CbcMip>(); 160 } 161 #endif 162 147 163 return 0; 148 164
Note: See TracChangeset
for help on using the changeset viewer.