Changeset 1543:a88ccf686a61 in lemon-0.x for test/lp_test.cc
- Timestamp:
- 07/07/05 17:58:19 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2038
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/lp_test.cc
r1542 r1543 1 #include<lemon/lp_skeleton.h> 1 #include <sstream> 2 #include <lemon/lp_skeleton.h> 2 3 #include "test_tools.h" 3 4 … … 185 186 186 187 void solveAndCheck(LpSolverBase& lp, LpSolverBase::SolutionStatus stat, 187 double exp_opt){ 188 double exp_opt) { 189 using std::string; 188 190 lp.solve(); 189 191 //int decimal,sign; 190 std::string buf1; 192 std::ostringstream buf; 193 buf << "Primalstatus should be: " << int(stat); 194 191 195 // itoa(stat,buf1, 10); 192 check(lp.primalStatus()==stat,"Primalstatus should be "+buf1); 193 194 if (stat == LpSolverBase::OPTIMAL){ 195 check(std::abs(lp.primalValue()-exp_opt)<1e-3, 196 "Wrong optimal value: the right optimum is "); 196 check(lp.primalStatus()==stat, buf.str()); 197 198 if (stat == LpSolverBase::OPTIMAL) { 199 std::ostringstream buf; 200 buf << "Wrong optimal value: the right optimum is " << exp_opt; 201 check(std::abs(lp.primalValue()-exp_opt) < 1e-3, buf.str()); 197 202 //+ecvt(exp_opt,2) 198 203 }
Note: See TracChangeset
for help on using the changeset viewer.