# HG changeset patch # User athos # Date 1153221114 0 # Node ID b437bdee6fd0c7ef75328d137a2347986c1f0af2 # Parent ab368e0ab662e14e3eff2412193b9bfb2b2d0b10 Some tests added to the test file mip_test.cc. One problem is the verbosity of the mip solver in glpk which I couldn't find how to kill. diff -r ab368e0ab662 -r b437bdee6fd0 lemon/mip_glpk.cc --- a/lemon/mip_glpk.cc Mon Jul 17 11:56:17 2006 +0000 +++ b/lemon/mip_glpk.cc Tue Jul 18 11:11:54 2006 +0000 @@ -30,7 +30,7 @@ lpx_set_class(lp,LPX_MIP); } - void MipGlpk::_colType(int i, ColTypes col_type){ + void MipGlpk::_colType(int i, MipGlpk::ColTypes col_type){ switch (col_type){ case INTEGER: lpx_set_col_kind(lp,i,LPX_IV); @@ -38,12 +38,12 @@ case REAL: lpx_set_col_kind(lp,i,LPX_CV); break; - default: + default:; //FIXME problem } } - ColTypes MipGlpk::_colType(int i){ + MipGlpk::ColTypes MipGlpk::_colType(int i){ switch (lpx_get_col_kind(lp,i)){ case LPX_IV: return INTEGER;//Or binary diff -r ab368e0ab662 -r b437bdee6fd0 test/mip_test.cc --- a/test/mip_test.cc Mon Jul 17 11:56:17 2006 +0000 +++ b/test/mip_test.cc Tue Jul 18 11:11:54 2006 +0000 @@ -1,12 +1,82 @@ #include +#include "test_tools.h" using namespace lemon; -int main(){ +void solveAndCheck(Mip& lp, LpSolverBase::SolutionStatus stat, + double exp_opt) { + using std::string; + lp.solve(); + //int decimal,sign; + std::ostringstream buf; + buf << "Primalstatus should be: " << int(stat)<<" and it is "<