# HG changeset patch # User alpar # Date 1118757328 0 # Node ID a3484f00a5f0fbcbc2d71f48b038950570abbb9b # Parent e427615afb48124be941c74d767621332198fe1c - lp_test is made working. - some more 'const' for those who like them.. diff -r e427615afb48 -r a3484f00a5f0 lemon/lp_base.h --- a/lemon/lp_base.h Tue Jun 14 10:26:37 2005 +0000 +++ b/lemon/lp_base.h Tue Jun 14 13:55:28 2005 +0000 @@ -47,12 +47,12 @@ ///\param n is a floating id ///\return the corresponding fix id - int fixId(int n) {return cross[n];} + int fixId(int n) const {return cross[n];} ///Convert a fix id to a floating one ///\param n is a fix id ///\return the corresponding floating id - int floatingId(int n) { return index[n];} + int floatingId(int n) const { return index[n];} ///Add a new floating id. ///\param n is a floating id diff -r e427615afb48 -r a3484f00a5f0 test/lp_test.cc --- a/test/lp_test.cc Tue Jun 14 10:26:37 2005 +0000 +++ b/test/lp_test.cc Tue Jun 14 13:55:28 2005 +0000 @@ -40,6 +40,12 @@ LP::Col p1,p2,p3,p4,p5; LP::Constr c; + p1=lp.addCol(); + p2=lp.addCol(); + p3=lp.addCol(); + p4=lp.addCol(); + p5=lp.addCol(); + e[p1]=2; e.constComp()=12; e[p1]+=2; @@ -199,11 +205,15 @@ lp.max(); lp.solve(); - + double opt=122.0/9.0; + if (lp.primalStatus()==LpSolverBase::OPTIMAL){ - printf("Z = %g; x1 = %g; x2 = %g\n", - lp.primalValue(), - lp.primal(x1), lp.primal(x2)); + std::cout<< "Z = "<