Ignore:
Timestamp:
Jan 22, 2009 4:30:56 PM (11 years ago)
Author:
forrest
Message:

slight modification for rounding heuristic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicFPump.cpp

    r1127 r1129  
    382382    exactMultiple = floor(exactMultiple+0.5);
    383383  //printf("exact multiple %g\n",exactMultiple);
     384  // Clone solver for rounding
     385  OsiSolverInterface * clonedSolver = model_->solver()->clone();
    384386  while (!exitAll) {
    385387    // Cutoff rhs
     
    11931195          }
    11941196          if (true) {
    1195             OsiSolverInterface * saveSolver = model_->swapSolver(solver);
    1196             double * currentObjective =
    1197               CoinCopyOfArray(solver->getObjCoefficients(),numberColumns);
    1198             //double * saveSolution = CoinCopyOfArray(solution,numberColumns);
    1199             solver->setObjective(saveObjective);
    1200             double saveOffset2;
    1201             solver->getDblParam(OsiObjOffset,saveOffset2);
    1202             //assert (saveOffset==saveOffset2);
    1203             solver->setDblParam(OsiObjOffset,saveOffset);
     1197            OsiSolverInterface * saveSolver = model_->swapSolver(clonedSolver);
     1198            clonedSolver->setColSolution(solver->getColSolution());
    12041199            CbcRounding heuristic1(*model_);
    12051200            heuristic1.setHeuristicName("rounding in feaspump!");
     
    12101205                                                 roundingSolution,
    12111206                                                 testSolutionValue) ;
    1212             solver->setObjective(currentObjective);
    1213             solver->setDblParam(OsiObjOffset,saveOffset2);
    1214             //if ((switches_&16)==0||numberPasses<-10)
    1215             //solver->setColSolution(saveSolution);
    1216             //delete [] saveSolution;
    1217             delete [] currentObjective;
    12181207            if (returnCode==1) {
    12191208#ifdef COIN_DEVELOP
     
    18471836    delete newSolver;
    18481837  }
     1838  delete clonedSolver;
    18491839  delete [] roundingSolution;
    18501840  delete [] usedColumn;
Note: See TracChangeset for help on using the changeset viewer.