Changeset 158 for trunk


Ignore:
Timestamp:
Aug 17, 2005 5:26:32 AM (15 years ago)
Author:
forrest
Message:

out 128

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcModel.cpp

    r157 r158  
    34413441        if (clpSolver) {
    34423442          // Maybe solver might like to know only column bounds will change
    3443           int options = clpSolver->specialOptions();
    3444           clpSolver->setSpecialOptions(options|128);
     3443          //int options = clpSolver->specialOptions();
     3444          //clpSolver->setSpecialOptions(options|128);
    34453445          clpSolver->synchronizeModel();
    34463446        }
     
    43434343  for (i=0;i<numberObjects_;i++)
    43444344    object_[i]->feasibleRegion();
    4345   /*
    4346     Remove any existing warm start information to be sure there is no
    4347     residual influence on initialSolve().
    4348   */
    4349   CoinWarmStartBasis *slack =
    4350       dynamic_cast<CoinWarmStartBasis *>(solver_->getEmptyWarmStart()) ;
    4351   solver_->setWarmStart(slack);
    4352   delete slack ;
    4353   // Give a hint not to do scaling
    4354   //bool saveTakeHint;
    4355   //OsiHintStrength saveStrength;
    4356   //bool gotHint = (solver_->getHintParam(OsiDoScale,saveTakeHint,saveStrength));
    4357   //assert (gotHint);
    4358   //solver_->setHintParam(OsiDoScale,false,OsiHintTry);
    4359   solver_->initialSolve();
    4360   //solver_->setHintParam(OsiDoScale,saveTakeHint,saveStrength);
    4361   if (!solver_->isProvenOptimal())
    4362     { printf("checkSolution infeas! Retrying wihout scaling.\n");
    4363     bool saveTakeHint;
    4364     OsiHintStrength saveStrength;
    4365     bool savePrintHint;
    4366     solver_->writeMps("infeas");
    4367     bool gotHint = (solver_->getHintParam(OsiDoReducePrint,savePrintHint,saveStrength));
    4368     gotHint = (solver_->getHintParam(OsiDoScale,saveTakeHint,saveStrength));
    4369     solver_->setHintParam(OsiDoScale,false,OsiHintTry);
    4370     solver_->setHintParam(OsiDoReducePrint,false,OsiHintTry) ;
     4345  // We can switch off check
     4346  if ((specialOptions_&4)==0) {
     4347    if ((specialOptions_&2)==0) {
     4348      /*
     4349        Remove any existing warm start information to be sure there is no
     4350        residual influence on initialSolve().
     4351      */
     4352      CoinWarmStartBasis *slack =
     4353        dynamic_cast<CoinWarmStartBasis *>(solver_->getEmptyWarmStart()) ;
     4354      solver_->setWarmStart(slack);
     4355      delete slack ;
     4356    }
     4357    // Give a hint not to do scaling
     4358    //bool saveTakeHint;
     4359    //OsiHintStrength saveStrength;
     4360    //bool gotHint = (solver_->getHintParam(OsiDoScale,saveTakeHint,saveStrength));
     4361    //assert (gotHint);
     4362    //solver_->setHintParam(OsiDoScale,false,OsiHintTry);
    43714363    solver_->initialSolve();
    4372     solver_->setHintParam(OsiDoScale,saveTakeHint,saveStrength);
    4373     solver_->setHintParam(OsiDoReducePrint,savePrintHint,OsiHintTry) ;
    4374     }
    4375   //assert(solver_->isProvenOptimal());
     4364    //solver_->setHintParam(OsiDoScale,saveTakeHint,saveStrength);
     4365    if (!solver_->isProvenOptimal())
     4366      { printf("checkSolution infeas! Retrying wihout scaling.\n");
     4367      bool saveTakeHint;
     4368      OsiHintStrength saveStrength;
     4369      bool savePrintHint;
     4370      solver_->writeMps("infeas");
     4371      bool gotHint = (solver_->getHintParam(OsiDoReducePrint,savePrintHint,saveStrength));
     4372      gotHint = (solver_->getHintParam(OsiDoScale,saveTakeHint,saveStrength));
     4373      solver_->setHintParam(OsiDoScale,false,OsiHintTry);
     4374      solver_->setHintParam(OsiDoReducePrint,false,OsiHintTry) ;
     4375      solver_->initialSolve();
     4376      solver_->setHintParam(OsiDoScale,saveTakeHint,saveStrength);
     4377      solver_->setHintParam(OsiDoReducePrint,savePrintHint,OsiHintTry) ;
     4378      }
     4379    //assert(solver_->isProvenOptimal());
     4380  }
    43764381  double objectiveValue = solver_->getObjValue()*solver_->getObjSense();
    43774382
     
    43874392    Perhaps an opportunity for a sanity check?
    43884393  */
    4389   if (solver_->isProvenOptimal() && objectiveValue <= cutoff)
     4394  if ((solver_->isProvenOptimal()||(specialOptions_&4)!=0) && objectiveValue <= cutoff)
    43904395  {
    43914396    double * solution = new double[numberColumns];
Note: See TracChangeset for help on using the changeset viewer.