Ignore:
Timestamp:
Sep 24, 2014 6:16:34 AM (5 years ago)
Author:
forrest
Message:

changes for non simplex solvers

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src

  • trunk/Cbc/src/CbcModel.cpp

    r2078 r2080  
    25752575      }
    25762576      CoinWarmStartBasis * basis = dynamic_cast<CoinWarmStartBasis *> (solver_->getEmptyWarmStart());
    2577       int numberIterations=0;
    25782577      for (int i=0;i<numberModels;i++) {
    25792578        rootModels[i]=new CbcModel(*this);
     
    26332632#ifndef NEW_RANDOM_BASIS
    26342633            simplex->primal();
    2635             numberIterations=simplex->numberIterations();
    26362634#endif
    26372635          }
     
    27862784    */
    27872785    int iObject ;
    2788     int preferredWay ;
    27892786    int numberUnsatisfied = 0 ;
    27902787    delete [] currentSolution_;
     
    27982795    for (iObject = 0 ; iObject < numberObjects_ ; iObject++) {
    27992796        double infeasibility =
    2800             object_[iObject]->infeasibility(&usefulInfo, preferredWay) ;
     2797            object_[iObject]->checkInfeasibility(&usefulInfo) ;
    28012798        if (infeasibility ) numberUnsatisfied++ ;
    28022799    }
     
    86778674        OsiBranchingInformation usefulInfo = usefulInformation();
    86788675        for (int i = 0; i < numberObjects_ && integerFeasible; i++) {
    8679             int preferredWay;
    8680             double infeasibility = object_[i]->infeasibility(&usefulInfo, preferredWay);
     8676            double infeasibility = object_[i]->checkInfeasibility(&usefulInfo);
    86818677            if (infeasibility)
    86828678                integerFeasible = false;
     
    1314913145    int numberUnsatisfied = 0;
    1315013146    //double sumUnsatisfied=0.0;
    13151     int preferredWay;
    1315213147    int j;
    1315313148    // Point to current solution
     
    1317013165#ifndef SIMPLE_INTEGER
    1317113166        const OsiObject * object = object_[j];
    13172         double infeasibility = object->infeasibility(&usefulInfo, preferredWay);
     13167        double infeasibility = object->checkInfeasibility(&usefulInfo);
    1317313168        if (infeasibility) {
    1317413169            assert (infeasibility > 0);
     
    1319013185    for (; j < numberObjects_; j++) {
    1319113186        const OsiObject * object = object_[j];
    13192         double infeasibility = object->infeasibility(&usefulInfo, preferredWay);
     13187        double infeasibility = object->checkInfeasibility(&usefulInfo);
    1319313188        if (infeasibility) {
    1319413189            assert (infeasibility > 0);
     
    1473114726            // again
    1473214727            //std::cout<<solver_<<std::endl;
     14728
     14729            OsiCuts feasCuts;
     14730
     14731            for (int i = 0; i < numberCutGenerators_ && (feasCuts.sizeRowCuts () == 0); i++) {
     14732              if (generator_ [i] -> normal () &&
     14733                  (!generator_ [i] -> needsOptimalBasis () || solver_ -> basisIsAvailable ()))
     14734                generator_ [i] -> generateCuts (feasCuts, 1 /* = fullscan */, solver_, NULL);
     14735            }
     14736            solver_ -> applyCuts (feasCuts);
     14737
    1473314738            resolve(solver_);
    1473414739            double objval = solver_->getObjValue();
     
    1578915794            if (feasible) {
    1579015795                int iObject ;
    15791                 int preferredWay ;
    1579215796                int numberUnsatisfied = 0 ;
    1579315797                memcpy(currentSolution_, solver_->getColSolution(),
     
    1579815802                for (iObject = 0 ; iObject < numberObjects_ ; iObject++) {
    1579915803                    double infeasibility =
    15800                         object_[iObject]->infeasibility(&usefulInfo, preferredWay) ;
     15804                        object_[iObject]->checkInfeasibility(&usefulInfo) ;
    1580115805                    if (infeasibility ) numberUnsatisfied++ ;
    1580215806                }
     
    1711317117    returnCode = (bestObjective_ - bestPossibleObjective_ < testGap && getCutoffIncrement() >= 0.0);
    1711417118  }
    17115 #if 1
     17119#if 0
    1711617120  if (returnCode) {
    1711717121    if (fabs(bestObjective_+1469650.0)<1.0) {
     
    1820418208    {
    1820518209        int iObject ;
    18206         int preferredWay ;
    1820718210        int numberUnsatisfied = 0 ;
    1820818211        memcpy(currentSolution_, solver_->getColSolution(),
     
    1821318216        for (iObject = 0 ; iObject < numberObjects_ ; iObject++) {
    1821418217            double infeasibility =
    18215                 object_[iObject]->infeasibility(&usefulInfo, preferredWay) ;
     18218                object_[iObject]->checkInfeasibility(&usefulInfo) ;
    1821618219            if (infeasibility) numberUnsatisfied++ ;
    1821718220        }
Note: See TracChangeset for help on using the changeset viewer.