Changeset 1979


Ignore:
Timestamp:
May 27, 2012 6:42:58 AM (7 years ago)
Author:
pbonami
Message:

Fix cutoff computation in case of negative objective

Location:
trunk/Bonmin/src/Algorithms/OaGenerators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonOaDecBase.cpp

    r1961 r1979  
    288288       if(savedCuts_.rowCut(i).violated(colsol) > 0.){
    289289#ifdef OA_DEBUG
    290          printf("A violated cut has been found\n");
     290         printf("A violated saved cut has been found\n");
    291291#endif
    292292         savedCuts_.rowCut(i).setEffectiveness(9.99e99);
  • trunk/Bonmin/src/Algorithms/OaGenerators/BonOaFeasChecker.cpp

    r1865 r1979  
    6666        //nlp solved and feasible
    6767        // Update the cutoff
    68         cutoff = nlp_->getObjValue() *(1 - parameters_.cbcCutoffIncrement_);
     68        double ub = nlp_->getObjValue();
     69        cutoff = ub > 0 ? ub *(1 - parameters_.cbcCutoffIncrement_) : ub*(1 + parameters_.cbcCutoffIncrement_);
    6970        // Update the lp solver cutoff
    7071        lp->setDblParam(OsiDualObjectiveLimit, cutoff);
     
    107108      if (changed) {
    108109       branch_info.solution_ = lp->getColSolution();
    109         isInteger = integerFeasible(*lp,branch_info, parameters_.cbcIntegerTolerance_,
     110       isInteger = integerFeasible(*lp,branch_info, parameters_.cbcIntegerTolerance_,
    110111                                     objects_, nObjects_);
    111112      }
Note: See TracChangeset for help on using the changeset viewer.