- Timestamp:
- Aug 28, 2010 9:03:22 PM (11 years ago)
- Location:
- trunk/Clp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Clp/src/OsiClp/OsiClpSolverInterface.cpp
r1592 r1595 4555 4555 return difference; 4556 4556 } 4557 /* Read an mps file from the given filename (defaults to Osi reader) - returns 4558 number of errors (see OsiMpsReader class) */ 4557 /* 4558 Read an mps file from the given filename - returns number of errors 4559 (see CoinMpsIO class) 4560 */ 4559 4561 int 4560 4562 OsiClpSolverInterface::readMps(const char *filename, … … 4575 4577 numberSOS_=0; 4576 4578 CoinSet ** sets=NULL; 4579 // Temporarily reduce log level to get CoinMpsIO to shut up. 4580 int saveLogLevel = modelPtr_->messageHandler()->logLevel() ; 4581 modelPtr_->messageHandler()->setLogLevel(0) ; 4577 4582 int numberErrors = m.readMps(filename,extension,numberSOS_,sets); 4583 modelPtr_->messageHandler()->setLogLevel(saveLogLevel) ; 4578 4584 if (numberSOS_) { 4579 4585 setInfo_ = new CoinSet[numberSOS_]; … … 5640 5646 double* columnReducedCosts, 5641 5647 double * duals, 5642 const double * c) 5648 const double * c) const 5643 5649 { 5644 5650 assert (modelPtr_->solveType()==2); … … 5657 5663 } 5658 5664 5665 #if 0 5666 5667 Deleted from OsiSimplex API 100828. Leave the code here for a bit just in 5668 case someone yells. -- lh, 100828 -- 5669 5659 5670 /* Set a new objective and apply the old basis so that the 5660 reduced costs are properly updated */ 5671 reduced costs are properly updated 5672 */ 5661 5673 void OsiClpSolverInterface::setObjectiveAndRefresh(const double* c) 5662 5674 { … … 5671 5683 modelPtr_->computeDuals(NULL); 5672 5684 } 5685 #endif 5673 5686 5674 5687 //Get a row of the tableau (slack part in slack if not NULL) -
trunk/Clp/src/OsiClp/OsiClpSolverInterface.hpp
r1592 r1595 182 182 virtual void getReducedGradient(double* columnReducedCosts, 183 183 double * duals, 184 const double * c); 185 186 /** Set a new objective and apply the old basis so that the 187 reduced costs are properly updated */ 188 virtual void setObjectiveAndRefresh(const double* c); 184 const double * c) const ; 189 185 190 186 ///Get a row of the tableau (slack part in slack if not NULL) -
trunk/Clp/test/OsiClpSolverInterfaceTest.cpp
r1559 r1595 1175 1175 m.initialSolve(); 1176 1176 } 1177 # if 0 1178 /* 1179 This section stops working without setObjectiveAndRefresh. Assertion failure 1180 down in the guts of clp, likely due to reduced costs not properly updated. 1181 Leave the code in for a bit so it's easily recoverable if anyone actually 1182 yells about the loss. There was no response to a public announcement 1183 of intent to delete, but sometimes it takes a whack on the head to get 1184 peoples' attention. At some point, it'd be good to come back through and 1185 make this work again. -- lh, 100828 -- 1186 */ 1177 1187 // Do parametrics on the objective by hand 1178 { 1188 { 1189 std::cout << " Beginning Osi Simplex mode 2 ... " << std::endl ; 1179 1190 OsiClpSolverInterface m; 1180 1191 std::string fn = mpsDir+"p0033"; … … 1207 1218 double totalDone=0.0; 1208 1219 while (true) { 1220 std::cout << " Starting iterations ... " << std::endl ; 1209 1221 // Save current 1210 1222 // (would be more accurate to start from scratch) … … 1292 1304 delete [] djsNow; 1293 1305 // exit special mode 1306 std::cout << " Finished simplex mode 2 ; checking result." << std::endl ; 1294 1307 m.disableSimplexInterface(); 1295 1308 simplex->messageHandler()->setLogLevel(4); … … 1297 1310 assert (!m.getIterationCount()); 1298 1311 } 1312 # endif 1299 1313 // Solve an lp when interface is on 1300 1314 {
Note: See TracChangeset
for help on using the changeset viewer.