Changeset 1595 for trunk/Clp


Ignore:
Timestamp:
Aug 28, 2010 9:03:22 PM (9 years ago)
Author:
lou
Message:

Remove setObjectiveAndRefresh. Make getReducedGradient const. A few other
minor tweaks.

Location:
trunk/Clp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r1592 r1595  
    45554555  return difference;
    45564556}
    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*/
    45594561int
    45604562OsiClpSolverInterface::readMps(const char *filename,
     
    45754577  numberSOS_=0;
    45764578  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) ;
    45774582  int numberErrors = m.readMps(filename,extension,numberSOS_,sets);
     4583  modelPtr_->messageHandler()->setLogLevel(saveLogLevel) ;
    45784584  if (numberSOS_) {
    45794585    setInfo_ = new CoinSet[numberSOS_];
     
    56405646                                          double* columnReducedCosts,
    56415647                                          double * duals,
    5642                                           const double * c)
     5648                                          const double * c) const
    56435649{
    56445650  assert (modelPtr_->solveType()==2);
     
    56575663}
    56585664
     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
    56595670/* 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*/
    56615673void OsiClpSolverInterface::setObjectiveAndRefresh(const double* c)
    56625674{
     
    56715683  modelPtr_->computeDuals(NULL);
    56725684}
     5685#endif
    56735686
    56745687//Get a row of the tableau (slack part in slack if not NULL)
  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.hpp

    r1592 r1595  
    182182  virtual void getReducedGradient(double* columnReducedCosts,
    183183                                  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 ;
    189185 
    190186  ///Get a row of the tableau (slack part in slack if not NULL)
  • trunk/Clp/test/OsiClpSolverInterfaceTest.cpp

    r1559 r1595  
    11751175    m.initialSolve();
    11761176  }
     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*/
    11771187  // Do parametrics on the objective by hand
    1178   {   
     1188  {
     1189    std::cout << " Beginning Osi Simplex mode 2 ... " << std::endl ;
    11791190    OsiClpSolverInterface m;
    11801191    std::string fn = mpsDir+"p0033";
     
    12071218    double totalDone=0.0;
    12081219    while (true) {
     1220      std::cout << " Starting iterations ... " << std::endl ;
    12091221      // Save current
    12101222      // (would be more accurate to start from scratch)
     
    12921304    delete [] djsNow;
    12931305    // exit special mode
     1306    std::cout << " Finished simplex mode 2 ; checking result." << std::endl ;
    12941307    m.disableSimplexInterface();
    12951308    simplex->messageHandler()->setLogLevel(4);
     
    12971310    assert (!m.getIterationCount());
    12981311  }
     1312# endif
    12991313  // Solve an lp when interface is on
    13001314  {   
Note: See TracChangeset for help on using the changeset viewer.