diff -r 4b3191b4970b -r cd8897f67c26 test/mip_test.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/mip_test.cc Mon Jul 17 09:00:21 2006 +0000 @@ -0,0 +1,50 @@ +#include +//#include + +using namespace lemon; + +int main(){ + + //MipGlpk ilp; + + Mip ilp; + + + typedef Mip::Row Row; + typedef Mip::Col Col; + + ilp.max(); + + Col x1 = ilp.addCol(); + Col x2 = ilp.addCol(); + Col x3 = ilp.addCol(); + + ilp.integer(x1,true); + ilp.integer(x2,true); + ilp.integer(x3,true); + + ilp.addRow(x1+x2+x3 <=100); + ilp.addRow(10*x1+4*x2+5*x3<=600); + ilp.addRow(2*x1+2*x2+6*x3<=300); + + ilp.colLowerBound(x1, 0); + ilp.colLowerBound(x2, 0); + ilp.colLowerBound(x3, 0); + //Objective function + ilp.setObj(10*x1+6*x2+4*x3); + + //Call the routine of the underlying LP solver + ilp.solve(); + + //Print results + if (ilp.primalStatus()==LpSolverBase::OPTIMAL){ + std::cout<<"Optimal solution found!"<